Package bmrblib :: Package NMR_parameters :: Module chem_shift_anisotropy
[hide private]
[frames] | no frames]

Source Code for Module bmrblib.NMR_parameters.chem_shift_anisotropy

  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 chemical shift anisotropy data saveframe category. 
 24   
 25  For example, see http://www.bmrb.wisc.edu/dictionary/3.1html_frame/frame_SaveFramePage.html#chem_shift_anisotropy 
 26  """ 
 27   
 28  # relax module imports. 
 29  from bmrblib.base_classes import BaseSaveframe, TagCategory, TagCategoryFree 
 30   
 31   
32 -class ChemShiftAnisotropySaveframe(BaseSaveframe):
33 """The chemical shift anisotropy data saveframe class.""" 34 35 # Class variables. 36 sf_label = 'chem_shift_anisotropy' 37
38 - def add_tag_categories(self):
39 """Create the tag categories.""" 40 41 # The tag category objects. 42 self.tag_categories.append(ChemShiftAnisotropy(self)) 43 self.tag_categories.append(CSAnisotropyExperiment(self)) 44 self.tag_categories.append(CSAnisotropySoftware(self)) 45 self.tag_categories.append(CSAnisotropy(self))
46 47 48
49 -class ChemShiftAnisotropy(TagCategoryFree):
50 """Base class for the ChemShiftAnisotropy tag category.""" 51
52 - def __init__(self, sf):
53 """Setup the ChemShiftAnisotropy tag category. 54 55 @param sf: The saveframe object. 56 @type sf: saveframe instance 57 """ 58 59 # Initialise the baseclass. 60 super(ChemShiftAnisotropy, self).__init__(sf) 61 62 # Add the tag info. 63 self.add(key='ChemShiftAnisotropyID', tag_name='ID', var_name='count_str', format='int') 64 self.add(key='DataFileName', tag_name='Data_file_name', var_name='file_name') 65 self.add(key='SampleConditionListLabel', tag_name='Sample_conditions_label', var_name='sample_cond_list_label', default='$conditions_1') 66 self.add(key='ValUnits', tag_name='Val_units', var_name='units', default='ppm')
67 68 69
70 -class CSAnisotropyExperiment(TagCategory):
71 """Base class for the CSAnisotropyExperiment tag category.""" 72
73 - def __init__(self, sf):
74 """Setup the CSAnisotropyExperiment tag category. 75 76 @param sf: The saveframe object. 77 @type sf: saveframe instance 78 """ 79 80 # Initialise the baseclass. 81 super(CSAnisotropyExperiment, self).__init__(sf) 82 83 # Add the tag info. 84 self.add(key='SampleLabel', tag_name='Sample_label', var_name='sample_label', default='$sample_1')
85 86 87
88 -class CSAnisotropySoftware(TagCategory):
89 """Base class for the CSAnisotropySoftware tag category."""
90 91 92
93 -class CSAnisotropy(TagCategory):
94 """Base class for the CSAnisotropy tag category.""" 95
96 - def __init__(self, sf):
97 """Setup the CSAnisotropy tag category. 98 99 @param sf: The saveframe object. 100 @type sf: saveframe instance 101 """ 102 103 # Initialise the baseclass. 104 super(CSAnisotropy, self).__init__(sf) 105 106 # Add the tag info. 107 self.add(key='CSAnisotropyID', tag_name='ID', var_name='data_ids', format='int') 108 self.add(key='AssemblyAtomID', tag_name='Assembly_atom_ID', var_name='assembly_atom_ids') 109 self.add(key='EntityAssemblyID', tag_name='Entity_assembly_ID', var_name='entity_assembly_ids') 110 self.add(key='EntityID', tag_name='Entity_ID', var_name='entity_ids', format='int') 111 self.add(key='CompIndexID', tag_name='Residue_seq_code', var_name='res_nums', format='int') 112 self.add(key='SeqID', tag_name='Seq_ID', var_name='seq_id') 113 self.add(key='CompID', tag_name='Residue_label', var_name='res_names') 114 self.add(key='AtomID', tag_name='Atom_name', var_name='atom_names') 115 self.add(key='AtomType', tag_name='Atom_type', var_name='atom_types') 116 self.add(key='AtomIsotopeNumber', tag_name='Atom_isotope_number', var_name='isotope', format='int') 117 self.add(key='Val', tag_name='value', var_name='csa', format='float') 118 self.add(key='ValErr', tag_name='value_error', var_name='csa_error', format='float') 119 self.add(key='ChemShiftAnisotropyID', tag_name='Chem_shift_anisotropy_ID', var_name='count_str')
120