mailRe: r22198 - /trunk/test_suite/system_tests/relax_disp.py


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

Header


Content

Posted by Edward d'Auvergne on February 18, 2014 - 15:50:
Ah, that's the problem.  You'll need to replace this with one of the
relaxation dispersion loops, have a look at the loop_*() functions in
specific_analyses.relax_disp.disp_data.  You could for example use the
loop_exp_frq_offset_point() and then count the time points for each of
these iterations.  This is only one of many alternatives.

If you feel more adventurous, you could make the count_relax_times()
function dependent on ei, mi, oi, and di (see the module docstring for
a description of this:
http://www.nmr-relax.com/api/3.1/specific_analyses.relax_disp.disp_data-module.html).
 You would then have to delete the use of loop_time() and do something
as in the insignificance() function.

There are other ways too.  The key is to loop over each experiment
collection of {ei, mi, oi, di} and check the times for each.  If there
is only one time for the experiment block, then this is the 2-point
calculation.  If there is more, then exponential curve fitting is
needed.  If one block of {ei, mi, oi, di} is 2-point and another is
exponential, then relax will fail.  But this type of data combination
is very unlikely to ever be encountered and we can deal with that when
a user complains ;)

Anyway, have a look at specific_analyses.relax_disp.disp_data for
inspiration, as all the code you need to write can be copied from
various functions of that module.  The logic you need is repeated in
about 10 functions there.  I hope this helps.

Regards,

Edward




On 18 February 2014 15:35, Troels Emtekær Linnet <tlinnet@xxxxxxxxxxxxx> 
wrote:
Hi Edward.

Do you have a feeling for how much modification of relax is needed?

There is a dependency check, that the length of cdp.relax_time_list is
not larger than 1.

Is it within range to allow more than one delay time?

Best
Troels

2014-02-18 14:21 GMT+01:00 Edward d'Auvergne <edward@xxxxxxxxxxxxx>:
Hi Troels,

I would then recommend you create 2 tests, as it looks to me like the
fundamental issues are the same - that the detection of 2-point verses
full exponential curves is not functioning correctly.  The two tests,
once the bug is fixed, will the make sure that both these errors will
never again be seen by relax users!

Cheers,

Edward



On 18 February 2014 12:40, Troels Emtekær Linnet <tlinnet@xxxxxxxxxxxxx> 
wrote:
If the systemtest is modified to:

        self.interpreter.calc(verbosity=1)

The error is:

Traceback (most recent call last):
  File 
"/sbinlab2/tlinnet/software/NMR-relax/relax_trunk/test_suite/system_tests/relax_disp.py",
line 278, in test_bug_21665_cpmg_two_fields_two_delaytimes_fail
    self.interpreter.calc(verbosity=1)
  File 
"/sbinlab2/tlinnet/software/NMR-relax/relax_trunk/prompt/uf_objects.py",
line 221, in __call__
    self._backend(*new_args, **uf_kargs)
  File 
"/sbinlab2/tlinnet/software/NMR-relax/relax_trunk/pipe_control/minimise.py",
line 86, in calc
    calculate(verbosity=verbosity)
  File 
"/sbinlab2/tlinnet/software/NMR-relax/relax_trunk/specific_analyses/relax_disp/api.py",
line 717, in calculate
    self._calculate_r2eff()
  File 
"/sbinlab2/tlinnet/software/NMR-relax/relax_trunk/specific_analyses/relax_disp/api.py",
line 182, in _calculate_r2eff
    check_exp_type_fixed_time()
  File 
