Package prompt :: Module noe
[hide private]
[frames] | no frames]

Source Code for Module prompt.noe

  1  ############################################################################### 
  2  #                                                                             # 
  3  # Copyright (C) 2004-2011 Edward d'Auvergne                                   # 
  4  #                                                                             # 
  5  # This file is part of the program relax.                                     # 
  6  #                                                                             # 
  7  # relax 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 2 of the License, or           # 
 10  # (at your option) any later version.                                         # 
 11  #                                                                             # 
 12  # relax 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 relax; if not, write to the Free Software                        # 
 19  # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA   # 
 20  #                                                                             # 
 21  ############################################################################### 
 22   
 23  # Module docstring. 
 24  """Module containing the 'noe' user function class.""" 
 25  __docformat__ = 'plaintext' 
 26   
 27  # relax module imports. 
 28  from base_class import User_fn_class, _build_doc 
 29  import arg_check 
 30  from generic_fns import noesy 
 31  from specific_fns.setup import noe_obj 
 32   
 33   
34 -class Noe(User_fn_class):
35 """Class for handling steady-state NOE and NOESY data.""" 36
37 - def read_restraints(self, file=None, dir=None, proton1_col=None, proton2_col=None, lower_col=None, upper_col=None, sep=None):
38 # Function intro text. 39 if self._exec_info.intro: 40 text = self._exec_info.ps3 + "noe.read_restraints(" 41 text = text + "file=" + repr(file) 42 text = text + ", dir=" + repr(dir) 43 text = text + ", proton1_col=" + repr(proton1_col) 44 text = text + ", proton2_col=" + repr(proton2_col) 45 text = text + ", lower_col=" + repr(lower_col) 46 text = text + ", upper_col=" + repr(upper_col) 47 text = text + ", sep=" + repr(sep) + ")" 48 print(text) 49 50 # The argument checks. 51 arg_check.is_str(file, 'file name') 52 arg_check.is_str(dir, 'directory name', can_be_none=True) 53 arg_check.is_int(proton1_col, 'first proton column', can_be_none=True) 54 arg_check.is_int(proton2_col, 'second proton column', can_be_none=True) 55 arg_check.is_int(lower_col, 'lower bound column', can_be_none=True) 56 arg_check.is_int(upper_col, 'upper bound column', can_be_none=True) 57 arg_check.is_str(sep, 'column separator', can_be_none=True) 58 59 # Execute the functional code. 60 noesy.read_restraints(file=file, dir=dir, proton1_col=proton1_col, proton2_col=proton2_col, lower_col=lower_col, upper_col=upper_col, sep=sep)
61 62 # The function doc info. 63 read_restraints._doc_title = "Read NOESY or ROESY restraints from a file." 64 read_restraints._doc_title_short = "Restraint reading." 65 read_restraints._doc_args = [ 66 ["file", "The name of the file containing the restraint data."], 67 ["dir", "The directory where the file is located."], 68 ["proton1_col", "The column containing the first proton of the NOE or ROE cross peak."], 69 ["proton2_col", "The column containing the second proton of the NOE or ROE cross peak."], 70 ["lower_col", "The column containing the lower NOE bound."], 71 ["upper_col", "The column containing the upper NOE bound."], 72 ["sep", "The column separator (the default is white space)."] 73 ] 74 read_restraints._doc_desc = """ 75 The format of the file will be automatically determined, for example Xplor formatted restraint files. A generically formatted file is also supported if it contains minimally four columns with the two proton names and the upper and lower bounds, as specified by the column numbers. The proton names need to be in the spin ID string format. 76 """ 77 read_restraints._doc_examples = """ 78 To read the Xplor formatted restraint file 'NOE.xpl', type one of: 79 80 relax> noe.read_restraints('NOE.xpl') 81 relax> noe.read_restraints(file='NOE.xpl') 82 83 84 To read the generic formatted file 'noes', type one of: 85 86 relax> noe.read_restraints(file='NOE.xpl', proton1_col=0, proton2_col=1, lower_col=2, upper_col=3) 87 """ 88 _build_doc(read_restraints) 89 90
91 - def spectrum_type(self, spectrum_type=None, spectrum_id=None):
92 # Function intro text. 93 if self._exec_info.intro: 94 text = self._exec_info.ps3 + "noe.spectrum_type(" 95 text = text + "spectrum_type=" + repr(spectrum_type) 96 text = text + ", spectrum_id=" + repr(spectrum_id) + ")" 97 print(text) 98 99 # The argument checks. 100 arg_check.is_str(spectrum_type, 'spectrum type') 101 arg_check.is_str(spectrum_id, 'spectrum ID string') 102 103 # Execute the functional code. 104 noe_obj._spectrum_type(spectrum_type=spectrum_type, spectrum_id=spectrum_id)
105 106 # The function doc info. 107 spectrum_type._doc_title = "Set the steady-state NOE spectrum type for pre-loaded peak intensities." 108 spectrum_type._doc_title_short = "Steady-state NOE spectrum type." 109 spectrum_type._doc_args = [ 110 ["spectrum_type", "The type of steady-state NOE spectrum, one of 'ref' for the reference spectrum or 'sat' for the saturated spectrum."], 111 ["spectrum_id", "The spectrum ID string."] 112 ] 113 spectrum_type._doc_desc = """ 114 The spectrum type can be one of the following: 115 116 The steady-state NOE reference spectrum. 117 The steady-state NOE spectrum with proton saturation turned on. 118 119 Peak intensities should be loaded before this user function via the spectrum.read_intensities user function. The intensity values will then be associated with a spectrum ID string which can be used here. 120 """ 121 _build_doc(spectrum_type)
122