Package user_functions :: Module relax_data
[hide private]
[frames] | no frames]

Source Code for Module user_functions.relax_data

  1  ############################################################################### 
  2  #                                                                             # 
  3  # Copyright (C) 2003-2012 Edward d'Auvergne                                   # 
  4  #                                                                             # 
  5  # This file is part of the program relax (http://www.nmr-relax.com).          # 
  6  #                                                                             # 
  7  # This program is free software: you can redistribute it and/or modify        # 
  8  # it under the terms of the GNU General Public License as published by        # 
  9  # the Free Software Foundation, either version 3 of the License, or           # 
 10  # (at your option) any later version.                                         # 
 11  #                                                                             # 
 12  # This program is distributed in the hope that it will be useful,             # 
 13  # but WITHOUT ANY WARRANTY; without even the implied warranty of              # 
 14  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               # 
 15  # GNU General Public License for more details.                                # 
 16  #                                                                             # 
 17  # You should have received a copy of the GNU General Public License           # 
 18  # along with this program.  If not, see <http://www.gnu.org/licenses/>.       # 
 19  #                                                                             # 
 20  ############################################################################### 
 21   
 22  # Module docstring. 
 23  """The relax_data user function definitions.""" 
 24   
 25  # Python module imports. 
 26  from os import sep 
 27  import dep_check 
 28  if dep_check.wx_module: 
 29      from wx import FD_OPEN, FD_SAVE 
 30  else: 
 31      FD_OPEN = -1 
 32      FD_SAVE = -1 
 33   
 34  # relax module imports. 
 35  from generic_fns import pipes, relax_data 
 36  from graphics import WIZARD_IMAGE_PATH 
 37  from physical_constants import NH_BOND_LENGTH 
 38  from user_functions.data import Uf_info; uf_info = Uf_info() 
 39  from user_functions.objects import Desc_container 
 40   
 41   
 42  # The user function class. 
 43  uf_class = uf_info.add_class('relax_data') 
 44  uf_class.title = "Class for manipulating R1, R2, and NOE relaxation data." 
 45  uf_class.menu_text = "&relax_data" 
 46  uf_class.gui_icon = "relax.fid" 
 47   
 48   
 49  # The relax_data.back_calc user function. 
 50  uf = uf_info.add_uf('relax_data.back_calc') 
 51  uf.title = "Back calculate the relaxation data at the given frequency." 
 52  uf.title_short = "Relaxation data back calculation." 
 53  uf.add_keyarg( 
 54      name = "ri_id", 
 55      py_type = "str", 
 56      desc_short = "relaxation ID string", 
 57      desc = "The relaxation data ID string.", 
 58      can_be_none = True 
 59  ) 
 60  uf.add_keyarg( 
 61      name = "ri_type", 
 62      py_type = "str", 
 63      desc_short = "relaxation type", 
 64      desc = "The relaxation data type, ie 'R1', 'R2', or 'NOE'.", 
 65      wiz_element_type = "combo", 
 66      wiz_combo_choices = ["R1", "R2", "NOE"], 
 67      wiz_read_only = True, 
 68      can_be_none = True 
 69  ) 
 70  uf.add_keyarg( 
 71      name = "frq", 
 72      py_type = "num", 
 73      desc_short = "frequency", 
 74      desc = "The spectrometer frequency in Hz.", 
 75      can_be_none = True 
 76  ) 
 77  # Description. 
 78  uf.desc.append(Desc_container()) 
 79  uf.desc[-1].add_paragraph("This allows relaxation data of the given type and frequency to be back calculated from the model parameter values.  If the relaxation data ID, type and frequency are not given, then relaxation data matching that currently loaded in the relax data store will be back-calculated.") 
 80  uf.backend = relax_data.back_calc 
 81  uf.menu_text = "&back_calc" 
 82  uf.gui_icon = "oxygen.categories.applications-education" 
 83  uf.wizard_image = WIZARD_IMAGE_PATH + 'fid.png' 
 84   
 85   
 86  # The relax_data.copy user function. 
 87  uf = uf_info.add_uf('relax_data.copy') 
 88  uf.title = "Copy relaxation data from one pipe to another." 
 89  uf.title_short = "Relaxation data copying." 
 90  uf.add_keyarg( 
 91      name = "pipe_from", 
 92      py_type = "str", 
 93      desc_short = "source data pipe", 
 94      desc = "The name of the pipe to copy the relaxation data from.", 
 95      wiz_element_type = 'combo', 
 96      wiz_combo_iter = pipes.pipe_names, 
 97      wiz_read_only = True, 
 98      can_be_none = True 
 99  ) 