"/sbinlab2/tlinnet/software/NMR-relax/relax_trunk/specific_analyses/relax_disp/checks.py",
line 112, in check_exp_type_fixed_time
    raise RelaxError("The experiment '%s' is not of the fixed
relaxation time period data type." % exp_type)
RelaxError: RelaxError: The experiment 'SQ CPMG' is not of the fixed
relaxation time period data type.


2014-02-18 12:24 GMT+01:00 Troels Emtekær Linnet <tlinnet@xxxxxxxxxxxxx>:
Hi Edward.

The systemtest is now implemented.
I think this bug is related to:
bug #21344 (https://gna.org/bugs/?21344): Handling of in sparse
acquired R1rho dataset with missing combinations of time and spin-lock
field strengths.

The output of the systemtest gives:
------------
Fitting to spin :2@N, frequency 499862140.0 and dispersion point 50.0
---------------------------------------------------------------------

Unconstrained grid search size: 9 (constraints may decrease this size).

Traceback (most recent call last):
  File 
"/sbinlab2/tlinnet/software/NMR-relax/relax_trunk/test_suite/system_tests/relax_disp.py",
line 281, in test_bug_21665_cpmg_two_fields_two_delaytimes_fail
    relax_disp.Relax_disp(pipe_name="compare_128_FT_R2eff",
pipe_bundle="cpmg_disp_sod1d90a", results_dir=self.tmpdir,
models=['R2eff'], grid_inc=3, mc_sim_num=5, modsel='AIC',
pre_run_dir=None, insignificance=1.0, numeric_only=False,
mc_sim_all_models=False, eliminate=True)
  File 
"/sbinlab2/tlinnet/software/NMR-relax/relax_trunk/auto_analyses/relax_disp.py",
line 116, in __init__
    self.run()
  File 
"/sbinlab2/tlinnet/software/NMR-relax/relax_trunk/auto_analyses/relax_disp.py",
line 451, in run
    self.optimise(model=model)
  File 
"/sbinlab2/tlinnet/software/NMR-relax/relax_trunk/auto_analyses/relax_disp.py",
line 350, in optimise
    self.interpreter.grid_search(inc=self.grid_inc)
  File 
"/sbinlab2/tlinnet/software/NMR-relax/relax_trunk/prompt/uf_objects.py",
line 221, in __call__
    self._backend(*new_args, **uf_kargs)
  File 
"/sbinlab2/tlinnet/software/NMR-relax/relax_trunk/pipe_control/minimise.py",
line 152, in grid_search
    grid_search(lower=lower, upper=upper, inc=inc,
constraints=constraints, verbosity=verbosity)
  File 
"/sbinlab2/tlinnet/software/NMR-relax/relax_trunk/specific_analyses/relax_disp/api.py",
line 1093, in grid_search
    self.minimise(min_algor='grid', lower=lower, upper=upper, inc=inc,
constraints=constraints, verbosity=verbosity, sim_index=sim_index)
  File 
"/sbinlab2/tlinnet/software/NMR-relax/relax_trunk/specific_analyses/relax_disp/api.py",
line 1142, in minimise
    self._minimise_r2eff(min_algor=min_algor, min_options=min_options,
func_tol=func_tol, grad_tol=grad_tol, max_iterations=max_iterations,
constraints=constraints, scaling=scaling, verbosity=verbosity,
sim_index=sim_index, lower=lower, upper=upper, inc=inc)
  File 
"/sbinlab2/tlinnet/software/NMR-relax/relax_trunk/specific_analyses/relax_disp/api.py",
line 382, in _minimise_r2eff
    values.append(average_intensity(spin=spin, exp_type=exp_type,
frq=frq, offset=offset, point=point, time=time, sim_index=sim_index))
  File 
"/sbinlab2/tlinnet/software/NMR-relax/relax_trunk/specific_analyses/relax_disp/disp_data.py",
line 114, in average_intensity
    int_keys = find_intensity_keys(exp_type=exp_type, frq=frq,
offset=offset, point=point, time=time)
  File 
"/sbinlab2/tlinnet/software/NMR-relax/relax_trunk/specific_analyses/relax_disp/disp_data.py",
line 347, in find_intensity_keys
    raise RelaxError("No intensity data could be found corresponding
to the spectrometer frequency of %s MHz, dispersion point of %s and
relaxation time of %s s." % (frq*1e-6, point, time))
RelaxError: RelaxError: No intensity data could be found corresponding
to the spectrometer frequency of 499.86214 MHz, dispersion point of
50.0 and relaxation time of 0.06 s.

-----------------------------

This is true.
For the relaxation time of 0.06 s, there is no dispersion point of 50.0.

Best
Troels

2014-02-18 12:19 GMT+01:00  <tlinnet@xxxxxxxxxxxxx>:
Author: tlinnet
Date: Tue Feb 18 12:19:41 2014
New Revision: 22198

URL: http://svn.gna.org/viewcvs/relax?rev=22198&view=rev
Log:
Added systemtest to catch bug: relax -s 
Relax_disp.test_bug_21665_cpmg_two_fields_two_delaytimes_fail

Regarding bug #21665, (https://gna.org/bugs/?21665) - Running a CPMG 
analysis with two fields at two delay times.

Modified:
    trunk/test_suite/system_tests/relax_disp.py

Modified: trunk/test_suite/system_tests/relax_disp.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/relax_disp.py?rev=22198&r1=22197&r2=22198&view=diff
==============================================================================
--- trunk/test_suite/system_tests/relax_disp.py (original)
+++ trunk/test_suite/system_tests/relax_disp.py Tue Feb 18 12:19:41 2014
@@ -264,6 +264,21 @@
         relax_disp.Relax_disp.opt_max_iterations = 1000
         relax_disp.Relax_disp(pipe_name="origin - relax_disp (Thu Jan  
2 13:46:44 2014)", pipe_bundle="relax_disp (Thu Jan  2 13:46:44 2014)", 
results_dir=self.tmpdir, models=['R2eff', 'No Rex', 'CR72', 'NS CPMG 
2-site expanded'], grid_inc=3, mc_sim_num=5, modsel='AIC', 
pre_run_dir=None, insignificance=1.0, numeric_only=False, 
mc_sim_all_models=False, eliminate=True)

+
+    def test_bug_21665_cpmg_two_fields_two_delaytimes_fail(self):
+        """U{Bug #21665<https://gna.org/bugs/?21665>} catch, the 
failure due to a a CPMG analysis recorded at two fields at two delay 
times."""
+
+        # Clear the data store.
+        self.interpreter.reset()
+
+        # Load the state.
+        state = status.install_path + 
sep+'test_suite'+sep+'shared_data'+sep+'dispersion'+sep+'bug_21665.bz2'
+        self.interpreter.state.load(state, force=True)
+
+        # Execute the auto-analysis (fast).
+        relax_disp.Relax_disp.opt_func_tol = 1e-5
+        relax_disp.Relax_disp.opt_max_iterations = 1000
+        relax_disp.Relax_disp(pipe_name="compare_128_FT_R2eff", 
pipe_bundle="cpmg_disp_sod1d90a", results_dir=self.tmpdir, 
models=['R2eff'], grid_inc=3, mc_sim_num=5, modsel='AIC', 
pre_run_dir=None, insignificance=1.0, numeric_only=False, 
mc_sim_all_models=False, eliminate=True)


     def test_curve_type_cpmg_fixed_time(self):


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

This is the relax-commits mailing list
relax-commits@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-commits

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

This is the relax-devel mailing list
relax-devel@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-devel



Related Messages


Powered by MHonArc, Updated Wed Feb 19 12:40:12 2014