mailr21413 - in /trunk/test_suite/system_tests: n_state_model.py scripts/n_state_model/pyrotartaric_anhydride.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on November 13, 2013 - 10:47:
Author: bugman
Date: Wed Nov 13 10:47:37 2013
New Revision: 21413

URL: http://svn.gna.org/viewcvs/relax?rev=21413&view=rev
Log:
Created two new system tests based on the new pyrotarctic anhydride long 
range (1J, 2J & 3J) RDC data.

The first (N_state_model.test_pyrotartaric_anhydride_rdcs) optimises an 
alignment tensor using long
range signed RDC data.  The second 
(N_state_model.test_pyrotartaric_anhydride_absT) optimises an
alignment tensor using long range absolute T (J+D) data.  Both test long 
range data together with
methyl group pseudo-atom data.


Added:
    
trunk/test_suite/system_tests/scripts/n_state_model/pyrotartaric_anhydride.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=21413&r1=21412&r2=21413&view=diff
==============================================================================
--- trunk/test_suite/system_tests/n_state_model.py (original)
+++ trunk/test_suite/system_tests/n_state_model.py Wed Nov 13 10:47:37 2013
@@ -920,6 +920,44 @@
         self.assertAlmostEqual(cdp.interatomic[2].rdc_bc['A'], 
-16.244078605100817)
 
 
+    def test_pyrotartaric_anhydride_rdcs(self):
+        """Pyrotarctic anhydride alignment tensor optimisation using long 
range (1J, 2J & 3J) RDC data."""
+
+        # The setup.
+        ds.abs_data = False
+
+        # Execute the script.
+        self.script_exec(status.install_path + 
sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'n_state_model'+sep+'pyrotartaric_anhydride.py')
+
+        # Test the optimised values.
+        self.assertAlmostEqual(cdp.align_tensors[0].Axx, -0.0001756305, 5)
+        self.assertAlmostEqual(cdp.align_tensors[0].Ayy, 0.000278497, 5)
+        self.assertAlmostEqual(cdp.align_tensors[0].Axy, -0.000253196, 5)
+        self.assertAlmostEqual(cdp.align_tensors[0].Axz, 0.000280272, 5)
+        self.assertAlmostEqual(cdp.align_tensors[0].Ayz, -0.0001431835, 5)
+        self.assertAlmostEqual(cdp.chi2, 0.0, 2)
+        self.assertAlmostEqual(cdp.q_rdc, 0.0, 2)
+
+
+    def test_pyrotartaric_anhydride_absT(self):
+        """Pyrotarctic anhydride alignment tensor optimisation using long 
range (1J, 2J & 3J) absolute T (J+D) data."""
+
+        # The setup.
+        ds.abs_data = True
+
+        # Execute the script.
+        self.script_exec(status.install_path + 
sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'n_state_model'+sep+'pyrotartaric_anhydride.py')
+
+        # Test the optimised values.
+        self.assertAlmostEqual(cdp.align_tensors[0].Axx, -0.0001756305, 5)
+        self.assertAlmostEqual(cdp.align_tensors[0].Ayy, 0.000278497, 5)
+        self.assertAlmostEqual(cdp.align_tensors[0].Axy, -0.000253196, 5)
+        self.assertAlmostEqual(cdp.align_tensors[0].Axz, 0.000280272, 5)
+        self.assertAlmostEqual(cdp.align_tensors[0].Ayz, -0.0001431835, 5)
+        self.assertAlmostEqual(cdp.chi2, 0.0, 2)
+        self.assertAlmostEqual(cdp.q_rdc, 0.0, 2)
+
+
     def test_rdc_tensor(self):
         """Test the calculation of an alignment tensor from RDC data."""
 

