Author: bugman Date: Thu Dec 13 17:47:10 2012 New Revision: 18133 URL: http://svn.gna.org/viewcvs/relax?rev=18133&view=rev Log: Created the N_state_model.test_paramag_align_fit system test to check the paramagnetic data. This test check the alignment tensor optimisation of the RDC and PCS data in test_suite/shared_data/align_data/paramagnetic/, loading both alignment data sets but only optimising one tensor. Added: trunk/test_suite/system_tests/scripts/n_state_model/paramag_align_fit.py - copied, changed from r18125, trunk/test_suite/system_tests/scripts/n_state_model/align_fit.py Modified: trunk/test_suite/system_tests/n_state_model.py Modified: trunk/test_suite/system_tests/n_state_model.py URL: http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/n_state_model.py?rev=18133&r1=18132&r2=18133&view=diff ============================================================================== --- trunk/test_suite/system_tests/n_state_model.py (original) +++ trunk/test_suite/system_tests/n_state_model.py Thu Dec 13 17:47:10 2012 @@ -580,6 +580,25 @@ self.assertAlmostEqual(cdp.align_tensors[0].Ayz_err, 0.0) + def test_paramag_align_fit(self): + """Test the use of RDCs and PCSs to find the alignment tensor.""" + + # Execute the script. + self.script_exec(status.install_path + sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'n_state_model'+sep+'paramag_align_fit.py') + + # Test the optimised values. + self.assertAlmostEqual(cdp.align_tensors[1].Axx, 0.001414718232784) + self.assertAlmostEqual(cdp.align_tensors[1].Ayy, 0.001530457843766) + self.assertAlmostEqual(cdp.align_tensors[1].Axy, 0.001689957281873) + self.assertAlmostEqual(cdp.align_tensors[1].Axz, 0.000838692329704) + self.assertAlmostEqual(cdp.align_tensors[1].Ayz, -0.000984302159683) + self.assertAlmostEqual(cdp.q_factors_rdc['Er'], 0.0, 7) + self.assertAlmostEqual(cdp.q_factors_rdc_norm2['Er'], 0.0, 7) + self.assertAlmostEqual(cdp.q_factors_pcs['Er'], 0.0, 7) + self.assertAlmostEqual(cdp.q_rdc, 0.0, 7) + self.assertAlmostEqual(cdp.q_pcs, 0.0, 7) + + def test_paramag_centre_fit(self): """Test the use of RDCs and PCSs to find the alignment tensor.""" Copied: trunk/test_suite/system_tests/scripts/n_state_model/paramag_align_fit.py (from r18125, trunk/test_suite/system_tests/scripts/n_state_model/align_fit.py) URL: http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/scripts/n_state_model/paramag_align_fit.py?p2=trunk/test_suite/system_tests/scripts/n_state_model/paramag_align_fit.py&p1=trunk/test_suite/system_tests/scripts/n_state_model/align_fit.py&r1=18125&r2=18133&rev=18133&view=diff ============================================================================== --- trunk/test_suite/system_tests/scripts/n_state_model/align_fit.py (original) +++ trunk/test_suite/system_tests/scripts/n_state_model/paramag_align_fit.py Thu Dec 13 17:47:10 2012 @@ -11,26 +11,14 @@ # Path of the alignment data and structure. -DATA_PATH = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'align_data'+sep+'CaM' +DATA_PATH = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'align_data'+sep+'paramagnetic' STRUCT_PATH = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'structures' # Create the data pipe. -self._execute_uf('rdc', 'N-state', uf_name='pipe.create') - -# Set the mode, if not specified by the system test. -if not hasattr(ds, 'mode'): - ds.mode = 'all' - -# The data to use. -if hasattr(ds, 'rand') and ds.rand: - rdc_file = 'synth_rdc_rand' - pcs_file = 'synth_pcs_rand' -else: - rdc_file = 'synth_rdc' - pcs_file = 'synth_pcs' +self._execute_uf('paramagnetic alignment', 'N-state', uf_name='pipe.create') # Load the CaM structure. -self._execute_uf(uf_name='structure.read_pdb', file='bax_C_1J7P_N_H_Ca', dir=STRUCT_PATH) +self._execute_uf(uf_name='structure.read_pdb', file='bax_C_1J7P_N_H_Ca', dir=STRUCT_PATH, set_mol_name='CaM') # Load the spins. self._execute_uf(uf_name='structure.load_spins') @@ -45,42 +33,37 @@ self._execute_uf(uf_name='spin.isotope', isotope='1H', spin_id='@H') # RDCs. -if ds.mode in ['rdc', 'all']: - self._execute_uf(uf_name='rdc.read', align_id='synth', file=rdc_file, dir=DATA_PATH, spin_id1_col=1, spin_id2_col=2, data_col=3, error_col=None) +self._execute_uf(uf_name='rdc.read', align_id='Dy', file='dy_700_rdc', dir=DATA_PATH, spin_id1_col=1, spin_id2_col=2, data_col=3, error_col=None) +self._execute_uf(uf_name='rdc.read', align_id='Er', file='er_900_rdc', dir=DATA_PATH, spin_id1_col=1, spin_id2_col=2, data_col=3, error_col=None) + +# The frequency. +self._execute_uf(uf_name='frq.set', id='Dy', frq=700.0 * 1e6) +self._execute_uf(uf_name='frq.set', id='Er', frq=900.0 * 1e6) # PCSs. -if ds.mode in ['pcs', 'all']: - self._execute_uf(uf_name='pcs.read', align_id='synth', file=pcs_file, 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) +self._execute_uf(uf_name='pcs.read', align_id='Dy', file='dy_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) +self._execute_uf(uf_name='pcs.read', align_id='Er', file='er_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) - # Set the paramagnetic centre. - self._execute_uf(uf_name='paramag.centre', atom_id=':1000@CA') +# Set the paramagnetic centre. +self._execute_uf(uf_name='paramag.centre', atom_id=':1000@CA') - # The temperature. - self._execute_uf(uf_name='temperature', id='synth', temp=303) - - # The frequency. - self._execute_uf(uf_name='frq.set', id='synth', frq=600.0 * 1e6) +# The temperature. +self._execute_uf(uf_name='temperature', id='Dy', temp=303) +self._execute_uf(uf_name='temperature', id='Er', temp=303) # Set up the model. self._execute_uf(uf_name='n_state_model.select_model', model='fixed') -# Set the tensor elements. -#cdp.align_tensors[0].Axx = -0.351261/2000 -#cdp.align_tensors[0].Ayy = 0.556994/2000 -#cdp.align_tensors[0].Axy = -0.506392/2000 -#cdp.align_tensors[0].Axz = 0.560544/2000 -#cdp.align_tensors[0].Ayz = -0.286367/2000 +# Set up the alignment tensors (for faster optimisation in the test suite) +self._execute_uf(uf_name='align_tensor.init', tensor='Dy', params=(0.00037, -0.00017, 0.00016, 0.00060, -0.00019)) +self._execute_uf(uf_name='align_tensor.init', tensor='Er', params=(0.00141, 0.00153, 0.00169, 0.00084, -0.00098)) -# Minimisation. -self._execute_uf(uf_name='grid_search', inc=3) +# Minimisation of only the Er tensor. +self._execute_uf(uf_name='align_tensor.fix', id='Dy', fixed=True) self._execute_uf('simplex', constraints=False, max_iter=500, uf_name='minimise') # Write out a results file. -self._execute_uf('devnull', force=True, uf_name='results.write') - -# Show the tensors. -self._execute_uf(uf_name='align_tensor.display') +self._execute_uf('devnull', dir=None, force=True, uf_name='results.write') # Print the contents of the current data pipe (for debugging Q-values). print(cdp) -print(cdp.align_tensors[0])