100  uf.add_keyarg( 
101      name = "pipe_to", 
102      py_type = "str", 
103      desc_short = "destination data pipe", 
104      desc = "The name of the pipe to copy the relaxation data to.", 
105      wiz_element_type = 'combo', 
106      wiz_combo_iter = pipes.pipe_names, 
107      wiz_read_only = True, 
108      can_be_none = True 
109  ) 
110  uf.add_keyarg( 
111      name = "ri_id", 
112      py_type = "str", 
113      desc_short = "relaxation data ID string", 
114      desc = "The relaxation data ID string.", 
115      wiz_element_type = 'combo', 
116      wiz_combo_iter = relax_data.get_ids, 
117      wiz_read_only = True, 
118      can_be_none = True 
119  ) 
120  # Description. 
121  uf.desc.append(Desc_container()) 
122  uf.desc[-1].add_paragraph("This will copy relaxation data from one data pipe to another.  If the relaxation ID data string is not given then all relaxation data will be copied, otherwise only a specific data set will be copied.") 
123  # Prompt examples. 
124  uf.desc.append(Desc_container("Prompt examples")) 
125  uf.desc[-1].add_paragraph("To copy all relaxation data from pipe 'm1' to pipe 'm9', type one of:") 
126  uf.desc[-1].add_prompt("relax> relax_data.copy('m1', 'm9')") 
127  uf.desc[-1].add_prompt("relax> relax_data.copy(pipe_from='m1', pipe_to='m9')") 
128  uf.desc[-1].add_prompt("relax> relax_data.copy('m1', 'm9', None)") 
129  uf.desc[-1].add_prompt("relax> relax_data.copy(pipe_from='m1', pipe_to='m9', ri_id=None)") 
130  uf.desc[-1].add_paragraph("To copy only the NOE relaxation data with the ID string of 'NOE_800' from 'm3' to 'm6', type one of:") 
131  uf.desc[-1].add_prompt("relax> relax_data.copy('m3', 'm6', 'NOE_800')") 
132  uf.desc[-1].add_prompt("relax> relax_data.copy(pipe_from='m3', pipe_to='m6', ri_id='NOE_800')") 
133  uf.backend = relax_data.copy 
134  uf.menu_text = "&copy" 
135  uf.gui_icon = "oxygen.actions.list-add" 
136  uf.wizard_size = (700, 500) 
137  uf.wizard_image = WIZARD_IMAGE_PATH + 'fid.png' 
138   
139   
140  # The relax_data.delete user function. 
141  uf = uf_info.add_uf('relax_data.delete') 
142  uf.title = "Delete the data corresponding to the relaxation data ID string." 
143  uf.title_short = "Relaxation data deletion." 
144  uf.add_keyarg( 
145      name = "ri_id", 
146      py_type = "str", 
147      desc_short = "relaxation data ID string", 
148      desc = "The relaxation data ID string.", 
149      wiz_element_type = 'combo', 
150      wiz_combo_iter = relax_data.get_ids, 
151      wiz_read_only = True 
152  ) 
153  # Description. 
154  uf.desc.append(Desc_container()) 
155  uf.desc[-1].add_paragraph("The relaxation data corresponding to the given relaxation data ID string will be removed from the current data pipe.") 
156  # Prompt examples. 
157  uf.desc.append(Desc_container("Prompt examples")) 
158  uf.desc[-1].add_paragraph("To delete the relaxation data corresponding to the ID 'NOE_600', type:") 
159  uf.desc[-1].add_prompt("relax> relax_data.delete('NOE_600')") 
160  uf.backend = relax_data.delete 
161  uf.menu_text = "&delete" 
162  uf.gui_icon = "oxygen.actions.list-remove" 
163  uf.wizard_size = (700, 400) 
164  uf.wizard_image = WIZARD_IMAGE_PATH + 'fid.png' 
165   
166   
167  # The relax_data.display user function. 
168  uf = uf_info.add_uf('relax_data.display') 
169  uf.title = "Display the data corresponding to the relaxation data ID string." 
170  uf.title_short = "Displaying relaxation data." 
171  uf.display = True 
172  uf.add_keyarg( 
173      name = "ri_id", 
174      py_type = "str", 
175      desc_short = "relaxation data ID string", 
176      desc = "The relaxation data ID string.", 
177      wiz_element_type = 'combo', 
178      wiz_combo_iter = relax_data.get_ids, 
179      wiz_read_only = True 
180  ) 
181  # Description. 
182  uf.desc.append(Desc_container()) 
183  uf.desc[-1].add_paragraph("This will display the relaxation data corresponding to the given ID.") 
184  # Prompt examples. 
185  uf.desc.append(Desc_container("Prompt examples")) 
186  uf.desc[-1].add_paragraph("To display the NOE relaxation data at 600 MHz with the ID string 'NOE_600', type:") 
187  uf.desc[-1].add_prompt("relax> relax_data.display('NOE_600')") 
188  uf.backend = relax_data.display 
189  uf.menu_text = "dis&play" 
190  uf.gui_icon = "oxygen.actions.document-preview" 
191  uf.wizard_size = (700, 400) 
192  uf.wizard_height_desc = 140 
193  uf.wizard_image = WIZARD_IMAGE_PATH + 'fid.png' 
194   
195   
196  # The relax_data.frq user function. 
197  uf = uf_info.add_uf('relax_data.frq') 
198  uf.title = "Set the spectrometer proton frequency of the relaxation data in Hz." 
199  uf.title_short = "Relaxation data frequency setting." 
200  uf.add_keyarg( 
201      name = "ri_id", 
202      py_type = "str", 
203      desc_short = "relaxation ID string", 
204      desc = "The relaxation data ID string of the data to set the frequency of.", 
205      wiz_element_type = 'combo', 
206      wiz_combo_iter = relax_data.get_ids, 
207      wiz_read_only = True 
208  ) 
209  uf.add_keyarg( 
210      name = "frq", 
211      py_type = "num", 
212      desc_short = "frequency in Hz", 
213      desc = "The exact proton frequency of the spectrometer in Hertz.  See the 'sfrq' parameter in the Varian procpar file or the 'SFO1' parameter in the Bruker acqus file." 
214  ) 
215  # Description. 
216  uf.desc.append(Desc_container()) 
217  uf.desc[-1].add_paragraph("This allows the relaxation data type to be either set or reset.  The frequency must be the that of the proton in Hertz.  This value must be exact and match that of the 'sfrq' parameter in the Varian procpar file or the 'SFO1' parameter in the Bruker acqus file.") 
218  uf.backend = relax_data.frq 
219  uf.menu_text = "&frq" 
220  uf.gui_icon = "relax.frq" 
221  uf.wizard_size = (700, 500) 
222  uf.wizard_image = WIZARD_IMAGE_PATH + 'fid.png' 
223   
224   
225   
226  # The relax_data.peak_intensity_type user function. 
227  uf = uf_info.add_uf('relax_data.peak_intensity_type') 
228  uf.title = "Specify if heights or volumes were used to measure the peak intensities." 
229  uf.title_short = "How were peak intensities measured?" 
230  uf.add_keyarg( 
231      name = "ri_id", 
232      py_type = "str", 
233      desc_short = "relaxation data ID string", 
234      desc = "The relaxation data ID string.", 
235      wiz_element_type = 'combo', 
236      wiz_combo_iter = relax_data.get_ids, 
237      wiz_read_only = True 
238  ) 
239  uf.add_keyarg( 
240      name = "type", 
241      default = "height", 
242      py_type = "str", 
243      desc_short = "peak intensity type", 
244      desc = "The peak intensity type.", 
245      wiz_element_type = "combo", 
246      wiz_combo_choices = ["height", "volume"], 
247      wiz_read_only = True 
248  ) 
249  # Description. 
250  uf.desc.append(Desc_container()) 
251  uf.desc[-1].add_paragraph("This is essential for BMRB data deposition.  It is used to specify whether peak heights or peak volumes were measured.  The two currently allowed values for the peak intensity type are 'height' and 'volume'.") 
252  uf.backend = relax_data.peak_intensity_type 
253  uf.menu_text = "peak_&intensity_type" 
254  uf.gui_icon = "oxygen.actions.edit-rename" 
255  uf.wizard_height_desc = 300 
256  uf.wizard_size = (800, 600) 
257  uf.wizard_image = WIZARD_IMAGE_PATH + 'spectrum' + sep + 'spectrum_200.png' 
258   
259   
260  # The relax_data.read user function. 
261  uf = uf_info.add_uf('relax_data.read') 
262  uf.title = "Read R1, R2, or NOE relaxation data from a file." 
263  uf.title_short = "Reading relaxation data from file." 
264  uf.add_keyarg( 
265      name = "ri_id", 
266      py_type = "str", 
267      desc_short = "relaxation ID string", 
268      desc = "The relaxation data ID string.  This must be a unique identifier." 
269  ) 
270  uf.add_keyarg( 
271      name = "ri_type", 
272      py_type = "str", 
273      desc_short = "relaxation type", 
274      desc = "The relaxation data type, i.e. 'R1', 'R2', or 'NOE'.", 
275      wiz_element_type = "combo", 
276      wiz_combo_choices = ["R1", "R2", "NOE"], 
277      wiz_read_only = True 
278  ) 
279  uf.add_keyarg( 
280      name = "frq", 
281      py_type = "num", 
282      desc_short = "frequency in Hz", 
283      desc = "The exact proton frequency of the spectrometer in Hertz.  See the 'sfrq' parameter in the Varian procpar file or the 'SFO1' parameter in the Bruker acqus file." 
284  ) 
285  uf.add_keyarg( 
286      name = "file", 
287      py_type = "str", 
288      arg_type = "file sel", 
289      desc_short = "file name", 
290      desc = "The name of the file containing the relaxation data.", 
291      wiz_filesel_style = FD_OPEN 
292  ) 
293  uf.add_keyarg( 
294      name = "dir", 
295      py_type = "str", 
296      arg_type = "dir", 
297      desc_short = "directory name", 
298      desc = "The directory where the file is located.", 
299      can_be_none = True 
300  ) 
301  uf.add_keyarg( 
302      name = "spin_id_col", 
303      py_type = "int", 
304      arg_type = "free format", 
305      desc_short = "spin ID string column", 
306      desc = "The spin ID string column (an alternative to the mol, res, and spin name and number columns).", 
307      can_be_none = True 
308  ) 
309  uf.add_keyarg( 
310      name = "mol_name_col", 
311      py_type = "int", 
312      arg_type = "free format", 
313      desc_short = "molecule name column", 
314      desc = "The molecule name column (alternative to the spin_id_col).", 
315      can_be_none = True 
316  ) 
317  uf.add_keyarg( 
318      name = "res_num_col", 
319      py_type = "int", 
320      arg_type = "free format", 
321      desc_short = "residue number column", 
322      desc = "The residue number column (alternative to the spin_id_col).", 
323      can_be_none = True 
324  ) 
325  uf.add_keyarg( 
326      name = "res_name_col", 
327      py_type = "int", 
328      arg_type = "free format", 
329      desc_short = "residue name column", 
330      desc = "The residue name column (alternative to the spin_id_col).", 
331      can_be_none = True 
332  ) 
333  uf.add_keyarg( 
334      name = "spin_num_col", 
335      py_type = "int", 
336      arg_type = "free format", 
337      desc_short = "spin number column", 
338      desc = "The spin number column (alternative to the spin_id_col).", 
339      can_be_none = True 
340  ) 
341  uf.add_keyarg( 
342      name = "spin_name_col", 
343      py_type = "int", 
344      arg_type = "free format", 
345      desc_short = "spin name column", 
346      desc = "The spin name column (alternative to the spin_id_col).", 
347      can_be_none = True 
348  ) 
349  uf.add_keyarg( 
350      name = "data_col", 
351      py_type = "int", 
352      arg_type = "free format", 
353      desc_short = "data column", 
354      desc = "The relaxation data column." 
355  ) 
356  uf.add_keyarg( 
357      name = "error_col", 
358      py_type = "int", 
359      arg_type = "free format", 
360      desc_short = "error column", 
361      desc = "The experimental error column." 
362  ) 
363  uf.add_keyarg( 
364      name = "sep", 
365      py_type = "str", 
366      arg_type = "free format", 
367      desc_short = "column separator", 
368      desc = "The column separator (the default is white space).", 
369      can_be_none = True 
370  ) 
371  uf.add_keyarg( 
372      name = "spin_id", 
373      py_type = "str", 
374      arg_type = "spin ID", 
375      desc_short = "spin ID string", 
376      desc = "The spin ID string to restrict the loading of data to certain spin subsets.", 
377      can_be_none = True 
378  ) 
379  # Description. 
380  uf.desc.append(Desc_container()) 
381  uf.desc[-1].add_paragraph("This will load the relaxation data into the relax data store.  The data is associated with the spectrometer frequency in Hertz.  For subsequent analysis, this frequency must be set to the exact field strength.  This value is stored in the 'sfrq' parameter in the Varian procpar file or the 'SFO1' parameter in the Bruker acqus file.") 
382  uf.desc[-1].add_paragraph("The spin system can be identified in the file using two different formats.  The first is the spin ID string column which can include the molecule name, the residue name and number, and the spin name and number.  Alternatively the molecule name, residue number, residue name, spin number and/or spin name columns can be supplied allowing this information to be in separate columns.  Note that the numbering of columns starts at one.  The spin ID string can be used to restrict the reading to certain spin types, for example only 15N spins when only residue information is in the file.") 
383  # Prompt examples. 
384  uf.desc.append(Desc_container("Prompt examples")) 
385  uf.desc[-1].add_paragraph("The following commands will read the protein NOE relaxation data collected at 600 MHz out of a file called 'noe.600.out' where the residue numbers, residue names, data, errors are in the first, second, third, and forth columns respectively.") 
386  uf.desc[-1].add_prompt("relax> relax_data.read('NOE_600', 'NOE', 599.7 * 1e6, 'noe.600.out', res_num_col=1, res_name_col=2, data_col=3, error_col=4)") 
387  uf.desc[-1].add_prompt("relax> relax_data.read(ri_id='NOE_600', ri_type='NOE', frq=600.0 * 1e6, file='noe.600.out', res_num_col=1, res_name_col=2, data_col=3, error_col=4)") 
388  uf.desc[-1].add_paragraph("The following commands will read the R2 data out of the file 'r2.out' where the residue numbers, residue names, data, errors are in the second, third, fifth, and sixth columns respectively.  The columns are separated by commas.") 
389  uf.desc[-1].add_prompt("relax> relax_data.read('R2_800', 'R2', 8.0 * 1e8, 'r2.out', res_num_col=2, res_name_col=3, data_col=5, error_col=6, sep=',')") 
390  uf.desc[-1].add_prompt("relax> relax_data.read(ri_id='R2_800', ri_type='R2', frq=8.0*1e8, file='r2.out', res_num_col=2, res_name_col=3, data_col=5, error_col=6, sep=',')") 
391  uf.desc[-1].add_paragraph("The following commands will read the R1 data out of the file 'r1.out' where the columns are separated by the symbol '%'") 
392  uf.desc[-1].add_prompt("relax> relax_data.read('R1_300', 'R1', 300.1 * 1e6, 'r1.out', sep='%')") 
393  uf.backend = relax_data.read 
394  uf.menu_text = "&read" 
395  uf.gui_icon = "oxygen.actions.document-open" 
396  uf.wizard_height_desc = 140 
397  uf.wizard_size = (1000, 700) 
398  uf.wizard_image = WIZARD_IMAGE_PATH + 'fid.png' 
399   
400   
401  # The relax_data.temp_calibration user function. 
402  uf = uf_info.add_uf('relax_data.temp_calibration') 
403  uf.title = "Specify the per-experiment temperature calibration method used." 
404  uf.title_short = "The per-experiment temperature calibration method." 
405  uf.add_keyarg( 
406      name = "ri_id", 
407      py_type = "str", 
408      desc_short = "relaxation data ID string", 
409      desc = "The relaxation data ID string.", 
410      wiz_element_type = 'combo', 
411      wiz_combo_iter = relax_data.get_ids, 
412      wiz_read_only = True 
413  ) 
414  uf.add_keyarg( 
415      name = "method", 
416      py_type = "str", 
417      desc_short = "per-experiment calibration method", 
418      desc = "The per-experiment temperature calibration method.", 
419      wiz_element_type = 'combo', 
420      wiz_combo_choices = [ 
421          'methanol', 
422          'monoethylene glycol', 
423          'no calibration applied' 
424      ] 
425  ) 
426  # Description. 
427  uf.desc.append(Desc_container()) 
428  uf.desc[-1].add_paragraph("For the proper measurement of relaxation data, per-experiment temperature calibration is essential.  This user function is not for inputting standard MeOH/ethylene glycol/etc. calibration of a spectrometer - this temperature setting is of no use when you are running experiments which pump in large amounts of power into the probe head.") 
429  uf.desc[-1].add_paragraph("The R1 experiment should be about the same temperature as a HSQC and hence be close to the standard MeOH/ethylene glycol spectrometer calibration.  However the R2 CPMG or spin lock and, to a lesser extent, the NOE pre-saturation pump a lot more power into the probe head.  The power differences can either cause the temperature in the sample to be too high or too low.  This is unpredictable as the thermometer used by the VT unit is next to the coils in the probe head and not inside the NMR sample.  So the VT unit tries to control the temperature inside the probe head rather than in the NMR sample.  However between the thermometer and the sample is the water of the sample, the glass of the NMR tube, the air gap where the VT unit controls air flow and the outside components of the probe head protecting the electronics.  If the sample, the probe head or the VT unit is changed, this will have a different affect on the per-experiment temperature.  The VT unit responds differently under different conditions and may sometimes over or under compensate by a couple of degrees.  Therefore each relaxation data set from each spectrometer requires a per-experiment calibration.") 
430  uf.desc[-1].add_paragraph("Specifying the per-experiment calibration method is needed for BMRB data deposition.  The currently allowed methods are:") 
431  uf.desc[-1].add_list_element("'methanol',") 
432  uf.desc[-1].add_list_element("'monoethylene glycol',") 
433  uf.desc[-1].add_list_element("'no calibration applied'.") 
434  uf.desc[-1].add_paragraph("Other methods will be accepted if supplied.") 
435  uf.backend = relax_data.temp_calibration 
436  uf.menu_text = "&temp_calibration" 
437  uf.gui_icon = "oxygen.status.weather-clear" 
438  uf.wizard_height_desc = 550 
439  uf.wizard_size = (1000, 750) 
440  uf.wizard_image = WIZARD_IMAGE_PATH + 'oxygen-icon-weather-clear.png' 
441   
442   
443  # The relax_data.temp_control user function. 
444  uf = uf_info.add_uf('relax_data.temp_control') 
445  uf.title = "Specify the temperature control method used." 
446  uf.title_short = "The temperature control method." 
447  uf.add_keyarg( 
448      name = "ri_id", 
449      py_type = "str", 
450      desc_short = "relaxation data ID string", 
451      desc = "The relaxation data ID string.", 
452      wiz_element_type = 'combo', 
453      wiz_combo_iter = relax_data.get_ids, 
454      wiz_read_only = True 
455  ) 
456  uf.add_keyarg( 
457      name = "method", 
458      py_type = "str", 
459      desc_short = "temperature control method", 
460      desc = "The control method.", 
461      wiz_element_type = 'combo', 
462      wiz_combo_choices = [ 
463          'single scan interleaving', 
464          'temperature compensation block', 
465          'single scan interleaving and temperature compensation block', 
466          'single fid interleaving', 
467          'single experiment interleaving', 
468          'no temperature control applied' 
469      ], 
470      wiz_read_only = True 
471  ) 
472  # Description. 
473  uf.desc.append(Desc_container()) 
474  uf.desc[-1].add_paragraph("For the proper measurement of relaxation data, explicit temperature control techniques are essential.  A number of factors can cause significant temperature fluctuations between individual relaxation experiments.  This includes the daily temperature cycle of the room housing the spectrometer, different amounts of power for the individual experiments, etc.") 
475  uf.desc[-1].add_paragraph("The best methods for eliminating such problems are single scan interleaving and temperature compensation block.  Single scan interleaving is the most powerful technique for averaging the temperature fluctuations not only across different experiments, but also across the entire measurement time.  The application of off-resonance temperature compensation blocks at the start of the experiment is useful for the R2 and will normalise the temperature between the individual experiments, but single scan or single fid interleaving is nevertheless required for normalising the temperature across the entire measurement.") 
476  uf.desc[-1].add_paragraph("Specifying the temperature control method is needed for BMRB data deposition.  The currently allowed methods are:") 
477  uf.desc[-1].add_list_element("'single scan interleaving',") 
478  uf.desc[-1].add_list_element("'temperature compensation block',") 
479  uf.desc[-1].add_list_element("'single scan interleaving and temperature compensation block',") 
480  uf.desc[-1].add_list_element("'single fid interleaving',") 
481  uf.desc[-1].add_list_element("'single experiment interleaving',") 
482  uf.desc[-1].add_list_element("'no temperature control applied'.") 
483  uf.backend = relax_data.temp_control 
484  uf.menu_text = "temp_contro&l" 
485  uf.gui_icon = "oxygen.status.weather-clear" 
486  uf.wizard_size = (1000, 750) 
487  uf.wizard_height_desc = 500 
488  uf.wizard_image = WIZARD_IMAGE_PATH + 'oxygen-icon-weather-clear.png' 
489   
490   
491  # The relax_data.type user function. 
492  uf = uf_info.add_uf('relax_data.type') 
493  uf.title = "Set the type of relaxation data." 
494  uf.title_short = "Relaxation data type setting." 
495  uf.add_keyarg( 
496      name = "ri_id", 
497      py_type = "str", 
498      desc_short = "relaxation ID string", 
499      desc = "The relaxation data ID string of the data to set the frequency of.", 
500      wiz_element_type = 'combo', 
501      wiz_combo_iter = relax_data.get_ids, 
502      wiz_read_only = True 
503  ) 
504  uf.add_keyarg( 
505      name = "ri_type", 
506      py_type = "str", 
507      desc_short = "relaxation type", 
508      desc = "The relaxation data type, i.e. 'R1', 'R2', or 'NOE'.", 
509      wiz_element_type = "combo", 
510      wiz_combo_choices = ["R1", "R2", "NOE"], 
511      wiz_read_only = True 
512  ) 
513  # Description. 
514  uf.desc.append(Desc_container()) 
515  uf.desc[-1].add_paragraph("This allows the type associated with the relaxation data to be either set or reset.  This type must be one of 'R1', 'R2', or 'NOE'.") 
516  uf.backend = relax_data.type 
517  uf.menu_text = "&type" 
518  uf.gui_icon = "oxygen.actions.edit-rename" 
519  uf.wizard_image = WIZARD_IMAGE_PATH + 'fid.png' 
520   
521   
522   
523  # The relax_data.write user function. 
524  uf = uf_info.add_uf('relax_data.write') 
525  uf.title = "Write relaxation data to a file." 
526  uf.title_short = "Relaxation data writing." 
527  uf.add_keyarg( 
528      name = "ri_id", 
529      py_type = "str", 
530      desc_short = "relaxation data ID string", 
531      desc = "The relaxation data ID string.", 
532      wiz_element_type = 'combo', 
533      wiz_combo_iter = relax_data.get_ids, 
534      wiz_read_only = True 
535  ) 
536  uf.add_keyarg( 
537      name = "file", 
538      py_type = "str", 
539      arg_type = "file sel", 
540      desc_short = "file name", 
541      desc = "The name of the file.", 
542      wiz_filesel_style = FD_SAVE 
543  ) 
544  uf.add_keyarg( 
545      name = "dir", 
546      py_type = "str", 
547      arg_type = "dir", 
548      desc_short = "directory name", 
549      desc = "The directory name.", 
550      can_be_none = True 
551  ) 
552  uf.add_keyarg( 
553      name = "bc", 
554      default = False, 
555      py_type = "bool", 
556      desc_short = "back calculated data flag", 
557      desc = "A flag which if True will cause the back-calculated data to be written to the file." 
558  ) 
559  uf.add_keyarg( 
560      name = "force", 
561      default = False, 
562      py_type = "bool", 
563      desc_short = "force flag", 
564      desc = "A flag which if True will cause the file to be overwritten." 
565  ) 
566  # Description. 
567  uf.desc.append(Desc_container()) 
568  uf.desc[-1].add_paragraph("If no directory name is given, the file will be placed in the current working directory.  The relaxation data ID string is required for selecting which relaxation data to write to file.") 
569  uf.backend = relax_data.write 
570  uf.menu_text = "&write" 
571  uf.gui_icon = "oxygen.actions.document-save" 
572  uf.wizard_size = (800, 600) 
573  uf.wizard_image = WIZARD_IMAGE_PATH + 'fid.png' 
574