Author: bugman Date: Tue Apr 27 16:08:02 2010 New Revision: 11145 URL: http://svn.gna.org/viewcvs/relax?rev=11145&view=rev Log: Wrote a script for testing the missing RDC and PCS data. This uses the N-state model with N=1, so direct testing of the single state to 4 tensors. Added: 1.3/test_suite/system_tests/scripts/n_state_model/missing_data_test.py - copied, changed from r11098, 1.3/test_suite/system_tests/scripts/n_state_model/lactose_n_state.py Copied: 1.3/test_suite/system_tests/scripts/n_state_model/missing_data_test.py (from r11098, 1.3/test_suite/system_tests/scripts/n_state_model/lactose_n_state.py) URL: http://svn.gna.org/viewcvs/relax/1.3/test_suite/system_tests/scripts/n_state_model/missing_data_test.py?p2=1.3/test_suite/system_tests/scripts/n_state_model/missing_data_test.py&p1=1.3/test_suite/system_tests/scripts/n_state_model/lactose_n_state.py&r1=11098&r2=11145&rev=11145&view=diff ============================================================================== --- 1.3/test_suite/system_tests/scripts/n_state_model/lactose_n_state.py (original) +++ 1.3/test_suite/system_tests/scripts/n_state_model/missing_data_test.py Tue Apr 27 16:08:02 2010 @@ -3,34 +3,21 @@ # Python module imports. import __main__ from os import sep -import sys - -# relax imports. -from data import Relax_data_store; ds = Relax_data_store() -from specific_fns.setup import n_state_model_obj # Path of the files. -str_path = __main__.install_path + sep+'test_suite'+sep+'shared_data'+sep+'structures'+sep+'lactose' -data_path = __main__.install_path + sep+'test_suite'+sep+'shared_data'+sep+'align_data' +str_path = __main__.install_path + sep+'test_suite'+sep+'shared_data'+sep+'structures'+sep+'dna' +data_path = __main__.install_path + sep+'test_suite'+sep+'shared_data'+sep+'align_data'+sep+'missing_data' # Create the data pipe. -pipe.create('lactose', 'N-state') +pipe.create('missing_data_test', 'N-state') -# Load the structures. -NUM_STR = 4 -for i in range(NUM_STR): - structure.read_pdb(file='lactose_MCMM4_S1_'+repr(i+1), dir=str_path, parser='internal', set_model_num=i+1, set_mol_name='lactose_MCMM4_S1') +# Load the structure. +structure.read_pdb(file='LE_trunc.pdb', dir=str_path, set_mol_name='LE') # Load the sequence information. -structure.load_spins(spin_id=':UNK@C*', combine_models=False, ave_pos=False) -structure.load_spins(spin_id=':UNK@H*', combine_models=False, ave_pos=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') +structure.load_spins(spin_id='@C*', combine_models=False, ave_pos=False) +structure.load_spins(spin_id='@H*', combine_models=False, ave_pos=False) # Load the CH vectors for the C atoms. structure.vectors(spin_id='@C*', attached='H*', ave=False) @@ -46,51 +33,29 @@ # Load the RDCs and PCSs. for i in xrange(len(align_list)): # The RDC. - rdc.read(align_id=align_list[i], file='rdc.txt', dir=data_path, mol_name_col=None, res_num_col=None, res_name_col=None, spin_num_col=None, spin_name_col=1, data_col=i+3, error_col=None) - rdc.read(align_id=align_list[i], file='rdc_err.txt', dir=data_path, mol_name_col=None, res_num_col=None, res_name_col=None, spin_num_col=None, spin_name_col=1, data_col=None, error_col=i+3) - rdc.display(align_id=align_list[i]) + if i != 1: + 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) + rdc.display(align_id=align_list[i]) # The PCS. - pcs.read(align_id=align_list[i], file='pcs.txt', dir=data_path, mol_name_col=None, res_num_col=None, res_name_col=None, spin_num_col=None, spin_name_col=1, data_col=i+2, error_col=None) - pcs.read(align_id=align_list[i], file='pcs_err.txt', dir=data_path, mol_name_col=None, res_num_col=None, res_name_col=None, spin_num_col=None, spin_name_col=1, data_col=None, error_col=i+2) - pcs.display(align_id=align_list[i]) + if i != 2: + 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) + pcs.display(align_id=align_list[i]) # The temperature. temperature(id=align_list[i], temp=298) # The frequency. - frq.set(id=align_list[i], frq=900.015 * 1e6) + frq.set(id=align_list[i], frq=799.75376122 * 1e6) -# Create a data pipe for the aligned tag structures. -pipe.create('tag', 'N-state') - -# Load all the tag structures. -NUM_TAG = 10 -for i in range(NUM_TAG): - structure.read_pdb(file='tag_MCMM4_'+repr(i+1), dir=str_path, parser='internal', set_model_num=i+1, set_mol_name='tag') - -# Load the lanthanide atoms. -structure.load_spins(spin_id='@C1', combine_models=False, ave_pos=False) - -# Switch back to the main analysis data pipe. -pipe.switch('lactose') - -# Calculate the paramagnetic centre (from the structures in the 'tag' data pipe). -pcs.centre(atom_id=':4@C1', pipe='tag') +# Set the paramagnetic centre. +pcs.centre([1, 2, -30]) # Set up the model. -n_state_model.select_model(model='population') - -# Set to equal probabilities. -for j in xrange(NUM_STR): - value.set(1.0/NUM_STR, 'p'+repr(j)) +n_state_model.select_model(model='fixed') # Minimisation. -minimise('bfgs', constraints=True, max_iter=5) - -# Calculate the AIC value. -k, n, chi2 = n_state_model_obj.model_statistics() -ds[ds.current_pipe].aic = chi2 + 2.0*k +minimise('bfgs', constraints=True) # Write out a results file. results.write('devnull', force=True)