Author: bugman Date: Wed Sep 4 18:49:06 2013 New Revision: 20816 URL: http://svn.gna.org/viewcvs/relax?rev=20816&view=rev Log: Fixes for the changes to the dispersion experiment type variables throughout the dispersion code. Modified: branches/relax_disp/auto_analyses/relax_disp.py branches/relax_disp/gui/analyses/auto_relax_disp.py branches/relax_disp/specific_analyses/relax_disp/api.py branches/relax_disp/specific_analyses/relax_disp/disp_data.py branches/relax_disp/specific_analyses/relax_disp/parameters.py Modified: branches/relax_disp/auto_analyses/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/auto_analyses/relax_disp.py?rev=20816&r1=20815&r2=20816&view=diff ============================================================================== --- branches/relax_disp/auto_analyses/relax_disp.py (original) +++ branches/relax_disp/auto_analyses/relax_disp.py Wed Sep 4 18:49:06 2013 @@ -36,7 +36,7 @@ from pipe_control.pipes import has_pipe from prompt.interpreter import Interpreter from specific_analyses.relax_disp.disp_data import loop_frq -from specific_analyses.relax_disp.variables import CPMG_EXP, FIXED_TIME_EXP, MODEL_CR72, MODEL_CR72_FULL, MODEL_DPL94, MODEL_IT99, MODEL_LIST_CPMG, MODEL_LIST_R1RHO, MODEL_LM63, MODEL_LM63_3SITE, MODEL_M61, MODEL_M61B, 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_TP02, R1RHO_EXP +from specific_analyses.relax_disp.variables import EXP_TYPE_LIST_CPMG, EXP_TYPE_LIST_FIXED_TIME, EXP_TYPE_LIST_R1RHO, MODEL_CR72, MODEL_CR72_FULL, MODEL_DPL94, MODEL_IT99, MODEL_LIST_CPMG, MODEL_LIST_R1RHO, MODEL_LM63, MODEL_LM63_3SITE, MODEL_M61, MODEL_M61B, 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_TP02 from status import Status; status = Status() @@ -312,7 +312,7 @@ self.interpreter.value.copy(pipe_from=MODEL_R2EFF, pipe_to=model, param='r2eff') # Calculate the R2eff values for the fixed relaxation time period data types. - if model == MODEL_R2EFF and cdp.exp_type in FIXED_TIME_EXP: + if model == MODEL_R2EFF and cdp.exp_type in EXP_TYPE_LIST_FIXED_TIME: self.interpreter.calc() # Optimise the model. @@ -354,7 +354,7 @@ """ # Exponential curves. - if model == 'R2eff' and cdp.exp_type not in FIXED_TIME_EXP: + if model == 'R2eff' and cdp.exp_type not in EXP_TYPE_LIST_FIXED_TIME: self.interpreter.relax_disp.plot_exp_curves(file='intensities.agr', dir=path, force=True) # Average peak intensities. self.interpreter.relax_disp.plot_exp_curves(file='intensities_norm.agr', dir=path, force=True, norm=True) # Average peak intensities (normalised). @@ -367,24 +367,24 @@ self.interpreter.grace.write(x_data_type='res_num', y_data_type='r2eff', file='r2eff.agr', dir=path, force=True) # The I0 parameter. - if model == 'R2eff' and cdp.exp_type not in FIXED_TIME_EXP: + if model == 'R2eff' and cdp.exp_type not in EXP_TYPE_LIST_FIXED_TIME: self.interpreter.value.write(param='i0', file='i0.out', dir=path, force=True) self.interpreter.grace.write(x_data_type='res_num', y_data_type='i0', file='i0.agr', dir=path, force=True) ## The R20 parameter. - #if cdp.exp_type in CPMG_EXP and model in [None, MODEL_LM63, MODEL_CR72, MODEL_IT99, MODEL_M61, MODEL_DPL94, MODEL_M61B, MODEL_NS_CPMG_2SITE_3D, MODEL_NS_CPMG_2SITE_STAR, MODEL_NS_CPMG_2SITE_EXPANDED]: + #if cdp.exp_type in EXP_TYPE_LIST_CPMG and model in [None, MODEL_LM63, MODEL_CR72, MODEL_IT99, MODEL_M61, MODEL_DPL94, MODEL_M61B, MODEL_NS_CPMG_2SITE_3D, MODEL_NS_CPMG_2SITE_STAR, MODEL_NS_CPMG_2SITE_EXPANDED]: # self.interpreter.value.write(param='r2', file='r20.out', dir=path, force=True) # self.interpreter.grace.write(x_data_type='res_num', y_data_type='r2', file='r20.agr', dir=path, force=True) ## The R20A and R20B parameters. - #if cdp.exp_type in CPMG_EXP and model in [None, MODEL_CR72_FULL, MODEL_NS_CPMG_2SITE_3D_FULL, MODEL_NS_CPMG_2SITE_STAR_FULL]: + #if cdp.exp_type in EXP_TYPE_LIST_CPMG and model in [None, MODEL_CR72_FULL, MODEL_NS_CPMG_2SITE_3D_FULL, MODEL_NS_CPMG_2SITE_STAR_FULL]: # self.interpreter.value.write(param='r2a', file='r20a.out', dir=path, force=True) # self.interpreter.value.write(param='r2b', file='r20b.out', dir=path, force=True) # self.interpreter.grace.write(x_data_type='res_num', y_data_type='r2a', file='r20a.agr', dir=path, force=True) # self.interpreter.grace.write(x_data_type='res_num', y_data_type='r2b', file='r20b.agr', dir=path, force=True) ## The R1rho parameter. - #if cdp.exp_type in R1RHO_EXP and model in [None] + MODEL_LIST_R1RHO: + #if cdp.exp_type in EXP_TYPE_LIST_R1RHO and model in [None] + MODEL_LIST_R1RHO: # self.interpreter.value.write(param='r2', file='r1rho0.out', dir=path, force=True) # self.interpreter.grace.write(x_data_type='res_num', y_data_type='r2', file='r1rho0.agr', dir=path, force=True) @@ -432,7 +432,7 @@ self.interpreter.grace.write(x_data_type='res_num', y_data_type='kC', file='kC.agr', dir=path, force=True) # Minimisation statistics. - if not (model == 'R2eff' and cdp.exp_type in FIXED_TIME_EXP): + if not (model == 'R2eff' and cdp.exp_type in EXP_TYPE_LIST_FIXED_TIME): self.interpreter.grace.write(y_data_type='chi2', file='chi2.agr', dir=path, force=True) # Finally save the results. This is last to allow the continuation of an interrupted analysis while ensuring that all results files have been created. Modified: branches/relax_disp/gui/analyses/auto_relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/gui/analyses/auto_relax_disp.py?rev=20816&r1=20815&r2=20816&view=diff ============================================================================== --- branches/relax_disp/gui/analyses/auto_relax_disp.py (original) +++ branches/relax_disp/gui/analyses/auto_relax_disp.py Wed Sep 4 18:49:06 2013 @@ -47,7 +47,7 @@ from gui.wizards.peak_intensity import Peak_intensity_wizard from pipe_control.mol_res_spin import exists_mol_res_spin_data, spin_loop from pipe_control.pipes import has_bundle, has_pipe -from specific_analyses.relax_disp.variables import CPMG_EXP, MODEL_CR72, MODEL_CR72_FULL, MODEL_DPL94, MODEL_IT99, MODEL_LIST_CPMG_FULL, MODEL_LIST_R1RHO_FULL, MODEL_LM63, MODEL_LM63_3SITE, MODEL_M61, MODEL_M61B, 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_TP02, VAR_TIME_EXP +from specific_analyses.relax_disp.variables import EXP_TYPE_LIST_CPMG, EXP_TYPE_LIST_VAR_TIME, MODEL_CR72, MODEL_CR72_FULL, MODEL_DPL94, MODEL_IT99, MODEL_LIST_CPMG_FULL, MODEL_LIST_R1RHO_FULL, MODEL_LM63, MODEL_LM63_3SITE, MODEL_M61, MODEL_M61B, 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_TP02 from status import Status; status = Status() @@ -124,7 +124,7 @@ ds.relax_gui.analyses[data_index].save_dir = self.gui.launch_dir # Set the default dispersion models based on the experiment type. - if cdp.exp_type in CPMG_EXP: + if cdp.exp_type in EXP_TYPE_LIST_CPMG: ds.relax_gui.analyses[data_index].disp_models = [ MODEL_R2EFF, MODEL_NOREX, @@ -156,10 +156,10 @@ # Set up some flags based on the experiment type. self.relax_times_flag = False - if cdp.exp_type in VAR_TIME_EXP: + if cdp.exp_type in EXP_TYPE_LIST_VAR_TIME: self.relax_times_flag = True self.relax_disp_cpmg = False - if cdp.exp_type in CPMG_EXP: + if cdp.exp_type in EXP_TYPE_LIST_CPMG: self.relax_disp_cpmg = True # Execute the base class method to build the panel. @@ -340,7 +340,7 @@ box.AddSpacer(10) # Add the dispersion models GUI element, with spacing. - if cdp.exp_type in CPMG_EXP: + if cdp.exp_type in EXP_TYPE_LIST_CPMG: self.model_field = Disp_model_list_cpmg(self, box) else: self.model_field = Disp_model_list_r1rho(self, box) 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=20816&r1=20815&r2=20816&view=diff ============================================================================== --- branches/relax_disp/specific_analyses/relax_disp/api.py (original) +++ branches/relax_disp/specific_analyses/relax_disp/api.py Wed Sep 4 18:49:06 2013 @@ -48,7 +48,7 @@ from specific_analyses.api_common import API_common from specific_analyses.relax_disp.disp_data import average_intensity, find_intensity_keys, loop_cluster, loop_frq, loop_frq_point, loop_frq_point_key, loop_frq_point_time, loop_point, loop_time, relax_time, return_cpmg_frqs, return_index_from_disp_point, return_index_from_frq, return_key_from_disp_point_index, return_offset_data, return_param_key_from_data, return_r1_data, return_r2eff_arrays, return_spin_lock_nu1, return_value_from_frq_index, spin_ids_to_containers from specific_analyses.relax_disp.parameters import assemble_param_vector, assemble_scaling_matrix, disassemble_param_vector, linear_constraints, loop_parameters, param_conversion, param_index_to_param_info, param_num -from specific_analyses.relax_disp.variables import CPMG_EXP, FIXED_TIME_EXP, MODEL_LIST_FULL, MODEL_LM63, MODEL_LM63_3SITE, MODEL_CR72, MODEL_CR72_FULL, MODEL_DPL94, MODEL_IT99, MODEL_M61, MODEL_M61B, 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_TP02, MODEL_TSMFK01, R1RHO_EXP, VAR_TIME_EXP +from specific_analyses.relax_disp.variables import EXP_TYPE_LIST_FIXED_TIME, EXP_TYPE_LIST_VAR_TIME, MODEL_LIST_FULL, MODEL_LM63, MODEL_LM63_3SITE, MODEL_CR72, MODEL_CR72_FULL, MODEL_DPL94, MODEL_IT99, MODEL_M61, MODEL_M61B, 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_TP02, MODEL_TSMFK01 from target_functions.relax_disp import Dispersion from user_functions.data import Uf_tables; uf_tables = Uf_tables() from user_functions.objects import Desc_container @@ -176,7 +176,7 @@ """ # Check. - if cdp.exp_type in FIXED_TIME_EXP: + if cdp.exp_type in EXP_TYPE_LIST_FIXED_TIME: raise RelaxError("Back-calculation is not allowed for the fixed time experiment types.") # The key. @@ -303,7 +303,7 @@ raise RelaxError("The relaxation dispersion experiment '%s' is invalid." % exp_type) # Sanity check. - if exp_type not in FIXED_TIME_EXP and exp_type not in VAR_TIME_EXP: + if exp_type not in EXP_TYPE_LIST_FIXED_TIME and exp_type not in EXP_TYPE_LIST_VAR_TIME: raise RelaxError("The experiment type '%s' is neither a fixed relaxation time period or variable relaxation time period experiment." % exp_type) # Store the value. @@ -644,7 +644,7 @@ raise RelaxError("The relaxation dispersion experiment type has not been set.") # Test for the C-modules. - if model == MODEL_R2EFF and cdp.exp_type in VAR_TIME_EXP and not C_module_exp_fn: + if model == MODEL_R2EFF and cdp.exp_type in EXP_TYPE_LIST_VAR_TIME and not C_module_exp_fn: raise RelaxError("The exponential curve-fitting C module cannot be found.") # R2eff/R1rho model. @@ -877,7 +877,7 @@ raise RelaxError("The spin-lock field strengths have not been set up.") # Only allow the fixed relaxation time period data types. - if cdp.exp_type not in FIXED_TIME_EXP: + if cdp.exp_type not in EXP_TYPE_LIST_FIXED_TIME: raise RelaxError("The experiment '%s' is not of the fixed relaxation time period data type, the R2eff/R1rho values cannot be directly calculated." % cdp.exp_type) # Printouts. @@ -1135,7 +1135,7 @@ # Special exponential curve-fitting for the 'R2eff' model. if cdp.model_type == 'R2eff': # Sanity checks. - if cdp.exp_type in FIXED_TIME_EXP: + if cdp.exp_type in EXP_TYPE_LIST_FIXED_TIME: raise RelaxError("The R2eff model with the fixed time period CPMG experiment cannot be optimised.") # Optimisation. 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=20816&r1=20815&r2=20816&view=diff ============================================================================== --- branches/relax_disp/specific_analyses/relax_disp/disp_data.py (original) +++ branches/relax_disp/specific_analyses/relax_disp/disp_data.py Wed Sep 4 18:49:06 2013 @@ -46,7 +46,7 @@ from pipe_control import pipes from pipe_control.mol_res_spin import exists_mol_res_spin_data, return_spin, spin_loop from pipe_control.result_files import add_result_file -from specific_analyses.relax_disp.variables import CPMG_EXP, FIXED_TIME_EXP, R1RHO_EXP +from specific_analyses.relax_disp.variables import EXP_TYPE_LIST_CPMG, EXP_TYPE_LIST_FIXED_TIME, EXP_TYPE_LIST_R1RHO from stat import S_IRWXU, S_IRGRP, S_IROTH from os import chmod, path, sep @@ -195,7 +195,7 @@ """ # The dispersion data. - if cdp.exp_type in CPMG_EXP: + if cdp.exp_type in EXP_TYPE_LIST_CPMG: disp_data = cdp.cpmg_frqs else: disp_data = cdp.spin_lock_nu1 @@ -349,9 +349,9 @@ """ # CPMG type data. - if cdp.exp_type in CPMG_EXP: + if cdp.exp_type in EXP_TYPE_LIST_CPMG: fields = cdp.cpmg_frqs_list - elif cdp.exp_type in R1RHO_EXP: + elif cdp.exp_type in EXP_TYPE_LIST_R1RHO: fields = cdp.spin_lock_nu1_list else: raise RelaxError("The experiment type '%s' is unknown." % cdp.exp_type) @@ -421,7 +421,7 @@ data.append([]) # Add a new label. - if cdp.exp_type in CPMG_EXP: + if cdp.exp_type in EXP_TYPE_LIST_CPMG: label = "R\\s2eff\\N" else: label = "R\\s1\\xr\\B\\N" @@ -452,7 +452,7 @@ data.append([]) # Add a new label. - if cdp.exp_type in CPMG_EXP: + if cdp.exp_type in EXP_TYPE_LIST_CPMG: label = "Back-calculated R\\s2eff\\N" else: label = "Back-calculated R\\s1\\xr\\B\\N" @@ -505,7 +505,7 @@ data[-1][-1].append(spin.r2eff_err[key]) # The axis labels. - if cdp.exp_type in CPMG_EXP: + if cdp.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)'] @@ -728,15 +728,15 @@ index = 0 # CPMG-type experiments. - if cdp.exp_type in CPMG_EXP: + if cdp.exp_type in EXP_TYPE_LIST_CPMG: index = cdp.cpmg_frqs_list.index(value) # R1rho-type experiments. - elif cdp.exp_type in R1RHO_EXP: + elif cdp.exp_type in EXP_TYPE_LIST_R1RHO: index = cdp.spin_lock_nu1_list.index(value) # Remove the reference point (always at index 0). - if cdp.exp_type in FIXED_TIME_EXP: + if cdp.exp_type in EXP_TYPE_LIST_FIXED_TIME: index -= 1 # Return the index. @@ -770,11 +770,11 @@ """ # CPMG-type experiments. - if cdp.exp_type in CPMG_EXP: + if cdp.exp_type in EXP_TYPE_LIST_CPMG: return return_index_from_disp_point(cdp.cpmg_frqs[key]) # R1rho-type experiments. - elif cdp.exp_type in R1RHO_EXP: + elif cdp.exp_type in EXP_TYPE_LIST_R1RHO: return return_index_from_disp_point(cdp.spin_lock_nu1[key]) @@ -797,7 +797,7 @@ """ # Checks. - if ref and cdp.exp_type not in FIXED_TIME_EXP: + if ref and cdp.exp_type not in EXP_TYPE_LIST_FIXED_TIME: raise RelaxError("The reference peak intensity does not exist for the variable relaxation time period experiment types.") # The key. @@ -822,14 +822,14 @@ """ # Insert the reference point (always at index 0). - if cdp.exp_type in FIXED_TIME_EXP: + if cdp.exp_type in EXP_TYPE_LIST_FIXED_TIME: disp_point_index += 1 # The frequency. frq = return_value_from_frq_index(frq_index) # CPMG data. - if cdp.exp_type in CPMG_EXP: + if cdp.exp_type in EXP_TYPE_LIST_CPMG: point = cdp.cpmg_frqs_list[disp_point_index] points = cdp.cpmg_frqs Modified: branches/relax_disp/specific_analyses/relax_disp/parameters.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/specific_analyses/relax_disp/parameters.py?rev=20816&r1=20815&r2=20816&view=diff ============================================================================== --- branches/relax_disp/specific_analyses/relax_disp/parameters.py (original) +++ branches/relax_disp/specific_analyses/relax_disp/parameters.py Wed Sep 4 18:49:06 2013 @@ -36,7 +36,7 @@ from pipe_control import pipes from pipe_control.mol_res_spin import exists_mol_res_spin_data, return_spin from specific_analyses.relax_disp.disp_data import count_frq, loop_cluster, loop_frq, loop_frq_point -from specific_analyses.relax_disp.variables import MODEL_R2EFF, MODEL_M61B, VAR_TIME_EXP +from specific_analyses.relax_disp.variables import EXP_TYPE_LIST_VAR_TIME, MODEL_R2EFF, MODEL_M61B def assemble_param_vector(spins=None, key=None, sim_index=None): @@ -743,7 +743,7 @@ # The R2eff model. if cdp.model_type == 'R2eff': # Exponential curves (with clustering). - if cdp.exp_type in VAR_TIME_EXP: + if cdp.exp_type in EXP_TYPE_LIST_VAR_TIME: return 2 * len(spins) # Fixed time period experiments (with clustering).