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

Source Code for Module user_functions.bmrb

  1  ############################################################################### 
  2  #                                                                             # 
  3  # Copyright (C) 2002-2004,2008,2012,2019 Edward d'Auvergne                    # 
  4  # Copyright (C) 2008 Sebastien Morin                                          # 
  5  #                                                                             # 
  6  # This file is part of the program relax (http://www.nmr-relax.com).          # 
  7  #                                                                             # 
  8  # This program is free software: you can redistribute it and/or modify        # 
  9  # it under the terms of the GNU General Public License as published by        # 
 10  # the Free Software Foundation, either version 3 of the License, or           # 
 11  # (at your option) any later version.                                         # 
 12  #                                                                             # 
 13  # This program is distributed in the hope that it will be useful,             # 
 14  # but WITHOUT ANY WARRANTY; without even the implied warranty of              # 
 15  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               # 
 16  # GNU General Public License for more details.                                # 
 17  #                                                                             # 
 18  # You should have received a copy of the GNU General Public License           # 
 19  # along with this program.  If not, see <http://www.gnu.org/licenses/>.       # 
 20  #                                                                             # 
 21  ############################################################################### 
 22   
 23  # Module docstring. 
 24  """The bmrb user function definitions.""" 
 25   
 26  # relax module imports. 
 27  from graphics import WIZARD_IMAGE_PATH 
 28  from pipe_control import bmrb, exp_info, pipes 
 29  from user_functions.data import Uf_info; uf_info = Uf_info() 
 30  from user_functions.objects import Desc_container 
 31   
 32   
 33  # The user function class. 
 34  uf_class = uf_info.add_class('bmrb') 
 35  uf_class.title = "Class for interfacing with the BMRB (http://www.bmrb.wisc.edu/)." 
 36  uf_class.menu_text = "&bmrb" 
 37  uf_class.gui_icon = "relax.bmrb" 
 38   
 39  # The bmrb.citation user function. 
 40  uf = uf_info.add_uf('bmrb.citation') 
 41  uf.title = "Specify a citation to be added the BMRB data file." 
 42  uf.title_short = "Add a citation." 
 43  uf.add_keyarg( 
 44      name = "cite_id", 
 45      basic_types = ["str"], 
 46      desc_short = "citation ID", 
 47      desc = "The citation ID string." 
 48  ) 
 49  uf.add_keyarg( 
 50      name = "authors", 
 51      basic_types = ["str"], 
 52      container_types = ["list"], 
 53      dim = (None,None), 
 54      desc_short = "author list", 
 55      desc = "The list of authors.  Each author element is a list of four elements (the first name, last name, first initial, and middle initials).", 
 56      list_titles = ["First name", "Last name", "First initial", "Middle initials"] 
 57  ) 
 58  uf.add_keyarg( 
 59      name = "doi", 
 60      basic_types = ["str"], 
 61      desc_short = "DOI number", 
 62      desc = "The DOI number, e.g. '10.1000/182'.", 
 63      can_be_none = True 
 64  ) 
 65  uf.add_keyarg( 
 66      name = "pubmed_id", 
 67      basic_types = ["str"], 
 68      desc_short = "Pubmed ID number", 
 69      desc = "The identification code assigned to the publication by PubMed.", 
 70      can_be_none = True 
 71  ) 
 72  uf.add_keyarg( 
 73      name = "full_citation", 
 74      basic_types = ["str"], 
 75      desc_short = "full citation", 
 76      desc = "The full citation as given in a reference list." 
 77  ) 
 78  uf.add_keyarg( 
 79      name = "title", 
 80      basic_types = ["str"], 
 81      desc_short = "publication title", 
 82      desc = "The title of the publication." 
 83  ) 
 84  uf.add_keyarg( 
 85      name = "status", 
 86      default = "published", 
 87      basic_types = ["str"], 
 88      desc_short = "publication status", 
 89      desc = "The status of the publication.  This can be a value such as 'published', 'submitted', etc." 
 90  ) 
 91  uf.add_keyarg( 
 92      name = "type", 
 93      default = "journal", 
 94      basic_types = ["str"], 
 95      desc_short = "publication type", 
 96      desc = "The type of publication, for example 'journal'." 
 97  ) 
 98  uf.add_keyarg( 
 99      name = "journal_abbrev", 
100      basic_types = ["str"], 
101      desc_short = "journal abbreviation", 
102      desc = "The standard journal abbreviation.", 
103      can_be_none = True 
104  ) 
105  uf.add_keyarg( 
106      name = "journal_full", 
107      basic_types = ["str"], 
108      desc_short = "full journal name", 
109      desc = "The full journal name.", 
110      can_be_none = True 
111  ) 
112  uf.add_keyarg( 
113      name = "volume", 
114      basic_types = ["int"], 
115      desc_short = "volume", 
116      desc = "The volume number.", 
117      can_be_none = True 
118  ) 
119  uf.add_keyarg( 
120      name = "issue", 
121      basic_types = ["int"], 
122      desc_short = "issue", 
123      desc = "The issue number.", 
124      can_be_none = True 
125  ) 
126  uf.add_keyarg( 
127      name = "page_first", 
128      basic_types = ["int"], 
129      desc_short = "first page number", 
130      desc = "The first page number.", 
131      can_be_none = True 
132  ) 
133  uf.add_keyarg( 
134      name = "page_last", 
135      basic_types = ["int"], 
136      desc_short = "last page number", 
137      desc = "The last page number.", 
138      can_be_none = True 
139  ) 
140  uf.add_keyarg( 
141      name = "year", 
142      basic_types = ["int"], 
143      max = 3000, 
144      desc_short = "publication year", 
145      desc = "The publication year." 
146  ) 
147  # Description. 
148  uf.desc.append(Desc_container()) 
149  uf.desc[-1].add_paragraph("The full_citation should be in a format similar to that used in a journal article by either cutting and pasting from another document or by typing. Please include author names, title, journal, page numbers, and year or equivalent information for the type of publication given.") 
150  uf.desc[-1].add_paragraph("The journal status can only be one of:") 
151  uf.desc[-1].add_list_element("'preparation',") 
152  uf.desc[-1].add_list_element("'in press',") 
153  uf.desc[-1].add_list_element("'published',") 
154  uf.desc[-1].add_list_element("'retracted',") 
155  uf.desc[-1].add_list_element("'submitted'.") 
156  uf.desc[-1].add_paragraph("The citation type can only be one of:") 
157  uf.desc[-1].add_list_element("'abstract',") 
158  uf.desc[-1].add_list_element("'BMRB only',") 
159  uf.desc[-1].add_list_element("'book',") 
160  uf.desc[-1].add_list_element("'book chapter',") 
161  uf.desc[-1].add_list_element("'internet',") 
162  uf.desc[-1].add_list_element("'journal',") 
163  uf.desc[-1].add_list_element("'personal communication',") 
164  uf.desc[-1].add_list_element("'thesis'.") 
165  uf.desc[-1].add_paragraph("The standard journal abbreviation is that defined by the Chemical Abstract Services for the journal where the data are or will be published.  If the data in the deposition are related to a J. Biomol. NMR paper, the value must be 'J. Biomol. NMR' to alert the BMRB annotators so that the deposition is properly processed.  If the depositor truly does not know the journal, a value of 'not known' or 'na' is acceptable.") 
166  # Prompt examples. 
167  uf.desc.append(Desc_container("Prompt examples")) 
168  uf.desc[-1].add_paragraph("To add the citation \"d'Auvergne E. J., Gooley P. R. (2007). Set theory formulation of the model-free problem and the diffusion seeded model-free paradigm. Mol. Biosyst., 3(7), 483-494.\", type:") 
169  uf.desc[-1].add_prompt("relax> bmrb.citation(authors=[[\"Edward\", \"d'Auvergne\", \"E.\", \"J.\"], [\"Paul\", \"Gooley\", \"P.\", \"R.\"]], doi=\"10.1039/b702202f\", pubmed_id=\"17579774\", full_citation=\"d'Auvergne E. J., Gooley P. R. (2007). Set theory formulation of the model-free problem and the diffusion seeded model-free paradigm. Mol. Biosyst., 3(7), 483-494.\", title=\"Set theory formulation of the model-free problem and the diffusion seeded model-free paradigm.\", status=\"published\", type=\"journal\", journal_abbrev=\"Mol. Biosyst.\", journal_full=\"Molecular Biosystems\", volume=3, issue=7, page_first=483, page_last=498, year=2007)") 
170  uf.backend = exp_info.citation 
171  uf.menu_text = "&citation" 
172  uf.gui_icon = "oxygen.actions.documentation" 
173  uf.wizard_height_desc = 180 
174  uf.wizard_size = (1000, 750) 
175  uf.wizard_image = WIZARD_IMAGE_PATH + 'bmrb.png' 
176   
177   
178  # The bmrb.display user function. 
179  uf = uf_info.add_uf('bmrb.display') 
180  uf.title = "Display the BMRB data in NMR-STAR format." 
181  uf.title_short = "Display the BMRB data." 
182  uf.display = True 
183  uf.add_keyarg( 
184      name = "version", 
185      default = "3.1", 
186      basic_types = ["str"], 
187      desc_short = "NMR-STAR dictionary version", 
188      desc = "The version of the BMRB NMR-STAR format to display.", 
189      wiz_element_type = "combo", 
190      wiz_combo_choices = [ 
191          "2.1", 
192          "3.0", 
193          "3.1" 
194      ], 
195      wiz_read_only = True 
196  ) 
197  # Description. 
198  uf.desc.append(Desc_container()) 
199  uf.desc[-1].add_paragraph("This will print the BMRB NMR-STAR formatted data to STDOUT.") 
200  uf.backend = bmrb.display 
201  uf.menu_text = "&display" 
202  uf.gui_icon = "oxygen.actions.document-preview" 
203  uf.wizard_size = (700, 500) 
204  uf.wizard_apply_button = False 
205  uf.wizard_image = WIZARD_IMAGE_PATH + 'bmrb.png' 
206   
207   
208  # The bmrb.read user function. 
209  uf = uf_info.add_uf('bmrb.read') 
210  uf.title = "Read BMRB files in the NMR-STAR format." 
211  uf.title_short = "Reading of BMRB files." 
212  uf.add_keyarg( 
213      name = "file", 
214      arg_type = "file sel read", 
215      desc_short = "file name", 
216      desc = "The name of the BMRB NMR-STAR formatted file to read.", 
217  ) 
218  uf.add_keyarg( 
219      name = "dir", 
220      arg_type = "dir", 
221      desc_short = "directory name", 
222      desc = "The directory where the file is located.", 
223      can_be_none = True 
224  ) 
225  uf.add_keyarg( 
226      name = "version", 
227      basic_types = ["str"], 
228      desc_short = "NMR-STAR dictionary version", 
229      desc = "The version of the BMRB NMR-STAR format to read.  This is not necessary as the version is normally auto-detected.", 
230      can_be_none = True 
231  ) 
232  uf.add_keyarg( 
233      name = "sample_conditions", 
234      basic_types = ["str"], 
235      desc_short = "sample conditions label", 
236      desc = "The sample conditions label in the NMR-STAR file to restrict loading to.", 
237      can_be_none = True 
238  ) 
239  # Description. 
240  uf.desc.append(Desc_container()) 
241  uf.desc[-1].add_paragraph("This will allow most of the data from a BMRB NMR-STAR formatted file to be loaded into the relax data store.  Note that an empty data pipe should be created for storing the data, and that currently only model-free data pipes can be used.  Also, only one sample condition can be read per relax data pipe.  Therefore if one of the sample conditions is not specified and multiple conditions exist in the NMR-STAR file, an error will be raised.") 
242  uf.backend = bmrb.read 
243  uf.menu_text = "&read" 
244  uf.gui_icon = "oxygen.actions.document-open" 
245  uf.wizard_height_desc = 300 
246  uf.wizard_size = (800, 600) 
247  uf.wizard_image = WIZARD_IMAGE_PATH + 'bmrb.png' 
248   
249   
250  # The bmrb.script user function. 
251  uf = uf_info.add_uf('bmrb.script') 
252  uf.title = "Specify the scripts used in the analysis." 
253  uf.title_short = "Analysis scripts." 
254  uf.add_keyarg( 
255      name = "file", 
256      arg_type = "file sel read", 
257      desc_short = "script file", 
258      desc = "The name of the script file.", 
259  ) 
260  uf.add_keyarg( 
261      name = "dir", 
262      arg_type = "dir", 
263      desc_short = "directory name", 
264      desc = "The directory where the file is located.", 
265      can_be_none = True 
266  ) 
267  uf.add_keyarg( 
268      name = "analysis_type", 
269      basic_types = ["str"], 
270      desc_short = "analysis type", 
271      desc = "The type of analysis performed.", 
272      wiz_element_type = "combo", 
273      wiz_combo_choices = pipes.PIPE_DESC_LIST, 
274      wiz_combo_data = pipes.VALID_TYPES 
275  ) 
276  uf.add_keyarg( 
277      name = "model_selection", 
278      basic_types = ["str"], 
279      desc_short = "model selection", 
280      desc = "The model selection technique used, if relevant.  For example 'AIC' model selection.", 
281      wiz_element_type = "combo", 
282      wiz_combo_choices = [ 
283          "AIC - Akaike's Information Criteria.", 
284          "AICc - Small sample size corrected AIC.", 
285          "BIC - Bayesian or Schwarz Information Criteria.", 
286          "Bootstrap - Bootstrap model selection.", 
287          "CV - Single-item-out cross-validation.", 
288          "Expect - The expected overall discrepancy (the true values of the parameters are required).", 
289          "Farrow - Old model-free method by Farrow et al., 1994.", 
290          "Palmer - Old model-free method by Mandel et al., 1995.", 
291          "Overall - The realised overall discrepancy (the true values of the parameters are required)." 
292      ], 
293      wiz_combo_data = ["AIC", "AICc", "BIC", "BIC", "Bootstrap", "CV", "Expect", "Farrow", "Palmer", "Overall"], 
294      wiz_read_only = False, 
295      can_be_none = True 
296  ) 
297  uf.add_keyarg( 
298      name = "engine", 
299      default = "relax", 
300      basic_types = ["str"], 
301      desc_short = "software engine", 
302      desc = "The software engine used in the analysis.", 
303      wiz_element_type = "combo", 
304      wiz_combo_choices = ["relax", "modelfree4", "dasha", "curvefit"], 
305      wiz_read_only = False 
306  ) 
307  uf.add_keyarg( 
308      name = "model_elim", 
309      default = False, 
310      basic_types = ["bool"], 
311      desc_short = "model elimination flag", 
312      desc = "A model-free specific flag specifying if model elimination was performed." 
313  ) 
314  uf.add_keyarg( 
315      name = "universal_solution", 
316      default = False, 
317      basic_types = ["bool"], 
318      desc_short = "universal solution flag", 
319      desc = "A model-free specific flag specifying if the universal solution was sought after." 
320  ) 
321  # Description. 
322  uf.desc.append(Desc_container()) 
323  uf.desc[-1].add_paragraph("This user function allows scripts used in the analysis to be included in the BMRB deposition.  The following addition information may need to be specified with the script.") 
324  uf.desc[-1].add_paragraph("The analysis type must be set.  Allowable values include all the data pipe types used in relax, ie:") 
325  uf.desc[-1].add_item_list_element("'frame order'", "The Frame Order theories,") 
326  uf.desc[-1].add_item_list_element("'jw'", "Reduced spectral density mapping,") 
327  uf.desc[-1].add_item_list_element("'mf'", "Model-free analysis,") 
328  uf.desc[-1].add_item_list_element("'N-state'", "N-state model of domain motions,") 
329  uf.desc[-1].add_item_list_element("'noe'", "Steady state NOE calculation,") 
330  uf.desc[-1].add_item_list_element("'relax_fit'", "Relaxation curve fitting,") 
331  uf.desc[-1].add_paragraph("The model selection technique only needs to be set if the script selects between different mathematical models.  This can be anything, but the following are recommended:") 
332  uf.desc[-1].add_item_list_element("'AIC'", "Akaike's Information Criteria.") 
333  uf.desc[-1].add_item_list_element("'AICc'", "Small sample size corrected AIC.") 
334  uf.desc[-1].add_item_list_element("'BIC'", "Bayesian or Schwarz Information Criteria.") 
335  uf.desc[-1].add_item_list_element("'Bootstrap'", "Bootstrap model selection.") 
336  uf.desc[-1].add_item_list_element("'CV'", "Single-item-out cross-validation.") 
337  uf.desc[-1].add_item_list_element("'Expect'", "The expected overall discrepancy (the true values of the parameters are required).") 
338  uf.desc[-1].add_item_list_element("'Farrow'", "Old model-free method by Farrow et al., 1994.") 
339  uf.desc[-1].add_item_list_element("'Palmer'", "Old model-free method by Mandel et al., 1995.") 
340  uf.desc[-1].add_item_list_element("'Overall'", "The realised overall discrepancy (the true values of the parameters are required).") 
341  uf.desc[-1].add_paragraph("The engine is the software used in the calculation, optimisation, etc.  This can be anything, but those recognised by relax (automatic program info, citations, etc. added) include:") 
342  uf.desc[-1].add_item_list_element("'relax'", "hence relax was used for the full analysis.") 
343  uf.desc[-1].add_item_list_element("'modelfree4'", "Art Palmer's Modelfree4 program was used for optimising the model-free parameter values.") 
344  uf.desc[-1].add_item_list_element("'dasha'", "The Dasha program was used for optimising the model-free parameter values.") 
345  uf.desc[-1].add_item_list_element("'curvefit'", "Art Palmer's curvefit program was used to determine the R1 or R2 values.") 
346  uf.desc[-1].add_paragraph("The model_elim flag is model-free specific and should be set if the methods from \"d'Auvergne, E. J. and Gooley, P. R. (2006). Model-free model elimination: A new step in the model-free dynamic analysis of NMR relaxation data. J. Biomol. NMR, 35(2), 117-135.\" were used.  This should be set to True for the full_analysis.py script.") 
347  uf.desc[-1].add_paragraph("The universal_solution flag is model-free specific and should be set if the methods from \"d'Auvergne E. J., Gooley P. R. (2007). Set theory formulation of the model-free problem and the diffusion seeded model-free paradigm. Mol. Biosyst., 3(7), 483-494.\" were used.  This should be set to True for the full_analysis.py script.") 
348  # Prompt examples. 
349  uf.desc.append(Desc_container("Prompt examples")) 
350  uf.desc[-1].add_paragraph("For BMRB deposition, to specify that the full_analysis.py script was used, type one of:") 
351  uf.desc[-1].add_prompt("relax> bmrb.script('full_analysis.py', 'model-free', 'AIC', 'relax', True, True)") 
352  uf.desc[-1].add_prompt("relax> bmrb.script(file='full_analysis.py', dir=None, analysis_type='model-free', model_selection='AIC', engine='relax', model_elim=True, universal_solution=True)") 
353  uf.backend = exp_info.script 
354  uf.menu_text = "&script" 
355  uf.gui_icon = "oxygen.mimetypes.application-x-desktop" 
356  uf.wizard_height_desc = 400 
357  uf.wizard_size = (1000, 750) 
358  uf.wizard_image = WIZARD_IMAGE_PATH + 'bmrb.png' 
359   
360   
361  # The bmrb.software user function. 
362  uf = uf_info.add_uf('bmrb.software') 
363  uf.title = "Specify the software used in the analysis." 
364  uf.title_short = "Analysis software." 
365  uf.add_keyarg( 
366      name = "name", 
367      basic_types = ["str"], 
368      desc_short = "program name", 
369      desc = "The name of the software program utilised." 
370  ) 
371  uf.add_keyarg( 
372      name = "version", 
373      basic_types = ["str"], 
374      desc_short = "version", 
375      desc = "The version of the software, if applicable.", 
376      can_be_none = True 
377  ) 
378  uf.add_keyarg( 
379      name = "url", 
380      basic_types = ["str"], 
381      desc_short = "URL", 
382      desc = "The web address of the software.", 
383      can_be_none = True 
384  ) 
385  uf.add_keyarg( 
386      name = "vendor_name", 
387      basic_types = ["str"], 
388      desc_short = "vendor name", 
389      desc = "The name of the company or person behind the program.", 
390      can_be_none = True 
391  ) 
392  uf.add_keyarg( 
393      name = "cite_ids", 
394      basic_types = ["str"], 
395      container_types = ["list"], 
396      dim = (None,), 
397      desc_short = "citation ID numbers", 
398      desc = "A list of the BMRB citation ID numbers.", 
399      can_be_none = True 
400  ) 
401  uf.add_keyarg( 
402      name = "tasks", 
403      basic_types = ["str"], 
404      container_types = ["list"], 
405      dim = (None,), 
406      desc_short = "tasks", 
407      desc = "A list of all the tasks performed by the software.", 
408      wiz_element_type = "combo_list", 
409      wiz_combo_choices = [ 
410          'chemical shift assignment', 
411          'chemical shift calculation', 
412          'collection', 
413          'data analysis', 
414          'geometry optimization', 
415          'peak picking', 
416          'processing', 
417          'refinement', 
418          'structure solution' 
419      ], 
420      wiz_read_only = False, 
421      can_be_none = True 
422  ) 
423  # Description. 
424  uf.desc.append(Desc_container()) 
425  uf.desc[-1].add_paragraph("This user function allows the software used in the analysis to be specified in full detail.") 
426  uf.desc[-1].add_paragraph("For the tasks list, this should be a python list of strings (e.g. ['spectral processing']).  Although not restricted to these, the values suggested by the BMRB are:") 
427  uf.desc[-1].add_list_element("'chemical shift assignment',") 
428  uf.desc[-1].add_list_element("'chemical shift calculation',") 
429  uf.desc[-1].add_list_element("'collection',") 
430  uf.desc[-1].add_list_element("'data analysis',") 
431  uf.desc[-1].add_list_element("'geometry optimization',") 
432  uf.desc[-1].add_list_element("'peak picking',") 
433  uf.desc[-1].add_list_element("'processing',") 
434  uf.desc[-1].add_list_element("'refinement',") 
435  uf.desc[-1].add_list_element("'structure solution'") 
436  # Prompt examples. 
437  uf.desc.append(Desc_container("Prompt examples")) 
438  uf.desc[-1].add_paragraph("For BMRB deposition, to say that Sparky was used in the analysis, type:") 
439  uf.desc[-1].add_prompt("relax> cite_id = bmrb.citation(authors=[[\"Tom\", \"Goddard\", \"T.\", \"D.\"], [\"D\", \"Kneller\", \"D.\", \"G.\"]], title=\"Goddard, T. D. and Kneller, D. G., SPARKY 3, University of California, San Francisco.\"") 
440  uf.desc[-1].add_prompt("relax> bmrb.software(\"Sparky\", version=\"3.110\", url=\"http://www.cgl.ucsf.edu/home/sparky/\", vendor_name=\"Goddard, T. D.\", cite_ids=[cite_id], tasks=[\"spectral analysis\"])") 
441  uf.backend = exp_info.software 
442  uf.menu_text = "soft&ware" 
443  uf.gui_icon = "oxygen.apps.utilities-terminal" 
444  uf.wizard_height_desc = 450 
445  uf.wizard_size = (900, 750) 
446  uf.wizard_image = WIZARD_IMAGE_PATH + 'bmrb.png' 
447   
448   
449  # The bmrb.software_select user function. 
450  uf = uf_info.add_uf('bmrb.software_select') 
451  uf.title = "Select the software used in the analysis." 
452  uf.title_short = "Utilised software selection." 
453  uf.add_keyarg( 
454      name = "name", 
455      basic_types = ["str"], 
456      desc_short = "program name", 
457      desc = "The name of the software program utilised.", 
458      wiz_element_type = "combo", 
459      wiz_combo_choices = ['NMRPipe', 'Sparky'], 
460      wiz_read_only = True 
461  ) 
462  uf.add_keyarg( 
463      name = "version", 
464      basic_types = ["str"], 
465      desc_short = "version", 
466      desc = "The version of the software, if applicable.", 
467      can_be_none = True 
468  ) 
469  # Description. 
470  uf.desc.append(Desc_container()) 
471  uf.desc[-1].add_paragraph("Rather than specifying all the information directly, this user function allows the software packaged used in the analysis to be selected by name.  The programs currently supported are:") 
472  uf.desc[-1].add_item_list_element("'NMRPipe'", "http://spin.niddk.nih.gov/NMRPipe/") 
473  uf.desc[-1].add_item_list_element("'Sparky'", "http://www.cgl.ucsf.edu/home/sparky/") 
474  uf.desc[-1].add_paragraph("More can be added if all relevant information (program name, description, website, original citation, purpose, etc.) is emailed to relax-users@gna.org.") 
475  uf.desc[-1].add_paragraph("Note that relax is automatically added to the BMRB file.") 
476  # Prompt examples. 
477  uf.desc.append(Desc_container("Prompt examples")) 
478  uf.desc[-1].add_paragraph("For BMRB deposition, to say that both NMRPipe and Sparky were used prior to relax, type:") 
479  uf.desc[-1].add_prompt("relax> bmrb.software_select('NMRPipe')") 
480  uf.desc[-1].add_prompt("relax> bmrb.software_select('Sparky', version='3.113')") 
481  uf.backend = exp_info.software_select 
482  uf.menu_text = "software_se&lect" 
483  uf.gui_icon = "oxygen.apps.utilities-terminal" 
484  uf.wizard_height_desc = 550 
485  uf.wizard_size = (800, 700) 
486  uf.wizard_image = WIZARD_IMAGE_PATH + 'bmrb.png' 
487   
488   
489  # The bmrb.thiol_state user function. 
490  uf = uf_info.add_uf('bmrb.thiol_state') 
491  uf.title = "Select the thiol state of the system." 
492  uf.title_short = "Thiol state selection." 
493  uf.add_keyarg( 
494      name = "state", 
495      basic_types = ["str"], 
496      desc_short = "thiol state", 
497      desc = "The thiol state.", 
498      wiz_element_type = "combo", 
499      wiz_combo_choices = [ 
500          'all disulfide bound', 
501          'all free', 
502          'all other bound', 
503          'disulfide and other bound', 
504          'free and disulfide bound', 
505          'free and other bound', 
506          'free disulfide and other bound', 
507          'not available', 
508          'not present', 
509          'not reported', 
510          'unknown' 
511      ], 
512      wiz_read_only = False 
513  ) 
514  # Description. 
515  uf.desc.append(Desc_container()) 
516  uf.desc[-1].add_paragraph("The thiol state can be any text, thought the BMRB suggests the following:") 
517  uf.desc[-1].add_list_element("'all disulfide bound',") 
518  uf.desc[-1].add_list_element("'all free',") 
519  uf.desc[-1].add_list_element("'all other bound',") 
520  uf.desc[-1].add_list_element("'disulfide and other bound',") 
521  uf.desc[-1].add_list_element("'free and disulfide bound',") 
522  uf.desc[-1].add_list_element("'free and other bound',") 
523  uf.desc[-1].add_list_element("'free disulfide and other bound',") 
524  uf.desc[-1].add_list_element("'not available',") 
525  uf.desc[-1].add_list_element("'not present',") 
526  uf.desc[-1].add_list_element("'not reported',") 
527  uf.desc[-1].add_list_element("'unknown'.") 
528  uf.desc[-1].add_paragraph("Alternatively the pure states 'reduced' or 'oxidised' could be specified.") 
529  # Prompt examples. 
530  uf.desc.append(Desc_container("Prompt examples")) 
531  uf.desc[-1].add_paragraph("For BMRB deposition, to say that the protein studied is in the oxidised state, tyype one of:") 
532  uf.desc[-1].add_prompt("relax> bmrb.thiol_state('oxidised')") 
533  uf.desc[-1].add_prompt("relax> bmrb.thiol_state(state='oxidised')") 
534  uf.backend = exp_info.thiol_state 
535  uf.menu_text = "&thiol_state" 
536  uf.wizard_height_desc = 400 
537  uf.wizard_size = (900, 600) 
538  uf.wizard_apply_button = False 
539  uf.wizard_image = WIZARD_IMAGE_PATH + 'bmrb.png' 
540   
541   
542  # The bmrb.write user function. 
543  uf = uf_info.add_uf('bmrb.write') 
544  uf.title = "Write the results to a BMRB NMR-STAR formatted file." 
545  uf.title_short = "BMRB file writing." 
546  uf.add_keyarg( 
547      name = "file", 
548      arg_type = "file sel write", 
549      desc_short = "file name", 
550      desc = "The name of the BMRB file to output results to.  Optionally this can be a file object, or any object with a write() method.", 
551  ) 
552  uf.add_keyarg( 
553      name = "dir", 
554      default = "pipe_name", 
555      arg_type = "dir", 
556      desc_short = "directory name", 
557      desc = "The directory name.", 
558      can_be_none = True 
559  ) 
560  uf.add_keyarg( 
561      name = "version", 
562      default = "3.1", 
563      basic_types = ["str"], 
564      desc_short = "NMR-STAR dictionary version", 
565      desc = "The NMR-STAR dictionary format version to create.", 
566      wiz_element_type = "combo", 
567      wiz_combo_choices = [ 
568          "2.1", 
569          "3.0", 
570          "3.1" 
571      ], 
572      wiz_read_only = True 
573  ) 
574  uf.add_keyarg( 
575      name = "force", 
576      default = False, 
577      arg_type = "force flag", 
578      desc_short = "force flag", 
579      desc = "A flag which if True will cause the any pre-existing file to be overwritten." 
580  ) 
581  # Description. 
582  uf.desc.append(Desc_container()) 
583  uf.desc[-1].add_paragraph("This will create a NMR-STAR formatted file of the data in the current data pipe for BMRB deposition.") 
584  uf.desc[-1].add_paragraph("In the prompt/script UI modes, to place the BMRB file in the current working directory, set dir to None.  If dir is set to the special name 'pipe_name', then the results file will be placed into a directory with the same name as the current data pipe.") 
585  uf.backend = bmrb.write 
586  uf.menu_text = "&write" 
587  uf.gui_icon = "oxygen.actions.document-save" 
588  uf.wizard_height_desc = 300 
589  uf.wizard_size = (800, 600) 
590  uf.wizard_apply_button = False 
591  uf.wizard_image = WIZARD_IMAGE_PATH + 'bmrb.png' 
592