Package bmrblib :: Package thermodynamics :: Module model_free
[hide private]
[frames] | no frames]

Source Code for Module bmrblib.thermodynamics.model_free

  1  ############################################################################# 
  2  #                                                                           # 
  3  # The BMRB library.                                                         # 
  4  #                                                                           # 
  5  # Copyright (C) 2009-2010 Edward d'Auvergne                                 # 
  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 model_free saveframe category (used to be called order_parameters). 
 24   
 25  For example, see http://www.bmrb.wisc.edu/dictionary/3.1html_frame/frame_SaveFramePage.html#order_parameters 
 26  """ 
 27   
 28  # relax module imports. 
 29  from bmrblib.base_classes import BaseSaveframe, TagCategory, TagCategoryFree 
 30   
 31   
32 -class ModelFreeSaveframe(BaseSaveframe):
33 """The Order parameters saveframe class.""" 34 35 # Class variables. 36 sf_label = 'S2_parameters' 37
38 - def add_tag_categories(self):
39 """Create the tag categories.""" 40 41 # The tag category objects. 42 self.tag_categories.append(ModelFreeList(self)) 43 self.tag_categories.append(ModelFreeExperiment(self)) 44 self.tag_categories.append(ModelFreeSoftware(self)) 45 self.tag_categories.append(ModelFree(self))
46 47
48 -class ModelFreeList(TagCategoryFree):
49 """Base class for the ModelFreeList tag category.""" 50
51 - def __init__(self, sf):
52 """Setup the ModelFreeList tag category. 53 54 @param sf: The saveframe object. 55 @type sf: saveframe instance 56 """ 57 58 # Initialise the baseclass. 59 super(ModelFreeList, self).__init__(sf) 60 61 # Add the tag info. 62 self.add(key='ModelFreeListID', tag_name='id', var_name='count_str', format='int') 63 self.add(key='SampleConditionListID', tag_name='Sample_condition_list_ID', var_name='sample_cond_list_id') 64 self.add(key='SampleConditionListLabel', tag_name='Sample_conditions_label', var_name='sample_cond_list_label', default='$conditions_1') 65 self.add(key='TaueValUnits', tag_name='Tau_e_value_units', var_name='te_units', default='s') 66 self.add(key='TaufValUnits', tag_name='Tau_f_value_units', var_name='tf_units', default='s') 67 self.add(key='TausValUnits', tag_name='Tau_s_value_units', var_name='ts_units', default='s') 68 self.add(key='GlobalChiSquaredFitVal', tag_name='Global_chi_squared_fit_val', var_name='global_chi2', format='float') 69 self.add(key='Details', tag_name='Details', var_name='details')
70 71 72
73 -class ModelFreeExperiment(TagCategory):
74 """Base class for the ModelFreeExperiment tag category.""" 75
76 - def __init__(self, sf):
77 """Setup the ModelFreeExperiment tag category. 78 79 @param sf: The saveframe object. 80 @type sf: saveframe instance 81 """ 82 83 # Initialise the baseclass. 84 super(ModelFreeExperiment, self).__init__(sf) 85 86 # Add the tag info. 87 self.add(key='SampleLabel', tag_name='Sample_label', var_name='sample_label', default='$sample_1')
88 89 90
91 -class ModelFreeSoftware(TagCategory):
92 """Base class for the ModelFreeSoftware tag category.""" 93 94 # The category name. 95 tag_category_label = 'Model_free_software' 96
97 - def __init__(self, sf):
98 """Setup the ModelFreeSoftware tag category. 99 100 @param sf: The saveframe object. 101 @type sf: saveframe instance 102 """ 103 104 # Initialise the baseclass. 105 super(ModelFreeSoftware, self).__init__(sf) 106 107 # Add the tag info. 108 self.add(key='SoftwareID', tag_name='Software_ID', var_name='software_ids') 109 self.add(key='SoftwareLabel', tag_name='Software_label', var_name='software_labels') 110 self.add(key='ModelFreeListID', tag_name='Model_free_list_ID', var_name='count_str', format='int')
111 112 113
114 -class ModelFree(TagCategory):
115 """Base class for the ModelFree tag category.""" 116
117 - def __init__(self, sf):
118 """Setup the ModelFree tag category. 119 120 @param sf: The saveframe object. 121 @type sf: saveframe instance 122 """ 123 124 # Initialise the baseclass. 125 super(ModelFree, self).__init__(sf) 126 127 # The list of allowed model-free models. 128 allowed_models = ['', 129 'Rex', 130 'S2', 131 'S2, te', 132 'S2, Rex', 133 'S2, te, Rex', 134 'S2f, S2, ts', 135 'S2f, S2s, ts', 136 'S2f, tf, S2, ts', 137 'S2f, tf, S2s, ts', 138 'S2f, S2, ts, Rex', 139 'S2f, S2s, ts, Rex', 140 'S2f, tf, S2, ts, Rex', 141 'S2f, tf, S2s, ts, Rex' 142 'tm', 143 'tm, Rex', 144 'tm, S2', 145 'tm, S2, te', 146 'tm, S2, Rex', 147 'tm, S2, te, Rex', 148 'tm, S2f, S2, ts', 149 'tm, S2f, S2s, ts', 150 'tm, S2f, tf, S2, ts', 151 'tm, S2f, tf, S2s, ts', 152 'tm, S2f, S2, ts, Rex', 153 'tm, S2f, S2s, ts, Rex', 154 'tm, S2f, tf, S2, ts, Rex', 155 'tm, S2f, tf, S2s, ts, Rex' 156 ] 157 158 # Add the tag info. 159 self.add(key='ModelFreeID', tag_name='id', var_name='data_ids', format='int') 160 self.add(key='AssemblyAtomID', tag_name='Assembly_atom_ID', var_name='assembly_atom_ids') 161 self.add(key='EntityAssemblyID', tag_name='Entity_assembly_ID', var_name='entity_assembly_ids') 162 self.add(key='EntityID', tag_name='Entity_ID', var_name='entity_ids', format='int', missing=False) 163 self.add(key='CompIndexID', tag_name='Residue_seq_code', var_name='res_nums', format='int', missing=False) 164 self.add(key='CompID', tag_name='Residue_label', var_name='res_names', missing=False) 165 self.add(key='AtomID', tag_name='Atom_name', var_name='atom_names', missing=False) 166 self.add(key='AtomType', tag_name='Atom_type', var_name='atom_types') 167 self.add(key='AtomIsotopeNumber', tag_name='Atom_isotope_number', var_name='isotope', format='int') 168 self.add(key='BondLengthVal', tag_name=None, var_name=None, format='float') 169 self.add(key='S2Val', tag_name='S2_value', var_name='s2', format='float') 170 self.add(key='S2ValErr', tag_name='S2_value_fit_error', var_name='s2_err', format='float') 171 self.add(key='S2fVal', tag_name='S2f_value', var_name='s2f', format='float') 172 self.add(key='S2fValErr', tag_name='S2f_value_fit_error', var_name='s2f_err', format='float') 173 self.add(key='S2sVal', tag_name='S2s_value', var_name='s2s', format='float') 174 self.add(key='S2sValErr', tag_name='S2s_value_fit_error', var_name='s2s_err', format='float') 175 self.add(key='LocalTauCVal', tag_name=None, var_name=None, format='float') 176 self.add(key='LocalTauCValErr', tag_name=None, var_name=None, format='float') 177 self.add(key='TauEVal', tag_name='Tau_e_value', var_name='te', format='float') 178 self.add(key='TauEValErr', tag_name='Tau_e_value_fit_error', var_name='te_err', format='float') 179 self.add(key='TauFVal', tag_name='Tau_f_value', var_name='tf', format='float') 180 self.add(key='TauFValErr', tag_name='Tau_f_value_fit_error', var_name='tf_err', format='float') 181 self.add(key='TauSVal', tag_name='Tau_s_value', var_name='ts', format='float') 182 self.add(key='TauSValErr', tag_name='Tau_s_value_fit_error', var_name='ts_err', format='float') 183 self.add(key='RexVal', tag_name='Rex_value', var_name='rex', format='float') 184 self.add(key='RexValErr', tag_name='Rex_error', var_name='rex_err', format='float') 185 self.add(key='ChiSquaredVal', tag_name='SSE_val', var_name='chi2', format='float') 186 self.add(key='ModelFit', tag_name='Model_fit', var_name='model_fit', allowed=allowed_models)
187