mailRe: A new way to handle peak intensities and their errors: The 'spectrum' verses 'relax_fit' and 'noe' user function classes.


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by Sébastien Morin on December 04, 2008 - 02:06:
Hi Ed,

Ok... That clarifies things...

I first wanted to use the
"test_suite/shared_data/peak_lists/generic.txt" file for the reason that
it includes everything, both intensities and relaxation times. However,
this would mean developing something completely different to what is
made for the reading of the other formats (Sparky, XEasy, nmrview).

Moreover, as you proposed using
"test_suite/shared_data/peak_lists/generic_intensity.txt" and maybe also
"test_suite/shared_data/peak_lists/generic_delays.txt" would be much
easier and simple using the current code...

Thus, that is what I will implement...

Regards,


Séb  :)



Edward d'Auvergne wrote:
Hi,

Sorry, I should have mentioned this earlier.  It might have cleared
things up for you Seb with the generic peak intensity code.  So, now
things are a bit different in relax when handling spectral data.  I
have made a clear separation between the peak intensity reading code -
in generic_fns.spectrum - and the specific analyses such as relaxation
curve-fitting, steady-state NOE analysis, or any new analyses which in
the future might use peak intensities.  This introduces much more
flexibility into relax, but makes it a bit more complicated to read in
the data.  For peak intensities, there are 2 parts required - loading
the intensities from file and setting the intensity errors.  So for
example in the NOE sample script, this is done with the lines:

# Load the reference spectrum and saturated spectrum peak intensities.
spectrum.read_intensities(file='ref.list', spectrum_id='ref_ave')
spectrum.read_intensities(file='sat.list', spectrum_id='sat_ave')

# Set the errors.
spectrum.baseplane_rmsd(error=3600, spectrum_id='ref_ave')
spectrum.baseplane_rmsd(error=3000, spectrum_id='sat_ave')

# Peak intensity error analysis.
spectrum.error_analysis()


The last user function, spectrum.error_analysis() is very important as
it determines the spin specific peak intensity errors.  Reading the
docstring of this user function, through for example:

relax> help(spectrum.error_analysis)

is highly recommended.  The last part for peak intensities in this
script is to associated the spectrum_ids to the experiment.  This
allows multiple reference and saturated spectra to be analysed
simultaneously.  The important part of the script is:

# Set the spectrum types.
noe.spectrum_type('ref', 'ref_ave')
noe.spectrum_type('sat', 'sat_ave')


The rest of the script is the same.  As for the relaxation
curve-fitting sample script, this is a little more elaborate.  First
of all, we load the peak intensities and simultaneously set the time
associated with each point.  The lines are:

# Spectrum names.
names = [
    'T2_ncyc1_ave',
    'T2_ncyc1b_ave',
    'T2_ncyc2_ave',
    'T2_ncyc4_ave',
    'T2_ncyc4b_ave',
    'T2_ncyc6_ave',
    'T2_ncyc9_ave',
    'T2_ncyc9b_ave',
    'T2_ncyc11_ave',
    'T2_ncyc11b_ave'
]

# Relaxation times (in seconds).
times = [
    0.0176,
    0.0176,
    0.0352,
    0.0704,
    0.0704,
    0.1056,
    0.1584,
    0.1584,
    0.1936,
    0.1936
]

# Loop over the spectra.
for i in xrange(len(names)):
    # Load the peak intensities.
    spectrum.read_intensities(file=names[i]+'.list', dir=data_path,
spectrum_id=names[i], int_method='height')

    # Set the relaxation times.
    relax_fit.relax_time(time=times[i], spectrum_id=names[i])


Here the 'names' list contain the spectrum ids, which also correspond
to the base name of the Sparky *.list files read by the
spectrum.read_intensities() user function.  The order of the times in
the 'times' list match the spectrum ids list.  Each spectrum is
associated with its time through the relax_fit.relax_time() user
function.  The next part of the script is:

# Specify the duplicated spectra.
spectrum.replicated(spectrum_ids=['T2_ncyc1_ave', 'T2_ncyc1b_ave'])
spectrum.replicated(spectrum_ids=['T2_ncyc4_ave', 'T2_ncyc4b_ave'])
spectrum.replicated(spectrum_ids=['T2_ncyc9_ave', 'T2_ncyc9b_ave'])
spectrum.replicated(spectrum_ids=['T2_ncyc11_ave', 'T2_ncyc11b_ave'])

# Peak intensity error analysis.
spectrum.error_analysis()


Here, a different type of error analysis is performed as we have
duplicate spectra.  Again see the spectrum.error_analysis() docstring
for full details.  But instead of using the baseplane RMSD measure,
the errors are taken from duplicate spectra as specified by the
spectrum.replicated() user function.  From here, the script is the
same as before.  I hope this description clarifies how peak
intensities are now handled.

Regards,

Edward


P.S.  Note, this is in the 1.3 development line and that the user
function names or the way peak intensities are handles may change if
improvements are found and implemented.

P.P.S.  Seb, for the system test of the generic peak intensity file,
setting the relaxation times should not be done.  I would instead use
the test_suite/shared_data/peak_lists/generic_intensity.txt file for
this test.  If you would like to use the times in the
test_suite/shared_data/peak_lists/generic_delays.txt file, I would
recommend creating a new system test in the
test_suite/system_tests/relax_fit.py file.  This will require a new
user function to be written, something like relax_fit.read_times().
And finally, the file test_suite/shared_data/peak_lists/generic.txt is
no longer necessary.

_______________________________________________
relax (http://nmr-relax.com)

This is the relax-users mailing list
relax-users@xxxxxxx

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-users

  





Related Messages


Powered by MHonArc, Updated Thu Dec 11 19:40:11 2008