mailRe: r25441 - /trunk/specific_analyses/relax_disp/optimisation.py


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

Header


Content

Posted by Edward d'Auvergne on August 29, 2014 - 17:28:
Well, in this 2-point case, the data has not been collected correctly.
The relaxation time period was too long - hence is not optimal.  You
should always pick a time so that the exponential has not reached the
noise level.  This warning is useful though and the user should
deselect all such spins themselves when looking at their input data,
prior to running an analysis.

Regards,

Edward



On 29 August 2014 16:39,  <tlinnet@xxxxxxxxxxxxx> wrote:
Author: tlinnet
Date: Fri Aug 29 16:39:18 2014
New Revision: 25441

URL: http://svn.gna.org/viewcvs/relax?rev=25441&view=rev
Log:
If math domain errors are found when calculating the the two point R2eff 
values, the point is being skipped.

task #7822(https://gna.org/task/index.php?7822): Implement user function to 
estimate R2eff and associated errors for exponential curve fitting.

Modified:
    trunk/specific_analyses/relax_disp/optimisation.py

Modified: trunk/specific_analyses/relax_disp/optimisation.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/specific_analyses/relax_disp/optimisation.py?rev=25441&r1=25440&r2=25441&view=diff
==============================================================================
--- trunk/specific_analyses/relax_disp/optimisation.py  (original)
+++ trunk/specific_analyses/relax_disp/optimisation.py  Fri Aug 29 16:39:18 
2014
@@ -30,6 +30,7 @@
 from operator import mul
 from re import match, search
 import sys
+from warnings import warn

 # relax module imports.
 from dep_check import C_module_exp_fn
@@ -38,7 +39,7 @@
 from lib.text.sectioning import subsection
 from lib.warnings import RelaxWarning
 from multi import Memo, Result_command, Slave_command
-from pipe_control.mol_res_spin import spin_loop
+from pipe_control.mol_res_spin import generate_spin_string, spin_loop
 from specific_analyses.relax_disp.checks import check_disp_points, 
check_exp_type, check_exp_type_fixed_time
 from specific_analyses.relax_disp.data import average_intensity, 
count_spins, find_intensity_keys, has_exponential_exp_type, 
has_proton_mmq_cpmg, is_r1_optimised, loop_exp, loop_exp_frq_offset_point, 
loop_exp_frq_offset_point_time, loop_frq, loop_offset, loop_time, 
pack_back_calc_r2eff, return_cpmg_frqs, return_offset_data, 
return_param_key_from_data, return_r1_data, return_r2eff_arrays, 
return_spin_lock_nu1
 from specific_analyses.relax_disp.parameters import assemble_param_vector, 
disassemble_param_vector, linear_constraints, param_conversion, param_num, 
r1_setup
@@ -245,7 +246,7 @@
     print("Calculating the R2eff/R1rho values for fixed relaxation time 
period data.")

     # Loop over the spins.
-    for spin, spin_id in spin_loop(return_id=True, skip_desel=True):
+    for spin, mol_name, resi, resn, spin_id in spin_loop(full_info=True, 
return_id=True, skip_desel=True):
         # Spin ID printout.
         print("Spin '%s'." % spin_id)

@@ -285,11 +286,18 @@
             intensity = average_intensity(spin=spin, exp_type=exp_type, 
frq=frq, offset=offset, point=point, time=time)
             intensity_err = average_intensity(spin=spin, 
exp_type=exp_type, frq=frq, offset=offset, point=point, time=time, 
error=True)

-            # Calculate the R2eff value.
-            spin.r2eff[param_key] = calc_two_point_r2eff(relax_time=time, 
I_ref=ref_intensity, I=intensity)
-
-            # Calculate the R2eff error.
-            spin.r2eff_err[param_key] = 
calc_two_point_r2eff_err(relax_time=time, I_ref=ref_intensity, I=intensity, 
I_ref_err=ref_intensity_err, I_err=intensity_err)
+            # Check for math domain errors or log for values less than 0.0.
+            log_val = float(intensity) / ref_intensity
+            if log_val < 0.0:
+                spin_string = generate_spin_string(spin=spin, 
mol_name=mol_name, res_num=resi, res_name=resn)
+                msg = "Math domain error for spin %s in R2eff value 
calculation for fixed relaxation time period data.  I=%3.3f, I_ref=%3.3f.  
The point is skipped." % (spin_string, intensity, ref_intensity)
+                warn(RelaxWarning("%s" % msg))
+            else:
+                # Calculate the R2eff value.
+                spin.r2eff[param_key] = 
calc_two_point_r2eff(relax_time=time, I_ref=ref_intensity, I=intensity)
+
+                # Calculate the R2eff error.
+                spin.r2eff_err[param_key] = 
calc_two_point_r2eff_err(relax_time=time, I_ref=ref_intensity, I=intensity, 
I_ref_err=ref_intensity_err, I_err=intensity_err)


 def minimise_r2eff(spins=None, spin_ids=None, min_algor=None, 
min_options=None, func_tol=None, grad_tol=None, max_iterations=None, 
constraints=False, scaling_matrix=None, verbosity=0, sim_index=None, 
lower=None, upper=None, inc=None):


_______________________________________________
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



Related Messages


Powered by MHonArc, Updated Mon Sep 01 00:00:38 2014