mailr21527 - /branches/relax_disp/specific_analyses/relax_disp/api.py


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

Header


Content

Posted by edward on November 19, 2013 - 17:05:
Author: bugman
Date: Tue Nov 19 17:05:24 2013
New Revision: 21527

URL: http://svn.gna.org/viewcvs/relax?rev=21527&view=rev
Log:
The dispersion specific overfit_deselect() method now handles the MMQ-type 
models better.


Modified:
    branches/relax_disp/specific_analyses/relax_disp/api.py

Modified: branches/relax_disp/specific_analyses/relax_disp/api.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/specific_analyses/relax_disp/api.py?rev=21527&r1=21526&r2=21527&view=diff
==============================================================================
--- branches/relax_disp/specific_analyses/relax_disp/api.py (original)
+++ branches/relax_disp/specific_analyses/relax_disp/api.py Tue Nov 19 
17:05:24 2013
@@ -41,10 +41,11 @@
 from multi import Processor_box
 from pipe_control import pipes, sequence
 from pipe_control.mol_res_spin import check_mol_res_spin_data, return_spin, 
spin_loop
+from pipe_control.sequence import return_attached_protons
 from specific_analyses.api_base import API_base
 from specific_analyses.api_common import API_common
 from specific_analyses.relax_disp.checks import check_c_modules, 
check_disp_points, check_exp_type, check_exp_type_fixed_time, 
check_model_type, check_pipe_type, check_spectra_id_setup
-from specific_analyses.relax_disp.disp_data import average_intensity, 
find_intensity_keys, get_curve_type, has_exponential_exp_type, loop_cluster, 
loop_exp_frq_point, loop_exp_frq_point_time, loop_frq, loop_time, 
return_cpmg_frqs, return_index_from_disp_point, return_index_from_exp_type, 
return_index_from_frq, return_offset_data, return_param_key_from_data, 
return_r1_data, return_r2eff_arrays, return_spin_lock_nu1, 
spin_ids_to_containers
+from specific_analyses.relax_disp.disp_data import average_intensity, 
find_intensity_keys, get_curve_type, has_exponential_exp_type, 
has_proton_mq_cpmg, has_proton_sq_cpmg, loop_cluster, loop_exp_frq_point, 
loop_exp_frq_point_time, loop_frq, loop_time, return_cpmg_frqs, 
return_index_from_disp_point, return_index_from_exp_type, 
return_index_from_frq, return_offset_data, return_param_key_from_data, 
return_r1_data, return_r2eff_arrays, return_spin_lock_nu1, 
spin_ids_to_containers
 from specific_analyses.relax_disp.optimisation import Disp_memo, 
Disp_minimise_command, grid_search_setup
 from specific_analyses.relax_disp.parameters import assemble_param_vector, 
assemble_scaling_matrix, disassemble_param_vector, get_param_names, 
linear_constraints, param_index_to_param_info, param_num
 from specific_analyses.relax_disp.variables import MODEL_LIST_FULL, 
MODEL_LM63, MODEL_LM63_3SITE, MODEL_CR72, MODEL_CR72_FULL, MODEL_DPL94, 
MODEL_IT99, MODEL_LIST_MMQ, MODEL_M61, MODEL_M61B, MODEL_MMQ_2SITE, 
MODEL_MP05, MODEL_MQ_CR72, MODEL_NOREX, MODEL_NS_CPMG_2SITE_3D, 
MODEL_NS_CPMG_2SITE_3D_FULL, MODEL_NS_CPMG_2SITE_EXPANDED, 
MODEL_NS_CPMG_2SITE_STAR, MODEL_NS_CPMG_2SITE_STAR_FULL, 
MODEL_NS_R1RHO_2SITE, MODEL_R2EFF, MODEL_TAP03, MODEL_TP02, MODEL_TSMFK01
@@ -1071,10 +1072,35 @@
         # Test the sequence data exists.
         check_mol_res_spin_data()
 
+        # MMQ flags.
+        proton_sq_flag = has_proton_sq_cpmg()
+        proton_mq_flag = has_proton_mq_cpmg()
+        proton_mmq_flag = proton_sq_flag or proton_mq_flag
+
         # Loop over spin data.
         for spin, spin_id in spin_loop(return_id=True, skip_desel=True):
+            # Skip protons for MMQ data.
+            if spin.model in MODEL_LIST_MMQ and spin.isotope == '1H':
+                continue
+
+            # Get the attached proton.
+            proton = None
+            if proton_mmq_flag:
+                # Get all protons.
+                proton_spins = return_attached_protons(spin_id)
+
+                # Only one allowed.
+                if len(proton_spins) > 1:
+                    print("Multiple protons attached to the spin '%s', but 
one one attached proton is supported for the MMQ-type models." % spin_id)
+                    spin.select = False
+                    continue
+
+                # Alias the single proton.
+                if len(proton_spins):
+                    proton = proton_spins[0]
+
             # Check if data exists.
-            if not hasattr(spin, 'r2eff'):
+            if not hasattr(spin, 'r2eff') and not hasattr(proton, 'r2eff'):
                 print("No R2eff data could be found, deselecting the '%s' 
spin." % spin_id)
                 spin.select = False
                 continue




Related Messages


Powered by MHonArc, Updated Tue Nov 19 17:20:02 2013