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

Source Code for Module prompt.run

  1  ############################################################################### 
  2  #                                                                             # 
  3  # Copyright (C) 2004-2006 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  import sys 
 24   
 25  import help 
 26   
 27   
28 -class Run:
29 - def __init__(self, relax):
30 # Help. 31 self.__relax_help__ = \ 32 """Class for holding the functions for manipulating runs.""" 33 34 # Add the generic help string. 35 self.__relax_help__ = self.__relax_help__ + "\n" + help.relax_class_help 36 37 # Place relax in the class namespace. 38 self.__relax__ = relax
39 40
41 - def create(self, run=None, run_type=None):
42 """Function for setting up a run type. 43 44 Keyword Arguments 45 ~~~~~~~~~~~~~~~~~ 46 47 run: The name of the run. 48 49 type: The type of run. 50 51 52 Description 53 ~~~~~~~~~~~ 54 55 The run name can be any string however the run type can only be one of the following 56 57 'ct': Consistency tests. 58 'jw': Reduced spectral density mapping, 59 'mf': Model-free analysis, 60 'noe': Steady state NOE calculation, 61 'relax_fit': Relaxation curve fitting, 62 'srls': SRLS analysis. 63 64 65 Examples 66 ~~~~~~~~ 67 68 To set up a model-free analysis run with the name 'm5', type: 69 70 relax> run.create('m5', 'mf') 71 """ 72 73 # Function intro text. 74 if self.__relax__.interpreter.intro: 75 text = sys.ps3 + "run.create(" 76 text = text + "run=" + `run` 77 text = text + ", run_type=" + `run_type` + ")" 78 print text 79 80 # The name of the run. 81 if type(run) != str: 82 raise RelaxStrError, ('run', run) 83 84 # The run type. 85 if type(run_type) != str: 86 raise RelaxStrError, ('run_type', run_type) 87 88 # Execute the functional code. 89 self.__relax__.generic.runs.create(run=run, run_type=run_type)
90 91
92 - def delete(self, run=None):
93 """Function for deleting a run. 94 95 Keyword Arguments 96 ~~~~~~~~~~~~~~~~~ 97 98 run: The name of the run. 99 100 101 Description 102 ~~~~~~~~~~~ 103 104 This function will destroy all data corresponding to the given run. 105 """ 106 107 # Function intro text. 108 if self.__relax__.interpreter.intro: 109 text = sys.ps3 + "run.delete(" 110 text = text + "run=" + `run` + ")" 111 print text 112 113 # The run argument. 114 if run != None and type(run) != str: 115 raise RelaxNoneStrError, ('run', run) 116 117 # Execute the functional code. 118 self.__relax__.generic.runs.delete(run=run)
119 120
121 - def hybridise(self, hybrid=None, runs=None):
122 """Function for a hybridised run from a number of other runs. 123 124 Keyword Arguments 125 ~~~~~~~~~~~~~~~~~ 126 127 hybrid: The name of the hybrid run to create. 128 129 runs: An array containing the names of all runs to hybridise. 130 131 132 Description 133 ~~~~~~~~~~~ 134 135 This user function can be used to construct hybrid models. An example of the use of a 136 hybrid model could be if the protein consists of two independent domains. These two domains 137 could be analysed separately, each having their own optimised diffusion tensors. The 138 N-terminal domain run could be called 'N_sphere' while the C-terminal domain could be called 139 'C_ellipsoid'. These two runs could then be hybridised into a run called 'mixed model' by 140 typing 141 142 relax> run.hybridise('mixed model', ['N_sphere', 'C_ellipsoid']) 143 relax> run.hybridise(hybrid='mixed model', runs=['N_sphere', 'C_ellipsoid']) 144 145 This hybrid run can then be compared via model selection to a run where the entire protein 146 is assumed to have a single diffusion tensor. 147 148 The only requirements for runs to be hybridised is that, at minimum, a sequence has been 149 loaded, that the sequence for all hybridised runs is the same, and that no residue is 150 allowed to be selected in two or more runs. The last condition is to ensure that overlap 151 does not occur to allow statistically significant comparisons. 152 """ 153 154 # Function intro text. 155 if self.__relax__.interpreter.intro: 156 text = sys.ps3 + "run.hybridise(" 157 text = text + "hybrid=" + `hybrid` 158 text = text + ", runs=" + `runs` + ")" 159 print text 160 161 # The hybrid argument. 162 if hybrid != None and type(hybrid) != str: 163 raise RelaxNoneStrError, ('hybrid run', hybrid) 164 165 # Runs. 166 if type(runs) != list: 167 raise RelaxNoneListError, ('runs', runs) 168 else: 169 for name in runs: 170 if type(name) != str: 171 raise RelaxListStrError, ('runs', runs) 172 173 # Execute the functional code. 174 self.__relax__.specific.hybrid.hybridise(hybrid=hybrid, runs=runs)
175