Added: 
trunk/test_suite/system_tests/scripts/n_state_model/pyrotartaric_anhydride.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/scripts/n_state_model/pyrotartaric_anhydride.py?rev=21413&view=auto
==============================================================================
--- 
trunk/test_suite/system_tests/scripts/n_state_model/pyrotartaric_anhydride.py 
(added)
+++ 
trunk/test_suite/system_tests/scripts/n_state_model/pyrotartaric_anhydride.py 
Wed Nov 13 10:47:37 2013
@@ -1,0 +1,73 @@
+"""Script for testing out the N-state model alignment tensor optimisation 
using pyrotarctic anhydride.
+
+This is for testing both the optimisation of long range RDCs (2J and 3J) to 
pseudo-atoms and for testing the absolute T and absolute J data type.
+"""
+
+# Python module imports.
+from os import sep
+
+# relax imports.
+from data_store import Relax_data_store; ds = Relax_data_store()
+from status import Status; status = Status()
+
+
+# Setup for stand-alone operation.
+if not hasattr(ds, 'abs_data'):
+    ds.abs_data = True
+
+# Path of the files.
+str_path = status.install_path + 
sep+'test_suite'+sep+'shared_data'+sep+'structures'
+data_path = status.install_path + 
sep+'test_suite'+sep+'shared_data'+sep+'align_data'
+
+# Create the data pipe.
+self._execute_uf(uf_name='pipe.create', pipe_name='pyrotartaric anhydride', 
pipe_type='N-state')
+
+# Load the structure.
+self._execute_uf(uf_name='structure.read_pdb', 
file='pyrotartaric_anhydride.pdb', dir=str_path)
+
+# Set up the 13C and 1H spins information.
+self._execute_uf(uf_name='structure.load_spins', spin_id='@C*', 
ave_pos=False)
+self._execute_uf(uf_name='structure.load_spins', spin_id='@H*', 
ave_pos=False)
+
+# Set up the pseudo-atoms.
+self._execute_uf(uf_name='spin.create_pseudo', spin_name='Q9', 
members=['@10', '@11', '@12'], averaging="linear")
+self._execute_uf(uf_name='sequence.display')
+
+# Define the nuclear isotopes of all spins and pseudo-spins.
+self._execute_uf(uf_name='spin.isotope', isotope='13C', spin_id='@C*')
+self._execute_uf(uf_name='spin.isotope', isotope='1H', spin_id='@H*')
+self._execute_uf(uf_name='spin.isotope', isotope='1H', spin_id='@Q*')
+
+# Define the magnetic dipole-dipole relaxation interaction.
+self._execute_uf(uf_name='interatom.read_dist', 
file='pyrotartaric_anhydride_rdcs', dir=data_path, unit='Angstrom', 
spin_id1_col=1, spin_id2_col=2, data_col=5)
+self._execute_uf(uf_name='interatom.unit_vectors', ave=False)
+
+# Load the J and J+D data.
+if ds.abs_data:
+    self._execute_uf(uf_name='rdc.read', align_id='test', 
file='pyrotartaric_anhydride_rdcs', dir=data_path, data_type='T', 
spin_id1_col=1, spin_id2_col=2, data_col=4, absolute=True)
+    self._execute_uf(uf_name='j_coupling.read', 
file='pyrotartaric_anhydride_rdcs', dir=data_path, spin_id1_col=1, 
spin_id2_col=2, data_col=5, sign_col=6)
+
+# Load the RDC data.
+else:
+    self._execute_uf(uf_name='rdc.read', align_id='test', 
file='pyrotartaric_anhydride_rdcs', dir=data_path, spin_id1_col=1, 
spin_id2_col=2, data_col=3)
+
+# Set up the model.
+self._execute_uf(uf_name='n_state_model.select_model', model='fixed')
+
+# Deselect the pseudo-atom protons.
+self._execute_uf(uf_name='deselect.spin', spin_id='@10')
+self._execute_uf(uf_name='deselect.spin', spin_id='@11')
+self._execute_uf(uf_name='deselect.spin', spin_id='@12')
+
+# Minimisation.
+self._execute_uf(uf_name='grid_search', inc=11)
+self._execute_uf(uf_name='minimise', min_algor='newton')
+
+# Show the tensors.
+self._execute_uf(uf_name='align_tensor.display')
+
+# Create a correlation plot.
+self._execute_uf(uf_name='rdc.corr_plot', force=True)
+
+# Save the state.
+self._execute_uf(uf_name='state.save', state='devnull', force=True)




Related Messages


Powered by MHonArc, Updated Wed Nov 13 11:20:01 2013