mailr21714 - in /trunk/test_suite/system_tests: relax_disp.py scripts/relax_disp/hansen_data_missing.py


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

Header


Content

Posted by edward on November 29, 2013 - 11:45:
Author: bugman
Date: Fri Nov 29 11:45:54 2013
New Revision: 21714

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

This is used to demonstrate a failure in the 'R2eff' model when some data is 
missing.


Added:
    trunk/test_suite/system_tests/scripts/relax_disp/hansen_data_missing.py
      - copied, changed from r21702, 
trunk/test_suite/system_tests/scripts/relax_disp/hansen_data.py
Modified:
    trunk/test_suite/system_tests/relax_disp.py

Modified: trunk/test_suite/system_tests/relax_disp.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/relax_disp.py?rev=21714&r1=21713&r2=21714&view=diff
==============================================================================
--- trunk/test_suite/system_tests/relax_disp.py (original)
+++ trunk/test_suite/system_tests/relax_disp.py Fri Nov 29 11:45:54 2013
@@ -751,6 +751,69 @@
         self.assertAlmostEqual(spin71.dw, 2.00500965887772, 3)
         self.assertAlmostEqual(spin71.kex/10000, 2481.10839579804/10000, 3)
         self.assertAlmostEqual(spin71.chi2, 15.6595374288635, 3)
+
+
+    def test_hansen_cpmg_data_missing_auto_analysis(self):
+        """Test of the dispersion auto-analysis using Dr. Flemming Hansen's 
CPMG data with parts missing.
+
+        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.
+        ds.models = [
+            MODEL_R2EFF,
+            MODEL_NOREX,
+            MODEL_CR72
+        ]
+
+        # 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_missing.py')
+        self.interpreter.state.save('analysis_heights', dir=ds.tmpdir, 
force=True)
+
+        # The R20 keys.
+        r20_key1 = generate_r20_key(exp_type=EXP_TYPE_CPMG_SQ, frq=500e6)
+        r20_key2 = generate_r20_key(exp_type=EXP_TYPE_CPMG_SQ, frq=800e6)
+
+        # The 'No Rex' model checks.
+        self.interpreter.pipe.switch(pipe_name='No Rex')
+        spin70 = return_spin(":70")
+        spin71 = return_spin(":71")
+        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[r20_key1], spin71.r2[r20_key1]))
+        print("%-20s %20.15g %20.15g" % ("R2 (800 MHz)", 
spin70.r2[r20_key2], spin71.r2[r20_key2]))
+        print("%-20s %20.15g %20.15g\n" % ("chi2", spin70.chi2, spin71.chi2))
+        self.assertAlmostEqual(spin70.r2[r20_key1], 10.5340593984683, 3)
+        self.assertAlmostEqual(spin70.r2[r20_key2], 16.1112170102734, 3)
+        self.assertAlmostEqual(spin70.chi2, 8973.84810025761, 3)
+        self.assertAlmostEqual(spin71.r2[r20_key1], 5.83139953954648, 3)
+        self.assertAlmostEqual(spin71.r2[r20_key2], 8.90856319376098, 3)
+        self.assertAlmostEqual(spin71.chi2, 3908.00127830003, 3)
+
+        # The 'CR72' model checks.
+        self.interpreter.pipe.switch(pipe_name='CR72')
+        spin70 = return_spin(":70")
+        spin71 = return_spin(":71")
+        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[r20_key1], spin71.r2[r20_key1]))
+        print("%-20s %20.15g %20.15g" % ("R2 (800 MHz)", 
spin70.r2[r20_key2], spin71.r2[r20_key2]))
+        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[r20_key1], 6.97233943292193, 3)
+        self.assertAlmostEqual(spin70.r2[r20_key2], 9.409506394526, 3)
+        self.assertAlmostEqual(spin70.pA, 0.989856804525044, 3)
+        self.assertAlmostEqual(spin70.dw, 5.60889078920945, 3)
+        self.assertAlmostEqual(spin70.kex/10000, 1753.01607073019/10000, 3)
+        self.assertAlmostEqual(spin70.chi2, 53.8382158551706, 3)
+        self.assertAlmostEqual(spin71.r2[r20_key1], 5.003171547206, 3)
+        self.assertAlmostEqual(spin71.r2[r20_key2], 6.90210797727492, 3)
+        self.assertAlmostEqual(spin71.pA, 0.985922406455826, 3)
+        self.assertAlmostEqual(spin71.dw, 2.00500965892672, 3)
+        self.assertAlmostEqual(spin71.kex/10000, 2481.10839579617/10000, 3)
+        self.assertAlmostEqual(spin71.chi2, 15.6595374286822, 3)
 
 
     def test_hansen_cpmg_data_to_cr72(self):

Copied: 
trunk/test_suite/system_tests/scripts/relax_disp/hansen_data_missing.py (from 
r21702, trunk/test_suite/system_tests/scripts/relax_disp/hansen_data.py)
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/scripts/relax_disp/hansen_data_missing.py?p2=trunk/test_suite/system_tests/scripts/relax_disp/hansen_data_missing.py&p1=trunk/test_suite/system_tests/scripts/relax_disp/hansen_data.py&r1=21702&r2=21714&rev=21714&view=diff
==============================================================================
--- trunk/test_suite/system_tests/scripts/relax_disp/hansen_data.py (original)
+++ trunk/test_suite/system_tests/scripts/relax_disp/hansen_data_missing.py 
Fri Nov 29 11:45:54 2013
@@ -6,11 +6,12 @@
 # relax module imports.
 from auto_analyses.relax_disp import Relax_disp
 from data_store import Relax_data_store; ds = Relax_data_store()
+from specific_analyses.relax_disp.variables import MODEL_NOREX, MODEL_R2EFF
 from status import Status; status = Status()
 
 
 # The dispersion models.
-MODELS = ['LM63']
+MODELS = [MODEL_R2EFF, MODEL_NOREX]
 if hasattr(ds, 'models'):
     MODELS = ds.models
 
@@ -38,9 +39,8 @@
 # The path to the data files.
 data_path = status.install_path + 
sep+'test_suite'+sep+'shared_data'+sep+'dispersion'+sep+'Hansen'
 
-# Load the saved base pipe containing R2eff data.
-results.read(data_path+sep+'r2eff_pipe')
-deselect.spin(":4")
+# Load the saved base pipe with the missing data.
+results.read(data_path+sep+'missing_data_pipe')
 
 # Set the nuclear isotope data.
 spin.isotope('15N')




Related Messages


Powered by MHonArc, Updated Fri Nov 29 12:20:02 2013