Author: bugman Date: Wed Feb 18 14:29:49 2009 New Revision: 8826 URL: http://svn.gna.org/viewcvs/relax?rev=8826&view=rev Log: Added 3 system tests checking the optimisation of the randomised RDC and PCS data. Modified: 1.3/test_suite/system_tests/n_state_model.py 1.3/test_suite/system_tests/scripts/align_fit.py Modified: 1.3/test_suite/system_tests/n_state_model.py URL: http://svn.gna.org/viewcvs/relax/1.3/test_suite/system_tests/n_state_model.py?rev=8826&r1=8825&r2=8826&view=diff ============================================================================== --- 1.3/test_suite/system_tests/n_state_model.py (original) +++ 1.3/test_suite/system_tests/n_state_model.py Wed Feb 18 14:29:49 2009 @@ -108,6 +108,79 @@ self.assertAlmostEqual(cdp.q_pcs, 0.0) + def test_align_fit_rand(self): + """Test the use of randomised RDCs and PCSs to find the alignment tensor.""" + + # Set the mode to use both RDCs and PCSs. + ds.mode = 'all' + + # Select the randomised data. + ds.rand = True + + # Execute the script. + self.relax.interpreter.run(script_file=sys.path[-1] + '/test_suite/system_tests/scripts/align_fit.py') + + # Alias the current data pipe. + cdp = pipes.get_pipe() + + # Test the optimised values. + self.assertAlmostEqual(cdp.align_tensors[0].Axx, -0.351261/2000) + self.assertAlmostEqual(cdp.align_tensors[0].Ayy, 0.556994/2000) + self.assertAlmostEqual(cdp.align_tensors[0].Axy, -0.506392/2000) + self.assertAlmostEqual(cdp.align_tensors[0].Axz, 0.560544/2000) + self.assertAlmostEqual(cdp.align_tensors[0].Ayz, -0.286367/2000) + self.assertAlmostEqual(cdp.chi2, 0.0) + self.assertAlmostEqual(cdp.q_rdc, 0.0) + self.assertAlmostEqual(cdp.q_pcs, 0.0) + + + def test_align_fit_pcs(self): + """Test the use of PCSs to find the alignment tensor.""" + + # Set the mode to use PCSs. + ds.mode = 'pcs' + + # Execute the script. + self.relax.interpreter.run(script_file=sys.path[-1] + '/test_suite/system_tests/scripts/align_fit.py') + + # Alias the current data pipe. + cdp = pipes.get_pipe() + + # Test the optimised values. + self.assertAlmostEqual(cdp.align_tensors[0].Axx, -0.351261/2000) + self.assertAlmostEqual(cdp.align_tensors[0].Ayy, 0.556994/2000) + self.assertAlmostEqual(cdp.align_tensors[0].Axy, -0.506392/2000) + self.assertAlmostEqual(cdp.align_tensors[0].Axz, 0.560544/2000) + self.assertAlmostEqual(cdp.align_tensors[0].Ayz, -0.286367/2000) + self.assertAlmostEqual(cdp.chi2, 0.0) + self.assertAlmostEqual(cdp.q_pcs, 0.0) + + + def test_align_fit_pcs_rand(self): + """Test the use of randomised PCSs to find the alignment tensor.""" + + # Set the mode to use PCSs. + ds.mode = 'pcs' + + # Select the randomised data. + ds.rand = True + + # Execute the script. + self.relax.interpreter.run(script_file=sys.path[-1] + '/test_suite/system_tests/scripts/align_fit.py') + + # Alias the current data pipe. + cdp = pipes.get_pipe() + + # Test the optimised values. + self.assertAlmostEqual(cdp.align_tensors[0].Axx, -0.351261/2000) + self.assertAlmostEqual(cdp.align_tensors[0].Ayy, 0.556994/2000) + self.assertAlmostEqual(cdp.align_tensors[0].Axy, -0.506392/2000) + self.assertAlmostEqual(cdp.align_tensors[0].Axz, 0.560544/2000) + self.assertAlmostEqual(cdp.align_tensors[0].Ayz, -0.286367/2000) + self.assertAlmostEqual(cdp.chi2, 0.0) + self.assertAlmostEqual(cdp.q_pcs, 0.0) + + def test_align_fit_rdc(self): """Test the use of RDCs to find the alignment tensor.""" @@ -130,26 +203,29 @@ self.assertAlmostEqual(cdp.q_rdc, 0.0) - def test_align_fit_pcs(self): - """Test the use of PCSs to find the alignment tensor.""" - - # Set the mode to use PCSs. - ds.mode = 'pcs' - - # Execute the script. - self.relax.interpreter.run(script_file=sys.path[-1] + '/test_suite/system_tests/scripts/align_fit.py') - - # Alias the current data pipe. - cdp = pipes.get_pipe() - - # Test the optimised values. - self.assertAlmostEqual(cdp.align_tensors[0].Axx, -0.351261/2000) - self.assertAlmostEqual(cdp.align_tensors[0].Ayy, 0.556994/2000) - self.assertAlmostEqual(cdp.align_tensors[0].Axy, -0.506392/2000) - self.assertAlmostEqual(cdp.align_tensors[0].Axz, 0.560544/2000) - self.assertAlmostEqual(cdp.align_tensors[0].Ayz, -0.286367/2000) - self.assertAlmostEqual(cdp.chi2, 0.0) - self.assertAlmostEqual(cdp.q_pcs, 0.0) + def test_align_fit_rdc_rand(self): + """Test the use of randomised RDCs to find the alignment tensor.""" + + # Set the mode to use RDCs. + ds.mode = 'rdc' + + # Select the randomised data. + ds.rand = True + + # Execute the script. + self.relax.interpreter.run(script_file=sys.path[-1] + '/test_suite/system_tests/scripts/align_fit.py') + + # Alias the current data pipe. + cdp = pipes.get_pipe() + + # Test the optimised values. + self.assertAlmostEqual(cdp.align_tensors[0].Axx, -0.351261/2000) + self.assertAlmostEqual(cdp.align_tensors[0].Ayy, 0.556994/2000) + self.assertAlmostEqual(cdp.align_tensors[0].Axy, -0.506392/2000) + self.assertAlmostEqual(cdp.align_tensors[0].Axz, 0.560544/2000) + self.assertAlmostEqual(cdp.align_tensors[0].Ayz, -0.286367/2000) + self.assertAlmostEqual(cdp.chi2, 0.0) + self.assertAlmostEqual(cdp.q_rdc, 0.0) def test_lactose_n_state(self): Modified: 1.3/test_suite/system_tests/scripts/align_fit.py URL: http://svn.gna.org/viewcvs/relax/1.3/test_suite/system_tests/scripts/align_fit.py?rev=8826&r1=8825&r2=8826&view=diff ============================================================================== --- 1.3/test_suite/system_tests/scripts/align_fit.py (original) +++ 1.3/test_suite/system_tests/scripts/align_fit.py Wed Feb 18 14:29:49 2009 @@ -20,6 +20,14 @@ 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' + # Load the CaM structure. structure.read_pdb(file='bax_C_1J7P_N_H_Ca', dir=STRUCT_PATH) @@ -36,11 +44,11 @@ # RDCs. if ds.mode in ['rdc', 'all']: - rdc.read(id='synth', file='synth_rdc', dir=DATA_PATH, mol_name_col=0, res_num_col=1, res_name_col=2, spin_num_col=3, spin_name_col=4, data_col=5) + rdc.read(id='synth', file=rdc_file, dir=DATA_PATH, mol_name_col=0, res_num_col=1, res_name_col=2, spin_num_col=3, spin_name_col=4, data_col=5) # PCSs. if ds.mode in ['pcs', 'all']: - pcs.read(id='synth', file='synth_pcs', dir=DATA_PATH, mol_name_col=0, res_num_col=1, res_name_col=2, spin_num_col=3, spin_name_col=4, data_col=5) + pcs.read(id='synth', file=pcs_file, dir=DATA_PATH, mol_name_col=0, res_num_col=1, res_name_col=2, spin_num_col=3, spin_name_col=4, data_col=5) # Set the paramagnetic centre. pcs.centre(atom_id=':1000@CA')