mailRe: r4466 - /branches/consistency_tests_1.3/maths_fns/consistency_tests.py


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

Header


Content

Posted by Edward d'Auvergne on January 08, 2008 - 20:07:
Sorry, now I understand the comment.  I was looking for a changed
copyright line and removed cos function in the emailed diff.  I can
now see how these are not in the diff in this case.  The English was
perfectly fine, the problem was at my end.  I should have realised
that the maths_fns/jw_mapping.py code is still identical in the 1.2
and 1.3 lines.

Regards,

Edward



On Jan 8, 2008 7:18 PM, Sebastien Morin <sebastien.morin.1@xxxxxxxxx> wrote:

 Hi,

 The commit message is fine. In fact, I never use 'svn ci -F xx', except
when working with svnmerge.py...

 The only differences for the file 'maths_fns/consistency_tests.py' in the
1.2 and 1.3 branches for consistency tests are related to the import of
'cos' and the copyright. Here is the diff :

 ====================================================
 < # Copyright (C) 2007-2008 Sebastien Morin
#
 ---
 > # Copyright (C) 2007 Sebastien Morin
#
 25c25
 < from math import pi
 ---
 > from math import pi, cos
 ====================================================

 So, it is right to say that the file 'maths_fns/consistency_tests.py' in
the consistency tests branch from the 1.3 line is like a copy from the file
in the 1.2 line, but without the 'cos' import and with updated copyrights...

 English is not my first language and maybe some commit logs I write sound
weird sometimes... If it is the case, please pardon me...

 Ciao !


 Séb  :)







 Edward d'Auvergne wrote:
 Hi,

I think that your commit message is that for a different commit. I
would recommend not using 'svn ci -F xxx' as it is far too easy to
send the wrong file as the commit message. It's best to type the
message as you commit, or to cut and paste. But apart from that, the
code looks good.

Regards,

Edward



On Jan 7, 2008 8:03 PM, <sebastien.morin.1@xxxxxxxxx> wrote:


 Author: semor
Date: Mon Jan 7 20:03:39 2008
New Revision: 4466

URL: http://svn.gna.org/viewcvs/relax?rev=4466&view=rev
Log:
Modified the consistency tests math_fns code.

This is a copy of the 1.2 line code without the 'cos' import and with
updated copyrights.


Modified:
 branches/consistency_tests_1.3/maths_fns/consistency_tests.py

Modified: branches/consistency_tests_1.3/maths_fns/consistency_tests.py
URL:
http://svn.gna.org/viewcvs/relax/branches/consistency_tests_1.3/maths_fns/consistency_tests.py?rev=4466&r1=4465&r2=4466&view=diff
==============================================================================
--- branches/consistency_tests_1.3/maths_fns/consistency_tests.py (original)
+++ branches/consistency_tests_1.3/maths_fns/consistency_tests.py Mon Jan 7
20:03:39 2008
@@ -27,14 +27,30 @@
 from ri_comps import calc_fixed_csa, calc_fixed_dip, comp_csa_const_func,
comp_dip_const_func


-class Mapping:
+class Consistency:
 def __init__(self, frq=None, gx=None, gh=None, mu0=None, h_bar=None):
- """Reduced spectral density mapping."""
+ """Consistency tests for data acquired at different magnetic fields.
+
+ These three tests are used to assess the consistency of datasets aquired
at different
+ magnetic fields. Inconsistency can affect extracted information from
experimental data and
+ can be caused by variations in temperature, concentration, pH, water
suppression, etc.
+
+ This code calculates three functions for each residue. When comparing
datasets from
+ different magnetic field, the value should be the same for each function
as these are field
+ independent. The J(0) function is the spectral density at the zero
frequency and is obtained
+ using a reduced spectral density approach. The F_eta and F_R2 functions
are the
+ consistency functions proposed by Fushman D. et al. (1998) JACS, 120:
10947-10952.
+
+ To assess the consistency of its datasets, one should first calculate
those values (J(0),
+ F_eta and F_R2) for each field. Then, the user should compare values
obtained for different
+ magnetic fields. Comparisons could proceed using correlation plots and
histograms, and the
+ user could also calculate correlation, skewness and kurtosis coefficients.
+ """

 # Initialise the data container.
 self.data = Data()

- # Add the initial data to self.data
+ # Add the initial data to self.data.
 self.data.gx = gx
 self.data.gh = gh
 self.data.mu0 = mu0
@@ -68,10 +84,10 @@
 return (noe - 1.0) * r1 * self.data.gx / self.data.gh


- def func(self, r=None, csa=None, r1=None, r2=None, noe=None):
- """Function for calculating the three spectal density values.
+ def func(self, orientation=None, tc=None, r=None, csa=None, r1=None,
r2=None, noe=None):
+ """Function for calculating the three consistency testing values.

- Three values are returned, J(0), J(wX), and J(wH) (or J(0.87wH)).
+ Three values are returned, J(0), F_eta and F_R2.
 """

 # Calculate the fixed component of the dipolar and CSA constants.
@@ -95,11 +111,35 @@
 # Calculate J(wX).
 jwx = 1.0 / (3.0*d + c) * (r1 - 1.4*sigma_noe)

- # Calculate J(wH).
- jwh = sigma_noe / (5.0*d)
+ # Calculate P_2.
+ # p_2 is a second rank Legendre polynomial as p_2(x) = 0.5 * (3 * (x ** 2)
-1)
+ # where x is the cosine of the angle Theta when expressed in radians.
+ #
+ # Note that the angle Theta (called 'orientation' in relax) is the angle
between the 15N-1H
+ # vector and the principal axis of the 15N chemical shift tensor.
+ p_2 = 0.5 * ((3.0 * (cos(orientation * pi / 180)) ** 2) -1)
+
+ # Calculate eta.
+ # eta is the cross-correlation rate between 15N CSA and 15N-1H dipolar
interaction. It is
+ # expressed here as proposed in Fushman D. & Cowburn D. (1998) JACS, 120:
7109-7110.
+ eta = ((d * c) ** 0.5) * (4.0 * j0 + 3.0 * jwx) * p_2
+
+ # Calculate F_eta.
+ # F_eta is independent of the magnetic field for residues with local
mobility
+ f_eta = eta * self.data.gh / (self.data.frq_list[0, 3] * (4.0 + 3.0 / (1 +
(self.data.frq_list[0, 1] * tc) ** 2)))
+
+ # Calculate P_HF.
+ # P_HF is the contribution to R2 from high frequency motions.
+ # P_HF = 0.5 * d * [J(wH-wN) + 6 * J(wH) + 6 * J(wH+wN)].
+ # Here, P_HF is described using a reduced spectral density approach.
+ p_hf = 1.3 * (self.data.gx / self.data.gh) * (1.0 - noe) * r1
+
+ # Calculate F_R2.
+ # F_R2 tests the consistency of the transverse relaxation data.
+ f_r2 = (r2 - p_hf) / ((4.0 + 3.0 / (1 + (self.data.frq_list[0, 1] * tc) **
2)) * (d + c/3.0))

 # Return the three values.
- return j0, jwx, jwh
+ return j0, f_eta, f_r2


 class Data:


_______________________________________________
relax (http://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




 --
Sebastien Morin
Etudiant au PhD en biochimie
Laboratoire de resonance magnetique nucleaire
Dr Stephane Gagne
CREFSIP (Universite Laval, Quebec, CANADA)
1-418-656-2131 #4530





Related Messages


Powered by MHonArc, Updated Tue Jan 08 21:02:14 2008