mailRe: r24009 - /trunk/test_suite/system_tests/relax_disp.py


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

Header


Content

Posted by Troels Emtekær Linnet on June 17, 2014 - 11:14:
Should I then make a grid search for all values, and do a new
analysis?



2014-06-17 11:08 GMT+02:00 Edward d'Auvergne <edward@xxxxxxxxxxxxx>:

Ah, that is probably because of a bug you fixed
(https://gna.org/bugs/?21954).  The results were generated before this
bug was fixed, so now they will be slightly different as the
test_suite/shared_data/dispersion/Hansen/base_pipe.bz2 and
test_suite/shared_data/dispersion/Hansen/r2eff_pipe.bz2 files have
been updated.  From the log file
test_suite/shared_data/dispersion/Hansen/relax_results/relax_disp.log,
you can see that the results are not too different.  So just change
the values at the start of the test to the final optimised values, and
then change the values in the assertAlmostEqual() checks to the final
values.  I'll update the precision of these checks after running this
on different OSes and 32-bit vs. 64-bit systems.

You can probably see that this is not ideal, but the only 2 other
programs that support this 3-site model are Art Palmer's CPMGFit, and
Michael Bieri's NESSY.  But CPMGFit has the same R20 values for all
fields, so we cannot compare.  And the NESSY model number 4, which is
this model, is not fully implemented and functional.  So we have
nothing to compare to.  I have created synthetic data in
test_suite/shared_data/dispersion/lm63_3site which was to be used for
a system test, but I don't know why that is not in a test :S  There is
even a relax script at
test_suite/shared_data/dispersion/lm63_3site/relax_results/relax_disp.py
which can be converted into a single model optimisation.  I must have
been so busy with the paper drafting that I simply forgot to convert
this to a system test.

Regards,

Edward

On 17 June 2014 09:18,  <tlinnet@xxxxxxxxxxxxx> wrote:
Author: tlinnet
Date: Tue Jun 17 09:18:24 2014
New Revision: 24009

URL: http://svn.gna.org/viewcvs/relax?rev=24009&view=rev
Log:
Added systemtest for model LM63 3 site.

According to results folder in:
test_suite/shared_data/dispersion/Hansen/relax_results/LM63 3-site

This should pass.

But i doesnt?

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=24009&r1=24008&r2=24009&view=diff

==============================================================================
--- trunk/test_suite/system_tests/relax_disp.py (original)
+++ trunk/test_suite/system_tests/relax_disp.py Tue Jun 17 09:18:24 2014
@@ -2492,6 +2492,70 @@
         self.assertAlmostEqual(spin71.phi_ex, 0.0553787828347638)
         self.assertAlmostEqual(spin71.kex/1000, 2781.72293906248/1000)
         self.assertAlmostEqual(spin71.chi2, 17.0776399916287)
+
+
+    def test_hansen_cpmg_data_to_lm63_3site(self):
+        """Optimisation of Dr. Flemming Hansen's CPMG data to the LM63
dispersion model.
+
+        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.
+        """
+
+        # Base data setup.
+        self.setup_hansen_cpmg_data(model='LM63 3-site')
+
+        # Alias the spins.
+        spin70 = return_spin(":70")
+        spin71 = return_spin(":71")
+
+        # 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)
+
+        ## Set the initial parameter values.
+        spin70.r2 = {r20_key1: 7.570370921220954, r20_key2:
8.694446951909107}
+        spin70.phi_ex_B = 0.14872003058250227
+        spin70.phi_ex_C = 0.1319419923472704
+        spin70.kB = 4103.672910444741
+        spin70.kC = 7029.001690726248
+        spin71.r2 = {r20_key1: 5.1347793381636, r20_key2:
7.156573986051575}
+        spin71.phi_ex_B = 0.04013553485505605
+        spin71.phi_ex_C = 0.020050748406928887
+        spin71.kB = 4045.3007136121364
+        spin71.kC = 3586.38798270774
+
+        #self.interpreter.relax_disp.r20_from_min_r2eff(force=False)
+        #self.interpreter.grid_search(lower=None, upper=None, inc=41,
constraints=True, verbosity=1)
+
+        # Low precision optimisation.
+        self.interpreter.minimise(min_algor='simplex',
line_search=None, hessian_mod=None, hessian_type=None, func_tol=1e-25,
grad_tol=None, max_iter=10000000, constraints=True, scaling=True,
verbosity=1)
+
+        # Printout.
+        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" % ("phi_ex_B", spin70.phi_ex_B,
spin71.phi_ex_B))
+        print("%-20s %20.15g %20.15g" % ("phi_ex_C", spin70.phi_ex_C,
spin71.phi_ex_C))
+        print("%-20s %20.15g %20.15g" % ("kB", spin70.kB, spin71.kB))
+        print("%-20s %20.15g %20.15g" % ("kC", spin70.kC, spin71.kC))
+        print("%-20s %20.15g %20.15g\n" % ("chi2", spin70.chi2,
spin71.chi2))
+
+        # Checks for residue :70.
+        #self.assertAlmostEqual(spin70.r2[r20_key1], 6.74362294539099)
+        #self.assertAlmostEqual(spin70.r2[r20_key2], 6.57406797067481,
6)
+        self.assertAlmostEqual(spin70.phi_ex_B, 0.148720030582502)
+        self.assertAlmostEqual(spin70.phi_ex_C, 0.13194199234727)
+        self.assertAlmostEqual(spin70.kB/1000, 4103.67291044474/1000, 6)
+        self.assertAlmostEqual(spin70.kC/1000, 7029.00169072625/1000, 6)
+        #self.assertAlmostEqual(spin70.chi2, 363.534044873483)
+
+        # Checks for residue :71.
+        #self.assertAlmostEqual(spin71.r2[r20_key1], 5.00776657712558)
+        self.assertAlmostEqual(spin71.phi_ex_B, 0.040135534855056)
+        self.assertAlmostEqual(spin71.phi_ex_C, 0.0200507484069289)
+        self.assertAlmostEqual(spin71.kB/1000, 4045.30071361214/1000)
+        self.assertAlmostEqual(spin71.kC/1000, 3586.38798270774/1000)
+        #self.assertAlmostEqual(spin71.chi2, 17.0776399916287)


     def test_hansen_cpmg_data_to_ns_cpmg_2site_3D(self):


_______________________________________________
relax (http://www.nmr-relax.com)

This is the relax-commits mailing list
relax-commits@xxxxxxx

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits

_______________________________________________
relax (http://www.nmr-relax.com)

This is the relax-devel mailing list
relax-devel@xxxxxxx

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-devel



Related Messages


Powered by MHonArc, Updated Tue Jun 17 11:20:21 2014