mailr20410 - in /branches/relax_disp/lib/dispersion: __init__.py lm63_3site.py


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

Header


Content

Posted by edward on July 19, 2013 - 15:14:
Author: bugman
Date: Fri Jul 19 15:14:25 2013
New Revision: 20410

URL: http://svn.gna.org/viewcvs/relax?rev=20410&view=rev
Log:
Added the 'LM63 3-site' R2eff calculating function to the relax library.

This is the Luz and Meiboom 1963 analytic model for three exchanging sites.

This commit follows step 3 of the relaxation dispersion model addition 
tutorial
(http://thread.gmane.org/gmane.science.nmr.relax.devel/3907).


Added:
    branches/relax_disp/lib/dispersion/lm63_3site.py
      - copied, changed from r20406, 
branches/relax_disp/lib/dispersion/lm63.py
Modified:
    branches/relax_disp/lib/dispersion/__init__.py

Modified: branches/relax_disp/lib/dispersion/__init__.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/lib/dispersion/__init__.py?rev=20410&r1=20409&r2=20410&view=diff
==============================================================================
--- branches/relax_disp/lib/dispersion/__init__.py (original)
+++ branches/relax_disp/lib/dispersion/__init__.py Fri Jul 19 15:14:25 2013
@@ -27,6 +27,7 @@
     'dpl94',
     'it99',
     'lm63',
+    'lm63_3site',
     'm61',
     'm61b',
     'ns_2site_3d',

Copied: branches/relax_disp/lib/dispersion/lm63_3site.py (from r20406, 
branches/relax_disp/lib/dispersion/lm63.py)
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/lib/dispersion/lm63_3site.py?p2=branches/relax_disp/lib/dispersion/lm63_3site.py&p1=branches/relax_disp/lib/dispersion/lm63.py&r1=20406&r2=20410&rev=20410&view=diff
==============================================================================
--- branches/relax_disp/lib/dispersion/lm63.py (original)
+++ branches/relax_disp/lib/dispersion/lm63_3site.py Fri Jul 19 15:14:25 2013
@@ -21,41 +21,49 @@
 
###############################################################################
 
 # Module docstring.
-"""The Luz and Meiboom (1963) 2-site fast exchange model.
+"""The Luz and Meiboom (1963) 3-site fast exchange model.
 
-This module is for the function, gradient and Hessian of the LM63 model.  
The model is named after the reference:
+This module is for the function, gradient and Hessian of the 'LM63 3-site' 
model.  The model is named after the reference:
 
     - Luz, S. and Meiboom S., (1963)  Nuclear Magnetic Resonance study of 
protolysis of trimethylammonium ion in aqueous solution - order of reaction 
with respect to solvent, J. Chem. Phys. 39, 366-370 (U{DOI: 
10.1063/1.1734254<http://dx.doi.org/10.1063/1.1734254>}).
 
+The phi_ex_i and kex_i factors for the 3-site model were derived in the 
reference:
+
+
 The equation used is::
 
-                  phi_ex   /     4 * nu_cpmg         /     kex     \ \ 
-    R2eff = R20 + ------ * | 1 - -----------  * tanh | ----------- | | ,
-                   kex     \         kex             \ 4 * nu_cpmg / /
+                   _3_
+                   \    phi_ex_i   /     4 * nu_cpmg         /     ki      \ 
\ 
+    R2eff = R20 +   >   -------- * | 1 - -----------  * tanh | ----------- | 
| .
+                   /__     ki      \         ki              \ 4 * nu_cpmg / 
/
+                   i=2
 
-where::
+For deconvoluting the parameters, see the relax user manual or the reference:
 
-    phi_ex = pA * pB * delta_omega^2 ,
+    - O'Connell, N. E., Grey, M. J., Tang, Y., Kosuri, P., Miloushev, V. Z., 
Raleigh, D. P., and Palmer, 3rd, A. G. (2009). Partially folded equilibrium 
intermediate of the villin headpiece HP67 defined by 13C relaxation 
dispersion. J. Biomol. NMR, 45(1-2), 85-98. (U{DOI: 
10.1007/s10858-009-9340-0<http://dx.doi.org/10.1007/s10858-009-9340-0>}).
 
-kex is the chemical exchange rate constant, pA and pB are the populations of 
states A and B, and delta_omega is the chemical shift difference between the 
two states.
 """
 
 # Python module imports.
 from math import tanh
 
 
-def r2eff_LM63(r20=None, phi_ex=None, kex=None, cpmg_frqs=None, 
back_calc=None, num_points=None):
-    """Calculate the R2eff values for the LM63 model.
+def r2eff_LM63_3site(r20=None, phi_ex=None, kex=None, cpmg_frqs=None, 
back_calc=None, num_points=None):
+    """Calculate the R2eff values for the LM63 3-site model.
 
     See the module docstring for details.
 
 
     @keyword r20:           The R20 parameter value (R2 with no exchange).
     @type r20:              float
-    @keyword phi_ex:        The phi_ex parameter value (pA * pB * 
delta_omega^2).
-    @type phi_ex:           float
-    @keyword kex:           The kex parameter value (the exchange rate in 
rad/s).
-    @type kex:              float
+    @keyword phi_ex_B:      The phi_ex_B parameter value.
+    @type phi_ex_B:         float
+    @keyword phi_ex_C:      The phi_ex_C parameter value.
+    @type phi_ex_C:         float
+    @keyword kB:            Approximate chemical exchange rate constant 
between sites A and B (the exchange rate in rad/s).
+    @type kB:               float
+    @keyword kC:            Approximate chemical exchange rate constant 
between sites A and C (the exchange rate in rad/s).
+    @type kC:               float
     @keyword cpmg_frqs:     The CPMG nu1 frequencies.
     @type cpmg_frqs:        numpy rank-1 float array
     @keyword back_calc:     The array for holding the back calculated R2eff 
values.  Each element corresponds to one of the CPMG nu1 frequencies.
@@ -65,19 +73,23 @@
     """
 
     # Repetitive calculations (to speed up calculations).
-    rex = phi_ex / kex
-    kex_4 = 4.0 / kex
+    rex_B = phi_ex_B / kB
+    rex_C = phi_ex_C / kC
+    kB_4 = 4.0 / kB
+    kC_4 = 4.0 / kC
 
     # Loop over the time points, back calculating the R2eff values.
     for i in range(num_points):
         # Catch zeros.
-        if phi_ex == 0.0:
+        if phi_ex_B == 0.0 and phi_ex_C == 0.0:
             back_calc[i] = r20
 
         # Avoid divide by zero.
-        elif kex == 0.0:
+        elif kA == 0.0 or kB == 0.0:
             back_calc[i] = 1e100
 
         # The full formula.
         else:
-            back_calc[i] = r20 + rex * (1.0 - kex_4 * cpmg_frqs[i] * 
tanh(kex / (4.0 * cpmg_frqs[i])))
+            back_calc[i] = r20
+            back_calc[i] += rex_B * (1.0 - kB_4 * cpmg_frqs[i] * tanh(kB / 
(4.0 * cpmg_frqs[i])))
+            back_calc[i] += rex_C * (1.0 - kC_4 * cpmg_frqs[i] * tanh(kC / 
(4.0 * cpmg_frqs[i])))




Related Messages


Powered by MHonArc, Updated Fri Jul 19 15:40:01 2013