Author: bugman Date: Fri Oct 25 18:42:09 2013 New Revision: 21234 URL: http://svn.gna.org/viewcvs/relax?rev=21234&view=rev Log: Added support for the ZQ and DQ CPMG data type to the specific_analyses.relax_disp.disp_data module. This is needed for the 'MQ NS CPMG 2-site' model change to 'MMQ 2-site' and follows from the post at http://article.gmane.org/gmane.science.nmr.relax.devel/4734. This follows the tutorial for adding relaxation dispersion models at: http://wiki.nmr-relax.com/Tutorial_for_adding_relaxation_dispersion_models_to_relax#Creating_a_new_experiment_type. Modified: branches/relax_disp/specific_analyses/relax_disp/disp_data.py Modified: branches/relax_disp/specific_analyses/relax_disp/disp_data.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/specific_analyses/relax_disp/disp_data.py?rev=21234&r1=21233&r2=21234&view=diff ============================================================================== --- branches/relax_disp/specific_analyses/relax_disp/disp_data.py (original) +++ branches/relax_disp/specific_analyses/relax_disp/disp_data.py Fri Oct 25 18:42:09 2013 @@ -47,7 +47,7 @@ from pipe_control.result_files import add_result_file from pipe_control.spectrum import check_spectrum_id from specific_analyses.relax_disp.checks import check_exp_type, check_mixed_curve_types -from specific_analyses.relax_disp.variables import EXP_TYPE_CPMG, EXP_TYPE_DESC_CPMG, EXP_TYPE_DESC_R1RHO, EXP_TYPE_DESC_MQ_CPMG, EXP_TYPE_DESC_MQ_R1RHO, EXP_TYPE_LIST, EXP_TYPE_MQ_CPMG, EXP_TYPE_MQ_R1RHO, EXP_TYPE_R1RHO +from specific_analyses.relax_disp.variables import EXP_TYPE_CPMG, EXP_TYPE_DESC_CPMG, EXP_TYPE_DESC_DQ_CPMG, EXP_TYPE_DESC_R1RHO, EXP_TYPE_DESC_MQ_CPMG, EXP_TYPE_DESC_MQ_R1RHO, EXP_TYPE_DESC_ZQ_CPMG, EXP_TYPE_DQ_CPMG, EXP_TYPE_LIST, EXP_TYPE_LIST_CPMG, EXP_TYPE_LIST_R1RHO, EXP_TYPE_MQ_CPMG, EXP_TYPE_MQ_R1RHO, EXP_TYPE_R1RHO, EXP_TYPE_ZQ_CPMG from stat import S_IRWXU, S_IRGRP, S_IROTH from os import chmod, sep @@ -239,6 +239,10 @@ text += EXP_TYPE_DESC_CPMG + "." elif exp_type == EXP_TYPE_MQ_CPMG: text += EXP_TYPE_DESC_MQ_CPMG + "." + elif exp_type == EXP_TYPE_DQ_CPMG: + text += EXP_TYPE_DESC_DQ_CPMG + "." + elif exp_type == EXP_TYPE_ZQ_CPMG: + text += EXP_TYPE_DESC_ZQ_CPMG + "." elif exp_type == EXP_TYPE_MQ_R1RHO: text += EXP_TYPE_DESC_MQ_R1RHO + "." elif exp_type == EXP_TYPE_R1RHO: @@ -266,7 +270,7 @@ raise RelaxError("The experiment type has not been supplied.") # The dispersion data. - if exp_type in [EXP_TYPE_CPMG, EXP_TYPE_MQ_CPMG]: + if exp_type in EXP_TYPE_LIST_CPMG: disp_data = cdp.cpmg_frqs else: disp_data = cdp.spin_lock_nu1 @@ -346,7 +350,7 @@ # Loop over all experiment types. for exp_type in cdp.exp_type_list: - if exp_type in [EXP_TYPE_CPMG, EXP_TYPE_MQ_CPMG]: + if exp_type in EXP_TYPE_LIST_CPMG: return True # No CPMG experiment types. @@ -406,7 +410,7 @@ # Loop over all experiment types. for exp_type in cdp.exp_type_list: - if exp_type in [EXP_TYPE_R1RHO, EXP_TYPE_MQ_R1RHO]: + if exp_type in EXP_TYPE_LIST_R1RHO: return True # No CPMG experiment types. @@ -427,7 +431,7 @@ return False # CPMG experiment type. - if cdp.exp_type[id] in [EXP_TYPE_CPMG, EXP_TYPE_MQ_CPMG]: + if cdp.exp_type[id] in EXP_TYPE_LIST_CPMG: return True # Not a CPMG experiment type. @@ -448,7 +452,7 @@ return False # R1rho experiment type. - if cdp.exp_type[id] in [EXP_TYPE_R1RHO, EXP_TYPE_MQ_R1RHO]: + if cdp.exp_type[id] in EXP_TYPE_LIST_R1RHO: return True # Not a R1rho experiment type. @@ -657,9 +661,9 @@ # CPMG type data. if exp_type == None: raise RelaxError("The experiment type must be supplied.") - elif exp_type in [EXP_TYPE_CPMG, EXP_TYPE_MQ_CPMG]: + elif exp_type in EXP_TYPE_LIST_CPMG: fields = cdp.cpmg_frqs_list - elif exp_type in [EXP_TYPE_R1RHO, EXP_TYPE_MQ_R1RHO]: + elif exp_type in EXP_TYPE_LIST_R1RHO: fields = cdp.spin_lock_nu1_list else: raise RelaxError("The experiment type '%s' is unknown." % exp_type) @@ -721,7 +725,7 @@ exp_type = cdp.exp_type[id] # The CPMG dispersion data. - if exp_type in [EXP_TYPE_CPMG, EXP_TYPE_MQ_CPMG]: + if exp_type in EXP_TYPE_LIST_CPMG: # No dispersion point data set. if not hasattr(cdp, 'cpmg_frqs') or id not in cdp.cpmg_frqs: continue @@ -826,7 +830,7 @@ data.append([]) # Add a new label. - if exp_type in [EXP_TYPE_CPMG, EXP_TYPE_MQ_CPMG]: + if exp_type in EXP_TYPE_LIST_CPMG: label = "R\\s2eff\\N" else: label = "R\\s1\\xr\\B\\N" @@ -857,7 +861,7 @@ data.append([]) # Add a new label. - if exp_type in [EXP_TYPE_CPMG, EXP_TYPE_MQ_CPMG]: + if exp_type in EXP_TYPE_LIST_CPMG: label = "Back-calculated R\\s2eff\\N" else: label = "Back-calculated R\\s1\\xr\\B\\N" @@ -910,7 +914,7 @@ data[-1][-1].append(spin.r2eff_err[key]) # The axis labels. - if exp_type in [EXP_TYPE_CPMG, EXP_TYPE_MQ_CPMG]: + if exp_type in EXP_TYPE_LIST_CPMG: axis_labels = ['\\qCPMG pulse train frequency (Hz)\\Q', '\\qR\\s2,eff\\N\\Q (rad.s\\S-1\\N)'] else: axis_labels = ['\\qSpin-lock field strength (Hz)\\Q', '\\qR\\s1\\xr\\B\\N\\Q (rad.s\\S-1\\N)'] @@ -1143,11 +1147,11 @@ index = 0 # CPMG-type experiments. - if exp_type in [EXP_TYPE_CPMG, EXP_TYPE_MQ_CPMG]: + if exp_type in EXP_TYPE_LIST_CPMG: index = cdp.cpmg_frqs_list.index(value) # R1rho-type experiments. - elif exp_type in [EXP_TYPE_R1RHO, EXP_TYPE_MQ_R1RHO]: + elif exp_type in EXP_TYPE_LIST_R1RHO: index = cdp.spin_lock_nu1_list.index(value) # Remove the reference point (always at index 0). @@ -1210,11 +1214,11 @@ raise RelaxError("The experiment type has not been supplied.") # CPMG-type experiments. - if exp_type in [EXP_TYPE_CPMG, EXP_TYPE_MQ_CPMG]: + if exp_type in EXP_TYPE_LIST_CPMG: return return_index_from_disp_point(cdp.cpmg_frqs[key], exp_type=exp_type) # R1rho-type experiments. - elif exp_type in [EXP_TYPE_R1RHO, EXP_TYPE_MQ_R1RHO]: + elif exp_type in EXP_TYPE_LIST_R1RHO: return return_index_from_disp_point(cdp.spin_lock_nu1[key], exp_type=exp_type) @@ -1273,7 +1277,7 @@ frq = return_value_from_frq_index(frq_index) # CPMG data. - if exp_type in [EXP_TYPE_CPMG, EXP_TYPE_MQ_CPMG]: + if exp_type in EXP_TYPE_LIST_CPMG: point = cdp.cpmg_frqs_list[disp_point_index] points = cdp.cpmg_frqs