mailr21171 - in /branches/relax_disp/test_suite/system_tests: relax_disp.py scripts/relax_disp/hansen_data.py


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

Header


Content

Posted by edward on October 18, 2013 - 12:27:
Author: bugman
Date: Fri Oct 18 12:27:28 2013
New Revision: 21171

URL: http://svn.gna.org/viewcvs/relax?rev=21171&view=rev
Log:
Created the new Relax_disp.test_hansen_cpmg_data_auto_analysis_numeric system 
test.

This will be used to test a new feature whereby pure numeric models will be 
used in the
auto-analysis.


Modified:
    branches/relax_disp/test_suite/system_tests/relax_disp.py
    
branches/relax_disp/test_suite/system_tests/scripts/relax_disp/hansen_data.py

Modified: branches/relax_disp/test_suite/system_tests/relax_disp.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/test_suite/system_tests/relax_disp.py?rev=21171&r1=21170&r2=21171&view=diff
==============================================================================
--- branches/relax_disp/test_suite/system_tests/relax_disp.py (original)
+++ branches/relax_disp/test_suite/system_tests/relax_disp.py Fri Oct 18 
12:27:28 2013
@@ -31,7 +31,7 @@
 import dep_check
 from pipe_control.mol_res_spin import spin_loop
 from specific_analyses.relax_disp.disp_data import get_curve_type
-from specific_analyses.relax_disp.variables import MODEL_CR72, 
MODEL_CR72_FULL, MODEL_IT99, MODEL_LIST_CPMG, MODEL_LM63, MODEL_M61B, 
MODEL_NOREX, MODEL_R2EFF
+from specific_analyses.relax_disp.variables import MODEL_CR72, 
MODEL_CR72_FULL, MODEL_IT99, MODEL_LIST_CPMG, MODEL_LM63, MODEL_M61B, 
MODEL_NOREX, MODEL_NS_CPMG_2SITE_EXPANDED, MODEL_R2EFF
 from status import Status; status = Status()
 from test_suite.system_tests.base_classes import SystemTestCase
 
@@ -410,6 +410,84 @@
             MODEL_CR72,
             MODEL_IT99
         ]
