Author: bugman Date: Wed Oct 12 15:18:25 2011 New Revision: 14837 URL: http://svn.gna.org/viewcvs/relax?rev=14837&view=rev Log: Created a system test script for checking one type of algorithm for Ln3+ position optimisation. Added: 1.3/test_suite/system_tests/scripts/n_state_model/metal_pos_opt.py - copied, changed from r14836, 1.3/test_suite/system_tests/scripts/n_state_model/monte_carlo_testing.py Copied: 1.3/test_suite/system_tests/scripts/n_state_model/metal_pos_opt.py (from r14836, 1.3/test_suite/system_tests/scripts/n_state_model/monte_carlo_testing.py) URL: http://svn.gna.org/viewcvs/relax/1.3/test_suite/system_tests/scripts/n_state_model/metal_pos_opt.py?p2=1.3/test_suite/system_tests/scripts/n_state_model/metal_pos_opt.py&p1=1.3/test_suite/system_tests/scripts/n_state_model/monte_carlo_testing.py&r1=14836&r2=14837&rev=14837&view=diff ============================================================================== --- 1.3/test_suite/system_tests/scripts/n_state_model/monte_carlo_testing.py (original) +++ 1.3/test_suite/system_tests/scripts/n_state_model/metal_pos_opt.py Wed Oct 12 15:18:25 2011 @@ -1,4 +1,4 @@ -"""Script for testing the Monte Carlo simulations of fitting an alignment tensor to RDCs and PCSs.""" +"""Script for testing the lanthanide position optimisation using RDCs and PCSs.""" # Python module imports. from os import sep @@ -11,47 +11,71 @@ # Path of the alignment data and structure. -DATA_PATH = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'align_data'+sep+'monte_carlo_testing' -STRUCT_PATH = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'model_free'+sep+'sphere' +DATA_PATH = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'align_data'+sep+'population_model' +STRUCT_PATH = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'structures'+sep+'lactose' # Create the data pipe. -pipe.create('MC test', 'N-state') +pipe.create('Ln3+ opt', 'N-state') -# Load the test structure. -structure.read_pdb(file='sphere', dir=STRUCT_PATH) +# Load the structures. +for i in range(1, 4): + structure.read_pdb(file='lactose_MCMM4_S1_%i.pdb' % i, dir=STRUCT_PATH, set_model_num=i, set_mol_name='LE') # Load the spins. -structure.load_spins() +structure.load_spins(spin_id=':UNK@C*', ave_pos=False) +structure.load_spins(spin_id=':UNK@H*', ave_pos=False) -# Load the NH vectors. -structure.vectors(spin_id='@N', attached='H', ave=False) +# Deselect the CH2 protons (the rotation of these doesn't work in the model, but the carbon doesn't move). +deselect.spin(spin_id=':UNK@H6') +deselect.spin(spin_id=':UNK@H7') +deselect.spin(spin_id=':UNK@H17') +deselect.spin(spin_id=':UNK@H18') + +# Load the CH vectors. +structure.vectors(spin_id='@C*', attached='H*', ave=False) # Set the values needed to calculate the dipolar constant. -value.set(1.041 * 1e-10, 'bond_length', spin_id="@N") -value.set('15N', 'heteronucleus', spin_id="@N") -value.set('1H', 'proton', spin_id="@N") - -# RDCs. -rdc.read(align_id='synth', file='synth_rdc', dir=DATA_PATH, 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) - -# PCSs. -pcs.read(align_id='synth', file='synth_pcs', dir=DATA_PATH, 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) +value.set(1.10 * 1e-10, 'bond_length', spin_id="@C*") +value.set('13C', 'heteronucleus', spin_id="@C*") +value.set('1H', 'proton', spin_id="@C*") # Set the paramagnetic centre. -paramag.centre(pos=[10.0, 0.0, 0.0]) +paramag.centre([ -14.8, 0.9, 0.2]) -# The temperature. -temperature(id='synth', temp=303) +# File list. +align_list = ['Dy', 'Tb', 'Tm', 'Er'] -# The frequency. -frq.set(id='synth', frq=600.0 * 1e6) +# Load the RDCs and PCSs. +for i in xrange(len(align_list)): + # The RDC. + rdc.read(align_id=align_list[i], file='missing_rdc_%i' % i, dir=DATA_PATH, mol_name_col=1, res_num_col=2, res_name_col=3, spin_num_col=None, spin_name_col=5, data_col=6, error_col=None) -# Set up the model. -n_state_model.select_model(model='fixed') + # The PCS. + pcs.read(align_id=align_list[i], file='missing_pcs_%i' % i, dir=DATA_PATH, mol_name_col=1, res_num_col=2, res_name_col=3, spin_num_col=None, spin_name_col=5, data_col=6, error_col=None) -# Minimisation. -grid_search(inc=3) -minimise('simplex', constraints=False, max_iter=500) + # The temperature. + temperature(id=align_list[i], temp=298) + + # The frequency. + frq.set(id=align_list[i], frq=799.75376122 * 1e6) + + # Set up the model. + n_state_model.select_model('fixed') + + # Minimisation. + grid_search(inc=3) + minimise('newton', constraints=False) + + # Fix the tensor. + align_tensor.fix(id=align_list[i]) + +# Optimise the Ln3+ position. +paramag.centre(fix=False) +minimise('simplex', constraints=False) + +# Optimise everything. +align_tensor.fix(fixed=False) +minimise('simplex', constraints=False) # Monte Carlo simulations. monte_carlo.setup(3)