mailr11310 - in /1.3/test_suite/system_tests: n_state_model.py scripts/n_state_model/pcs_to_rdc.py


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

Header


Content

Posted by edward on July 15, 2010 - 18:38:
Author: bugman
Date: Thu Jul 15 18:38:18 2010
New Revision: 11310

URL: http://svn.gna.org/viewcvs/relax?rev=11310&view=rev
Log:
Added a system test to back-calculated RDCs from a PCS derived alignment 
tensor.


Added:
    1.3/test_suite/system_tests/scripts/n_state_model/pcs_to_rdc.py
Modified:
    1.3/test_suite/system_tests/n_state_model.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=11310&r1=11309&r2=11310&view=diff
==============================================================================
--- 1.3/test_suite/system_tests/n_state_model.py (original)
+++ 1.3/test_suite/system_tests/n_state_model.py Thu Jul 15 18:38:18 2010
@@ -408,6 +408,18 @@
         self.assertAlmostEqual((chi_diag[0, 0] - chi_diag[1, 1]), 
-3.960936794864)
 
 
+    def test_pcs_to_rdc(self):
+        """Test the back-calculation of RDCs from a PCS derived tensor."""
+
+        # Execute the script.
+        self.interpreter.run(script_file=__main__.install_path + 
sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'n_state_model'+sep+'pcs_to_rdc.py')
+
+        # Test the values.
+        self.assertAlmostEqual(cdp.mol[0].res[0].spin[0].rdc_bc['A'], 
4.1319413321530014)
+        self.assertAlmostEqual(cdp.mol[0].res[1].spin[0].rdc_bc['A'], 
-9.5802642470087989)
+        self.assertAlmostEqual(cdp.mol[0].res[2].spin[0].rdc_bc['A'], 
-16.244078605100817)
+
+
     def test_stereochem_analysis(self):
         """The full relative stereochemistry analysis."""
 

Added: 1.3/test_suite/system_tests/scripts/n_state_model/pcs_to_rdc.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/test_suite/system_tests/scripts/n_state_model/pcs_to_rdc.py?rev=11310&view=auto
==============================================================================
--- 1.3/test_suite/system_tests/scripts/n_state_model/pcs_to_rdc.py (added)
+++ 1.3/test_suite/system_tests/scripts/n_state_model/pcs_to_rdc.py Thu Jul 
15 18:38:18 2010
@@ -1,0 +1,56 @@
+# Python module imports.
+import __main__
+from os import sep
+
+# relax imports.
+from generic_fns.mol_res_spin import spin_loop
+from physical_constants import NH_BOND_LENGTH_RDC, dipolar_constant, g15N, 
g1H
+
+
+# Path of the files.
+str_path = __main__.install_path + 
sep+'test_suite'+sep+'shared_data'+sep+'structures'
+
+# The data pipe.
+pipe.create('rdc_back_calc', 'N-state')
+
+# Load the structures.
+structure.read_pdb('trunc_ubi_pcs.pdb', dir=str_path)
+
+# Load the spins.
+structure.load_spins('@N')
+
+# Set the heteronucleus type.
+value.set('15N', 'heteronucleus')
+value.set('1H', 'proton')
+value.set(NH_BOND_LENGTH_RDC, 'r')
+
+# Load the bond vectors.
+structure.vectors('H', '@N')
+
+# The dipolar constant.
+const = 3.0 / (2.0*pi) * dipolar_constant(g15N, g1H, NH_BOND_LENGTH_RDC)
+
+# The tensor.
+tensor = 'A'
+align_tensor.init(tensor, (4.724/const,  11.856/const, 0, 0, 0), 
param_types=2)
+
+# The temperature.
+temperature(id=tensor, temp=298)
+
+# The frequency.
+frq.set(id=tensor, frq=900.0 * 1e6)
+
+# One state model.
+n_state_model.select_model('fixed')
+n_state_model.number_of_states(N=1)
+
+# Set the RDC data.
+rdcs = [-1.390, -6.270, -9.650]
+i = 0
+for spin in spin_loop():
+    spin.rdc = {}
+    spin.rdc[tensor] = rdcs[i]
+    i += 1
+
+# Back calc.
+rdc.back_calc(tensor)




Related Messages


Powered by MHonArc, Updated Fri Jul 16 11:40:02 2010