Changes

Jump to navigation Jump to search

Tutorial for model-free analysis sam mahdi

4,646 bytes added, 19:16, 13 September 2016
# Define the chemical shift relaxation interaction.
value.set(-172 * 1e-6, 'csa', spin_id='@N*')
</source>
 
==== Let us try to execute ====
 
Now add the following lines in "sam_script.py"
<source lang="python">
# Execution.
############
 
# Change some opt params.
# COMMENT THESE OUT FOR REAL CALCULATION. THIS IS ONLY TO SPEED UP THE PROCESS IN ERROR SEARCHING.
dAuvergne_protocol.opt_func_tol = 1e-5
dAuvergne_protocol.opt_max_iterations = 1000
 
# 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)
</source>
 
Now we are just going to try this AND using a log file
<source lang="bash">
relax sam_script.py -t log.txt
</source>
 
==== The whole script file looked like this ====
 
<source lang="python">
# Python module imports.
from time import asctime, localtime
# relax module imports.
from auto_analyses.dauvergne_protocol import dAuvergne_protocol
 
 
# Analysis variables.
#####################
# The diffusion model.
DIFF_MODEL = 'local_tm'
 
# The model-free models. Do not change these unless absolutely necessary, the protocol is likely to fail if these are changed.
MF_MODELS = ['m0', 'm1', 'm2', 'm3', 'm4', 'm5', 'm6', 'm7', 'm8', 'm9']
LOCAL_TM_MODELS = ['tm0', 'tm1', 'tm2', 'tm3', 'tm4', 'tm5', 'tm6', 'tm7', 'tm8', 'tm9']
 
# The grid search size (the number of increments per dimension).
GRID_INC = 11
 
# 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 = 10
 
# Automatic looping over all rounds until convergence (must be a boolean value of True or False).
CONV_LOOP = True
 
# Set up the data pipe.
#######################
 
# The following sequence of user function calls can be changed as needed.
 
# Create the data pipe.
pipe_bundle = "mf (%s)" % asctime(localtime())
name = "origin - " + pipe_bundle
pipe.create(name, 'mf', bundle=pipe_bundle)
 
# Load the PDB file.
structure.read_pdb('2d9j.pdb', set_mol_name='hRGS7', read_model=1)
 
# Set up the 15N and 1H spins (both backbone and Trp indole sidechains).
structure.load_spins('@N', ave_pos=True)
structure.load_spins('@NE1', ave_pos=True)
structure.load_spins('@H', ave_pos=True)
structure.load_spins('@HE1', ave_pos=True)
spin.isotope('15N', spin_id='@N*')
spin.isotope('1H', spin_id='@H*')
 
state.save('ini_setup', force=True)
 
# Import
from pipe_control.mol_res_spin import spin_loop
 
# Loop and print
for spin, mol_name, res_num, res_name, spin_id in spin_loop(full_info=True, return_id=True, skip_desel=True):
print spin, mol_name, res_num, res_name, spin_id
 
# From before
relax_data.read(ri_id='R1_600', ri_type='R1', frq=599.719*1e6, file='R1_600', res_num_col=1, spin_name_col=2, data_col=3, error_col=4)
# Add this
relax_data.read(ri_id='R2_600', ri_type='R2', frq=599.719*1e6, file='R2_600', res_num_col=1, spin_name_col=2, data_col=3, error_col=4)
relax_data.read(ri_id='ssNOE_600', ri_type='NOE', frq=599.719*1e6, file='ssNOE_600', res_num_col=1, spin_name_col=2, data_col=3, error_col=4)
 
relax_data.read(ri_id='R1_800', ri_type='R1', frq=799.719*1e6, file='R1_800', res_num_col=1, spin_name_col=2, data_col=3, error_col=4)
relax_data.read(ri_id='R2_800', ri_type='R2', frq=799.719*1e6, file='R2_800', res_num_col=1, spin_name_col=2, data_col=3, error_col=4)
relax_data.read(ri_id='ssNOE_800', ri_type='NOE', frq=799.719*1e6, file='ssNOE_800', res_num_col=1, spin_name_col=2, data_col=3, error_col=4)
 
# Deselect
deselect.all()
# Select
#select.spin(':12@N|:12@H|:13@N|:13@H|:14@N|:14@H|:15@N|:15@H')
select.spin(':12|:13|:14|:15')
for spin, mol_name, res_num, res_name, spin_id in spin_loop(full_info=True, return_id=True, skip_desel=True):
print spin, mol_name, res_num, res_name, spin_id
 
# 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.
############
 
# Change some opt params.
# COMMENT THESE OUT FOR REAL CALCULATION. THIS IS ONLY TO SPEED UP THE PROCESS IN ERROR SEARCHING.
dAuvergne_protocol.opt_func_tol = 1e-5
dAuvergne_protocol.opt_max_iterations = 1000
 
# 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)
</source>

Navigation menu