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