+
+        # Execute the script.
+        self.interpreter.run(script_file=status.install_path + 
sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'relax_disp'+sep+'hansen_data.py')
+
+        # The 'No Rex' model checks.
+        self.interpreter.pipe.switch(pipe_name='No Rex')
+        spin70 = cdp.mol[0].res[0].spin[0]
+        spin71 = cdp.mol[0].res[1].spin[0]
+        print("\n\nOptimised parameters:\n")
+        print("%-20s %-20s %-20s" % ("Parameter", "Value (:70)", "Value 
(:71)"))
+        print("%-20s %20.15g %20.15g" % ("R2 (500 MHz)", spin70.r2[0], 
spin71.r2[0]))
+        print("%-20s %20.15g %20.15g" % ("R2 (800 MHz)", spin70.r2[1], 
spin71.r2[1]))
+        print("%-20s %20.15g %20.15g\n" % ("chi2", spin70.chi2, spin71.chi2))
+        self.assertAlmostEqual(spin70.r2[0], 10.5340573632181, 4)
+        self.assertAlmostEqual(spin70.r2[1], 16.1113049920324, 4)
+        self.assertAlmostEqual(spin70.chi2, 2832.28562307, 4)
+        self.assertAlmostEqual(spin71.r2[0], 5.83137814994754, 4)
+        self.assertAlmostEqual(spin71.chi2, 73.6219146835821, 4)
+
+        # The 'LM63' model checks.
+        self.interpreter.pipe.switch(pipe_name='LM63')
+        spin70 = cdp.mol[0].res[0].spin[0]
+        spin71 = cdp.mol[0].res[1].spin[0]
+        print("\n\nOptimised parameters:\n")
+        print("%-20s %-20s %-20s" % ("Parameter", "Value (:70)", "Value 
(:71)"))
+        print("%-20s %20.15g %20.15g" % ("R2 (500 MHz)", spin70.r2[0], 
spin71.r2[0]))
+        print("%-20s %20.15g %20.15g" % ("R2 (800 MHz)", spin70.r2[1], 
spin71.r2[1]))
+        print("%-20s %20.15g %20.15g" % ("phi_ex", spin70.phi_ex, 
spin71.phi_ex))
+        print("%-20s %20.15g %20.15g" % ("kex", spin70.kex, spin71.kex))
+        print("%-20s %20.15g %20.15g\n" % ("chi2", spin70.chi2, spin71.chi2))
+        self.assertAlmostEqual(spin70.r2[0], 6.7725779040626, 4)
+        self.assertAlmostEqual(spin70.r2[1], 6.6495102881274, 4)
+        self.assertAlmostEqual(spin70.phi_ex, 0.308228782539112, 4)
+        self.assertAlmostEqual(spin70.kex/10000, 4644.35027966526/10000, 4)
+        self.assertAlmostEqual(spin70.chi2, 137.64638621224, 4)
+        self.assertAlmostEqual(spin71.r2[0], 4.92986568906445, 4)
+        self.assertAlmostEqual(spin71.phi_ex, 0.0595701347673553, 4)
+        self.assertAlmostEqual(spin71.kex/10000, 2566.66176813506/10000, 4)
+        self.assertAlmostEqual(spin71.chi2, 2.31424715490254, 4)
+
+        # The 'CR72' model checks.  These models have not reached the minima 
due to the low quality optimisation!
+        self.interpreter.pipe.switch(pipe_name='CR72')
+        spin70 = cdp.mol[0].res[0].spin[0]
+        spin71 = cdp.mol[0].res[1].spin[0]
+        print("\n\nOptimised parameters:\n")
+        print("%-20s %-20s %-20s" % ("Parameter", "Value (:70)", "Value 
(:71)"))
+        print("%-20s %20.15g %20.15g" % ("R2 (500 MHz)", spin70.r2[0], 
spin71.r2[0]))
+        print("%-20s %20.15g %20.15g" % ("R2 (800 MHz)", spin70.r2[1], 
spin71.r2[1]))
+        print("%-20s %20.15g %20.15g" % ("pA", spin70.pA, spin71.pA))
+        print("%-20s %20.15g %20.15g" % ("dw", spin70.dw, spin71.dw))
+        print("%-20s %20.15g %20.15g" % ("kex", spin70.kex, spin71.kex))
+        print("%-20s %20.15g %20.15g\n" % ("chi2", spin70.chi2, spin71.chi2))
+        self.assertAlmostEqual(spin70.r2[0], 6.97532271825192, 4)
+        self.assertAlmostEqual(spin70.r2[1], 9.45051817816538, 4)
+        self.assertAlmostEqual(spin70.pA, 0.989800346795472, 4)
+        self.assertAlmostEqual(spin70.dw, 5.61326926915313, 4)
+        self.assertAlmostEqual(spin70.kex/10000, 1713.02295468519/10000, 4)
+        self.assertAlmostEqual(spin70.chi2, 17.3955972313639, 4)
+        self.assertAlmostEqual(spin71.r2[0], 0.589453313816438, 2)
+        self.assertAlmostEqual(spin71.pA, 0.500005674625128, 2)
+        self.assertAlmostEqual(spin71.dw, 199.873875627265, 2)
+        self.assertAlmostEqual(spin71.kex, 10.7154862578618, 2)
+        self.assertAlmostEqual(spin71.chi2, 57.9468501661789, 2)
+
+
+    def test_hansen_cpmg_data_auto_analysis_numeric(self):
+        """Test of the numeric model only dispersion auto-analysis using Dr. 
Flemming Hansen's CPMG data.
+
+        This uses the data from Dr. Flemming Hansen's paper at 
http://dx.doi.org/10.1021/jp074793o.  This is CPMG data with a fixed 
relaxation time period.
+        """
+
+        # Set the model and numeric flag.
+        ds.models = [
+            MODEL_NOREX,
+            MODEL_CR72,
+            MODEL_NS_CPMG_2SITE_EXPANDED
+        ]
+        ds.numeric_flag = True
 
         # Execute the script.
         self.interpreter.run(script_file=status.install_path + 
sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'relax_disp'+sep+'hansen_data.py')

Modified: 
branches/relax_disp/test_suite/system_tests/scripts/relax_disp/hansen_data.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/test_suite/system_tests/scripts/relax_disp/hansen_data.py?rev=21171&r1=21170&r2=21171&view=diff
==============================================================================
--- 
branches/relax_disp/test_suite/system_tests/scripts/relax_disp/hansen_data.py 
(original)
+++ 
branches/relax_disp/test_suite/system_tests/scripts/relax_disp/hansen_data.py 
Fri Oct 18 12:27:28 2013
@@ -17,6 +17,12 @@
 # The temporary directory, if needed.
 if not hasattr(ds, 'tmpdir'):
     ds.tmpdir = 'temp'
+
+# The numeric flag.
+if hasattr(ds, 'numeric_flag') and ds.numeric_flag:
+    model_class = 'numeric'
+else:
+    model_class = 'mixed'
 
 # The grid search size (the number of increments per dimension).
 GRID_INC = 5
@@ -54,7 +60,7 @@
 Relax_disp.opt_max_iterations = 10000
 
 # Do not change!
-Relax_disp(pipe_name=pipe_name, pipe_bundle=pipe_bundle, 
results_dir=ds.tmpdir, models=MODELS, grid_inc=GRID_INC, mc_sim_num=MC_NUM)
+Relax_disp(pipe_name=pipe_name, pipe_bundle=pipe_bundle, 
results_dir=ds.tmpdir, models=MODELS, grid_inc=GRID_INC, mc_sim_num=MC_NUM, 
model_class=model_class)
 
 # Save the program state.
 state.save('devnull', force=True)




Related Messages


Powered by MHonArc, Updated Fri Oct 18 12:40:02 2013