1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 from math import cos, pi
26 from numpy import float64, zeros
27
28
29 from ri_comps import calc_fixed_csa, calc_fixed_dip, comp_csa_const_func, comp_dip_const_func
30
31
33 - def __init__(self, frq=None, gx=None, gh=None, mu0=None, h_bar=None):
34 """Consistency tests for data acquired at different magnetic fields.
35
36 These three tests are used to assess the consistency of datasets aquired at different
37 magnetic fields. Inconsistency can affect extracted information from experimental data and
38 can be caused by variations in temperature, concentration, pH, water suppression, etc. The
39 approach is described in Morin & Gagne (2009) JBNMR, 45: 361-372.
40
41 This code calculates three functions for each residue. When comparing datasets from
42 different magnetic fields, the value should be the same for each function as these are field
43 independent. The J(0) function is the spectral density at the zero frequency and is obtained
44 using a reduced spectral density approach (Farrow et al. (1995) JBNMR, 6: 153-162). The
45 F_eta and F_R2 functions are the consistency functions proposed by Fushman et al. (1998)
46 JACS, 120: 10947-10952.
47
48 To assess the consistency of its datasets, one should first calculate one of those values
49 (J(0), F_eta and F_R2, preferentially J(0) as discussed in Morin & Gagne (2009) JBNMR, 45:
50 361-372) for each field. Then, the user should compare values obtained for different
51 magnetic fields. Comparisons should proceed using correlation plots and histograms, and the
52 user could also calculate correlation, skewness and kurtosis coefficients.
53
54 For examples, see Morin & Gagne (2009) JBNMR, 45: 361-372.
55 """
56
57
58 self.data = Data()
59
60
61 self.data.gx = gx
62 self.data.gh = gh
63 self.data.mu0 = mu0
64 self.data.h_bar = h_bar
65
66
67 self.data.num_frq = 1
68
69
70 self.data.dip_const_fixed = 0.0
71 self.data.csa_const_fixed = [0.0]
72 self.data.dip_const_func = 0.0
73 self.data.csa_const_func = zeros(1, float64)
74
75
76 frq = frq * 2 * pi
77 frqX = frq * self.data.gx / self.data.gh
78
79
80 self.data.frq_list = zeros((1, 5), float64)
81 self.data.frq_list[0, 1] = frqX
82 self.data.frq_list[0, 2] = frq - frqX
83 self.data.frq_list[0, 3] = frq
84 self.data.frq_list[0, 4] = frq + frqX
85 self.data.frq_sqrd_list = self.data.frq_list ** 2
86
87
89 """Function for calculating the sigma NOE value."""
90
91 return (noe - 1.0) * r1 * self.data.gx / self.data.gh
92
93
94 - def func(self, orientation=None, tc=None, r=None, csa=None, r1=None, r2=None, noe=None):
95 """Function for calculating the three consistency testing values.
96
97 Three values are returned, J(0), F_eta and F_R2.
98 """
99
100
101 calc_fixed_dip(self.data)
102 calc_fixed_csa(self.data)
103
104
105 comp_dip_const_func(self.data, r)
106 comp_csa_const_func(self.data, csa)
107
108
109 d = self.data.dip_const_func
110 c = self.data.csa_const_func[0]
111
112
113 sigma_noe = self.calc_sigma_noe(noe, r1)
114
115
116 j0 = -1.5 / (3.0*d + c) * (0.5*r1 - r2 + 0.6*sigma_noe)
117
118
119 jwx = 1.0 / (3.0*d + c) * (r1 - 1.4*sigma_noe)
120
121
122
123
124
125
126
127 p_2 = 0.5 * ((3.0 * (cos(orientation * pi / 180)) ** 2) -1)
128
129
130
131
132 eta = ((d * c/3.0) ** 0.5) * (4.0 * j0 + 3.0 * jwx) * p_2
133
134
135
136 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)))
137
138
139
140
141
142 p_hf = 1.3 * (self.data.gx / self.data.gh) * (1.0 - noe) * r1
143
144
145
146 f_r2 = (r2 - p_hf) / ((4.0 + 3.0 / (1 + (self.data.frq_list[0, 1] * tc) ** 2)) * (d + c/3.0))
147
148
149 return j0, f_eta, f_r2
150
151
154 """Empty container for storing data."""
155