1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 """The module for the Lipari-Szabo model-free parameter list object."""
24
25
26 from math import pi
27
28
29 from lib.physical_constants import N15_CSA
30 from pipe_control import relax_data
31 from specific_analyses.parameter_object import Param_list
32 from specific_analyses.model_free.parameters import conv_factor_rex, units_rex
33
34
36 """Determine the scaling factor for the Rex parameter.
37
38 @keyword model_info: The model information from model_loop(). This index is zero for the global models or equal to the global spin index (which covers the molecule, residue, and spin indices).
39 @type model_info: int
40 @return: The scaling factor for the Rex parameter.
41 @rtype: float
42 """
43
44
45 return 1.0 / (2.0 * pi * cdp.spectrometer_frq[cdp.ri_ids[0]])**2
46
47
49 """Determine the grid search upper bound for the Rex parameter.
50
51 @keyword incs: The number of grid search increments.
52 @type incs: int
53 @keyword model_info: The model information from model_loop(). This index is zero for the global models or equal to the global spin index (which covers the molecule, residue, and spin indices).
54 @type model_info: int
55 @return: The grid search upper bound for the Rex parameter.
56 @rtype: float
57 """
58
59
60 return 5.0 / (2.0 * pi * cdp.spectrometer_frq[cdp.ri_ids[0]])**2
61
62
63
65 """The Lipari-Szabo model-free parameter list singleton."""
66
67
68 _instance = None
69
71 """Define all the parameters of the analysis."""
72
73
74 if self._initialised: return
75
76
77 Param_list.__init__(self)
78
79
80 self._add(
81 'ri_data',
82 scope = 'spin',
83 desc = relax_data.return_data_desc('ri_data'),
84 py_type = dict,
85 err = False,
86 sim = True
87 )
88 self._add(
89 'ri_data_err',
90 scope = 'spin',
91 desc = relax_data.return_data_desc('ri_data_err'),
92 py_type = dict,
93 err = False,
94 sim = False
95 )
96
97
98 self._add_model_info(equation_flag=True)
99
100
101 self._add_diffusion_params()
102
103
104 self._add(
105 's2',
106 scope = 'spin',
107 default = 0.8,
108 desc = 'S2, the model-free generalised order parameter (S2 = S2f.S2s)',
109 py_type = float,
110 set = 'params',
111 grid_lower = 0.0,
112 grid_upper = 1.0,
113 grace_string = '\\qS\\v{0.4}\\z{0.71}2\\Q',
114 err = True,
115 sim = True
116 )
117 self._add(
118 's2f',
119 scope = 'spin',
120 default = 0.8,
121 desc = 'S2f, the faster motion model-free generalised order parameter',
122 py_type = float,
123 set = 'params',
124 grid_lower = 0.0,
125 grid_upper = 1.0,
126 grace_string = '\\qS\\sf\\N\\h{-0.2}\\v{0.4}\\z{0.71}2\\Q',
127 err = True,
128 sim = True
129 )
130 self._add(
131 's2s',
132 scope = 'spin',
133 default = 0.8,
134 desc = 'S2s, the slower motion model-free generalised order parameter',
135 py_type = float,
136 set = 'params',
137 grid_lower = 0.0,
138 grid_upper = 1.0,
139 grace_string = '\\qS\\ss\\N\\h{-0.2}\\v{0.4}\\z{0.71}2\\Q',
140 err = True,
141 sim = True
142 )
143 self._add(
144 'local_tm',
145 scope = 'spin',
146 default = 10.0 * 1e-9,
147 desc = 'The spin specific global correlation time (seconds)',
148 py_type = float,
149 set = 'params',
150 scaling = 1e-12,
151 grid_lower = 1.0 * 1e-9,
152 grid_upper = 12.0 * 1e-9,
153 grace_string = '\\xt\\f{}\\sm',
154 units = 'ns',
155 err = True,
156 sim = True
157 )
158 self._add(
159 'te',
160 scope = 'spin',
161 default = 100.0 * 1e-12,
162 desc = 'Single motion effective internal correlation time (seconds)',
163 py_type = float,
164 set = 'params',
165 scaling = 1e-12,
166 grid_lower = 0.0,
167 grid_upper = 500.0 * 1e-12,
168 conv_factor = 1e-12,
169 grace_string = '\\xt\\f{}\\se',
170 units = 'ps',
171 err = True,
172 sim = True
173 )
174 self._add(
175 'tf',
176 scope = 'spin',
177 default = 10.0 * 1e-12,
178 desc = 'Faster motion effective internal correlation time (seconds)',
179 py_type = float,
180 set = 'params',
181 scaling = 1e-12,
182 grid_lower = 0.0,
183 grid_upper = 500.0 * 1e-12,
184 conv_factor = 1e-12,
185 grace_string = '\\xt\\f{}\\sf',
186 units = 'ps',
187 err = True,
188 sim = True
189 )
190 self._add(
191 'ts',
192 scope = 'spin',
193 default = 1000.0 * 1e-12,
194 desc = 'Slower motion effective internal correlation time (seconds)',
195 py_type = float,
196 set = 'params',
197 scaling = 1e-12,
198 grid_lower = 0.0,
199 grid_upper = 500.0 * 1e-12,
200 conv_factor = 1e-12,
201 grace_string = '\\xt\\f{}\\ss',
202 units = 'ps',
203 err = True,
204 sim = True
205 )
206 self._add(
207 'rex',
208 scope = 'spin',
209 default = 0.0,
210 desc = 'Chemical exchange relaxation (sigma_ex = Rex / omega**2)',
211 py_type = float,
212 set = 'params',
213 scaling = rex_scaling,
214 grid_lower = 0.0,
215 grid_upper = rex_upper,
216 conv_factor = conv_factor_rex,
217 units = units_rex,
218 grace_string = '\\qR\\sex\\Q',
219 err = True,
220 sim = True
221 )
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238 self._add_csa(
239 default = N15_CSA,
240 set = 'params',
241 err = True,
242 sim = True
243 )
244
245
246 self._add_min_data(min_stats_global=True, min_stats_spin=True)
247
248
249 self._set_uf_title("Model-free parameters")
250 self._uf_param_table(label="table: model-free parameters", caption="Model-free parameters.")
251 self._uf_param_table(label="table: model-free parameter writing", caption="Model-free parameters.")
252 self._uf_param_table(label="table: model-free parameters and min stats", caption="Model-free parameters and minimisation statistics.", sets=['params', 'fixed', 'min'])
253 self._uf_param_table(label="table: all model-free parameters", caption="Model-free parameters.", scope=None)
254 self._uf_param_table(label="table: model-free parameter value setting", caption="Model-free parameters.")
255 self._uf_param_table(label="table: model-free parameter value setting with defaults", caption="Model-free parameter value setting.", default=True)
256
257
258 for doc in self._uf_doc_loop(["table: model-free parameter value setting", "table: model-free parameter value setting with defaults"]):
259 doc.add_paragraph("Setting a parameter value may have no effect depending on which model-free model is chosen. For example if S2f values and S2s values are set but the data pipe corresponds to the model-free model 'm4' then because these data values are not parameters of the model they will have no effect.")
260 doc.add_paragraph("Note that the Rex values are scaled quadratically with field strength and should be supplied as a field strength independent value. Use the following formula to obtain the correct value:")
261 doc.add_verbatim(" value = rex / (2.0 * pi * frequency) ** 2")
262 doc.add_paragraph("where:")
263 doc.add_list_element("rex is the chemical exchange value for the current frequency.")
264 doc.add_list_element("frequency is the proton frequency corresponding to the data.")
265
266
267 for doc in self._uf_doc_loop(["table: model-free parameter writing"]):
268 doc.add_paragraph("For model-free theory it is assumed that Rex values are scaled quadratically with field strength. The values will be very small as they will be written out as a field strength independent value. Hence use the following formula to convert the value to that expected for a given magnetic field strength:")
269 doc.add_verbatim(" Rex = value * (2.0 * pi * frequency) ** 2")
270 doc.add_paragraph("The frequency is that of the proton in Hertz.")
271