def run_analysis(self): """Execute the calculation.""" # Start the protocol. dauvergne_protocol.dAuvergne_protocol( pipe_name=self.data.pipe_name, pipe_bundle=self.data.pipe_bundle, results_dir=self.data.save_dir, diff_model=self.data.global_models, mf_models=self.data.mf_models, local_tm_models=self.data.local_tm_models, grid_inc=self.data.inc, diff_tensor_grid_inc=self.data.diff_tensor_grid_inc, mc_sim_num=self.data.mc_sim_num, max_iter=self.data.max_iter, conv_loop=self.data.conv_loop)
# Execution. ############ # The results dir. if not hasattr(ds, "tmpdir"): results_dir = status.install_path + sep + "dauvergne_protocol" else: results_dir = ds.tmpdir # Change some opt params. dAuvergne_protocol.opt_func_tol = 1e-5 dAuvergne_protocol.opt_max_iterations = 1000 # Loop over all global models. for global_model in ["local_tm", "sphere", "prolate", "oblate", "ellipsoid", "final"]: dAuvergne_protocol( pipe_name=name, pipe_bundle=bundle_name, results_dir=results_dir, diff_model=global_model, mf_models=MF_MODELS, local_tm_models=LOCAL_TM_MODELS, grid_inc=GRID_INC, diff_tensor_grid_inc={"sphere": 5, "prolate": 5, "oblate": 5, "ellipsoid": 3}, min_algor=MIN_ALGOR, mc_sim_num=MC_NUM, max_iter=1, conv_loop=CONV_LOOP, )
# Automatic looping over all rounds until convergence (must be a boolean value of True or False). Standard is: conv_loop=True : and cannot be changed in the GUI. CONV_LOOP = True # Change some minimise opt params. # This goes into: minimise.execute(self.min_algor, func_tol=self.opt_func_tol, max_iter=self.opt_max_iterations) ##################### #dAuvergne_protocol.opt_func_tol = 1e-5 # Standard: opt_func_tol = 1e-25 #dAuvergne_protocol.opt_max_iterations = 1000 # Standard: opt_max_iterations = int(1e7) dAuvergne_protocol.opt_func_tol = 1e-10 # Standard: opt_func_tol = 1e-25 dAuvergne_protocol.opt_max_iterations = int(1e5) # Standard: opt_max_iterations = int(1e7) ##################################### # The results dir. var = 'result_04' results_dir = os.getcwd() + os.sep + var # Save the state before running. Open and check in GUI! state.save(state=var+'_ini.bz2', dir=results_dir, force=True) # To check in GUI # relax -g # File -> Open relax state # In folder "result_03" open "result_03_ini.bz2" # View -> Data pipe editor # Right click on pipe, and select "Associate with a new auto-analysis" dAuvergne_protocol(pipe_name=name, pipe_bundle=bundle_name, results_dir=results_dir, diff_model=DIFF_MODEL, mf_models=MF_MODELS, local_tm_models=LOCAL_TM_MODELS, grid_inc=GRID_INC, min_algor=MIN_ALGOR, mc_sim_num=MC_NUM, max_iter=MAX_ITER, conv_loop=CONV_LOOP)
pipe.display() pipe_name = pipes.cdp_name() pipe_bundle = pipes.get_bundle(pipe_name) # Analysis variables. ##################### # The diffusion model. Standard is 'Fully automated', which means: DIFF_MODEL=['local_tm', 'sphere', 'prolate', 'oblate', 'ellipsoid', 'final'] # 'local_tm', 'sphere', ''prolate', 'oblate', 'ellipsoid', or 'final' #DIFF_MODEL = ['local_tm', 'sphere', 'prolate', 'oblate', 'ellipsoid', 'final'] DIFF_MODEL = ['ellipsoid'] # The grid search size (the number of increments per dimension). GRID_INC = 11 # The number of Monte Carlo simulations to be used for error analysis at the end of the analysis. # This has no influence in Model 1-5 MC_NUM = 0 # The maximum number of iterations for the global iteration. # Set to None, then the algorithm iterates until convergence. MAX_ITER = 20 # Run protocol dAuvergne_protocol(pipe_name=pipe_name, pipe_bundle=pipe_bundle, results_dir=results_dir, write_results_dir=results_dir, diff_model=DIFF_MODEL, grid_inc=GRID_INC, mc_sim_num=MC_NUM, max_iter=MAX_ITER)
LOCAL_TM_MODELS = ['tm0', 'tm4', 'tm9'] # The grid search size (the number of increments per dimension). GRID_INC = 3 # The optimisation technique. MIN_ALGOR = 'newton' # The number of Monte Carlo simulations to be used for error analysis at the end of the analysis. MC_NUM = 500 # Automatic looping over all rounds until convergence (must be a boolean value of True or False). CONV_LOOP = True # The data path. data_path = status.install_path + sep + 'test_suite' + sep + 'shared_data' + sep + 'saved_states' # Load the state. state.load('bug_20464_mf_missing_ri_data', dir=data_path) # The results dir. ds.tmpdir = mkdtemp() # Change some opt params. dAuvergne_protocol.opt_func_tol = 1e-2 dAuvergne_protocol.opt_max_iterations = 20 # Do not change! dAuvergne_protocol(pipe_name='origin - mf (Thu Jan 31 10:06:25 2013)', pipe_bundle='mf (Thu Jan 31 10:06:25 2013)', results_dir=ds.tmpdir, diff_model=DIFF_MODEL, mf_models=MF_MODELS, local_tm_models=LOCAL_TM_MODELS, grid_inc=GRID_INC, min_algor=MIN_ALGOR, mc_sim_num=MC_NUM, conv_loop=CONV_LOOP)
# The grid search size (the number of increments per dimension). GRID_INC = 5 # The optimisation technique. MIN_ALGOR = 'newton' # The number of Monte Carlo simulations to be used for error analysis at the end of the analysis. MC_NUM = 500 # Automatic looping over all rounds until convergence (must be a boolean value of True or False). CONV_LOOP = False # Execution (do not change!). dAuvergne_protocol(diff_model=DIFF_MODEL, mf_models=MF_MODELS, local_tm_models=LOCAL_TM_MODELS, pdb_file=PDB_FILE, seq_args=SEQ_ARGS, het_name=HET_NAME, relax_data=RELAX_DATA, unres=UNRES, exclude=EXCLUDE, bond_length=BOND_LENGTH, csa=CSA, hetnuc=HETNUC, proton=PROTON, grid_inc=GRID_INC, min_algor=MIN_ALGOR, mc_num=MC_NUM, conv_loop=CONV_LOOP)
#sequence.attach_protons() # Load the relaxation data. relax_data.read(ri_id='R1_600', ri_type='R1', frq=599.719*1e6, file='r1.600.out', mol_name_col=1, res_num_col=2, res_name_col=3, spin_num_col=4, spin_name_col=5, data_col=6, error_col=7) relax_data.read(ri_id='R2_600', ri_type='R2', frq=599.719*1e6, file='r2.600.out', mol_name_col=1, res_num_col=2, res_name_col=3, spin_num_col=4, spin_name_col=5, data_col=6, error_col=7) relax_data.read(ri_id='NOE_600', ri_type='NOE', frq=599.719*1e6, file='noe.600.out', mol_name_col=1, res_num_col=2, res_name_col=3, spin_num_col=4, spin_name_col=5, data_col=6, error_col=7) relax_data.read(ri_id='R1_500', ri_type='R1', frq=500.208*1e6, file='r1.500.out', mol_name_col=1, res_num_col=2, res_name_col=3, spin_num_col=4, spin_name_col=5, data_col=6, error_col=7) relax_data.read(ri_id='R2_500', ri_type='R2', frq=500.208*1e6, file='r2.500.out', mol_name_col=1, res_num_col=2, res_name_col=3, spin_num_col=4, spin_name_col=5, data_col=6, error_col=7) relax_data.read(ri_id='NOE_500', ri_type='NOE', frq=500.208*1e6, file='noe.500.out', mol_name_col=1, res_num_col=2, res_name_col=3, spin_num_col=4, spin_name_col=5, data_col=6, error_col=7) # Deselect spins to be excluded (including unresolved and specifically excluded spins). deselect.read(file='unresolved', dir=None, spin_id_col=None, mol_name_col=1, res_num_col=2, res_name_col=3, spin_num_col=4, spin_name_col=5, sep=None, spin_id=None, boolean='AND', change_all=False) deselect.read(file='exclude', spin_id_col=1) # Define the magnetic dipole-dipole relaxation interaction. interatom.define(spin_id1='@N', spin_id2='@H', direct_bond=True) interatom.define(spin_id1='@NE1', spin_id2='@HE1', direct_bond=True) interatom.set_dist(spin_id1='@N*', spin_id2='@H*', ave_dist=1.02 * 1e-10) interatom.unit_vectors() # Define the chemical shift relaxation interaction. value.set(-172 * 1e-6, 'csa', spin_id='@N*') # Execution. ############ # Do not change! dAuvergne_protocol(pipe_name=name, pipe_bundle=pipe_bundle, diff_model=DIFF_MODEL, mf_models=MF_MODELS, local_tm_models=LOCAL_TM_MODELS, grid_inc=GRID_INC, min_algor=MIN_ALGOR, mc_sim_num=MC_NUM, conv_loop=CONV_LOOP)
if not hasattr(ds, 'tmpdir'): results_dir = status.install_path + sep + 'dauvergne_protocol' else: results_dir = ds.tmpdir # Change some opt params. dAuvergne_protocol.opt_func_tol = 1e-5 dAuvergne_protocol.opt_max_iterations = 1000 # Loop over all global models. for global_model in [ 'local_tm', 'sphere', 'prolate', 'oblate', 'ellipsoid', 'final' ]: dAuvergne_protocol(pipe_name=name, pipe_bundle=bundle_name, results_dir=results_dir, diff_model=global_model, mf_models=MF_MODELS, local_tm_models=LOCAL_TM_MODELS, grid_inc=GRID_INC, diff_tensor_grid_inc={ 'sphere': 5, 'prolate': 5, 'oblate': 5, 'ellipsoid': 3 }, min_algor=MIN_ALGOR, mc_sim_num=MC_NUM, max_iter=1, conv_loop=CONV_LOOP)
def run_analysis(self): """Execute the calculation.""" # Start the protocol. dauvergne_protocol.dAuvergne_protocol(pipe_name=self.data.pipe_name, pipe_bundle=self.data.pipe_bundle, results_dir=self.data.save_dir, diff_model=self.data.global_models, mf_models=self.data.mf_models, local_tm_models=self.data.local_tm_models, grid_inc=self.data.inc, diff_tensor_grid_inc=self.data.diff_tensor_grid_inc, mc_sim_num=self.data.mc_sim_num, max_iter=self.data.max_iter, conv_loop=self.data.conv_loop)
MIN_ALGOR = 'newton' # The number of Monte Carlo simulations to be used for error analysis at the end of the analysis. MC_NUM = 3 # Automatic looping over all rounds until convergence (must be a boolean value of True or False). CONV_LOOP = True # Load the state. data_path = status.install_path + sep + 'test_suite' + sep + 'shared_data' + sep + 'model_free' + sep + 'bug_20613_auto_mf_diff_tensor_pdb' state.load('state', dir=data_path) # The results dir. ds.tmpdir = mkdtemp() # The pipe and bundle names from the state file. pipe_bundle = 'mf (Fri Mar 8 07:43:00 2013)' name = 'origin - mf (Fri Mar 8 07:43:00 2013)' # Execution. ############ dAuvergne_protocol.opt_func_tol = 1e-5 dAuvergne_protocol.opt_max_iterations = 2000 # Do not change! dAuvergne_protocol(pipe_name=name, pipe_bundle=pipe_bundle, results_dir=data_path, write_results_dir=ds.tmpdir, diff_model=DIFF_MODEL, mf_models=MF_MODELS, local_tm_models=LOCAL_TM_MODELS, grid_inc=GRID_INC, min_algor=MIN_ALGOR, mc_sim_num=MC_NUM, max_iter=2, conv_loop=CONV_LOOP)
state.load(state=var + '_ini.bz2', dir=results_dir, force=True) # Read the pipe info pipe.display() pipe_name = pipes.cdp_name() pipe_bundle = pipes.get_bundle(pipe_name) # The diffusion model. DIFF_MODEL = ['final'] # Run protocol ans = raw_input("Should I run the dAuvergne_protocol?[n]:") or "n" if ans == 'y': dAuvergne_protocol(pipe_name=pipe_name, pipe_bundle=pipe_bundle, results_dir=results_dir, write_results_dir=write_results_dir, diff_model=DIFF_MODEL, mc_sim_num=MC_NUM) ########################################################################################### #Create the Modelfree4 input files. #Defaults # dir: The directory to place the files. # force: A flag which if set to True will cause the results file to be overwritten if it already exists. # binary: The name of the executable Modelfree program file. # diff_search: See the Modelfree4 manual for 'diffusion_search'. # sims: The number of Monte Carlo simulations. # sim_type: See the Modelfree4 manual. # trim: See the Modelfree4 manual. # steps: See the Modelfree4 manual.