Package bmrblib :: Package assembly_supercategory :: Module entity
[hide private]
[frames] | no frames]

Source Code for Module bmrblib.assembly_supercategory.entity

  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 entity saveframe category. 
 24   
 25  For example, see http://www.bmrb.wisc.edu/dictionary/3.1html/SaveFramePage.html#entity. 
 26  """ 
 27   
 28  # relax module imports. 
 29  from bmrblib.base_classes import BaseSaveframe, TagCategory, TagCategoryFree 
 30   
 31   
32 -class EntitySaveframe(BaseSaveframe):
33 """The entity saveframe class.""" 34 35 # Class variables. 36 label = 'entity' 37 sf_label = 'entity' 38
39 - def add_tag_categories(self):
40 """Create the tag categories.""" 41 42 # The tag category objects. 43 self.tag_categories.append(Entity(self)) 44 self.tag_categories.append(EntityCompIndex(self))
45 46 47
48 -class Entity(TagCategoryFree):
49 """Base class for the Entity tag category.""" 50
51 - def __init__(self, sf):
52 """Setup the Entity tag category. 53 54 @param sf: The saveframe object. 55 @type sf: saveframe instance 56 """ 57 58 # Initialise the baseclass. 59 super(Entity, self).__init__(sf) 60 61 # Add the tag info. 62 self.add(key='EntityID', var_name='count_str', format='int') 63 self.add(key='BMRBCode', var_name='bmrb_code', format='str') 64 self.add(key='Name', var_name='mol_name', format='str') 65 self.add(key='Type', var_name='mol_type', format='str') 66 self.add(key='PolymerCommonType', var_name='polymer_common_type', format='str') 67 self.add(key='PolymerType', var_name='polymer_type', format='str', allowed=['DNA/RNA hybrid', 'polydeoxyribonucleotide', 'polypeptide(D)', 'polypeptide(L)', 'polyribonucleotide', 'polysaccharide(D)', 'polysaccharide(L)']) 68 self.add(key='PolymerTypeDetails', var_name='polymer_type_details', format='str') 69 self.add(key='PolymerStrandID', var_name='polymer_strand_id', format='str') 70 self.add(key='PolymerSeqOneLetterCodeCan', var_name='polymer_seq_one_letter_code_can', format='str') 71 self.add(key='PolymerSeqOneLetterCode', var_name='polymer_seq_one_letter_code', format='str') 72 self.add(key='TargetIdentifier', var_name='target_identifier', format='str') 73 self.add(key='PolymerAuthorDefinedSeq', var_name='polymer_author_defined_seq', format='str') 74 self.add(key='PolymerAuthorSeqDetails', var_name='polymer_author_seq_details', format='str') 75 self.add(key='AmbiguousConformationalStates', var_name='ambiguous_conformational_states', format='str') 76 self.add(key='AmbiguousChemCompSites', var_name='ambiguous_chem_comp_sites', format='str') 77 self.add(key='NstdMonomer', var_name='nstd_monomer', format='str') 78 self.add(key='NstdChirality', var_name='nstd_chirality', format='str') 79 self.add(key='NstdLinkage', var_name='nstd_linkage', format='str') 80 self.add(key='NonpolymerCompID', var_name='nonpolymer_comp_id', format='str') 81 self.add(key='NonpolymerCompLabel', var_name='nonpolymer_comp_label', format='str') 82 self.add(key='NumberOfMonomers', var_name='number_of_monomers', format='int') 83 self.add(key='NumberOfNonpolymerComponents', var_name='number_of_nonpolymer_components', format='int') 84 self.add(key='Paramagnetic', var_name='paramagnetic', format='str') 85 self.add(key='ThiolState', var_name='thiol_state', format='str') 86 self.add(key='SrcMethod', var_name='src_method', format='str') 87 self.add(key='ParentEntityID', var_name='parent_entity_id', format='int') 88 self.add(key='Fragment', var_name='fragment', format='str') 89 self.add(key='Mutation', var_name='mutation', format='str') 90 self.add(key='ECNumber', var_name='ec_number', format='str') 91 self.add(key='CalcIsoelectricPoint', var_name='calc_isoelectric_point', format='float') 92 self.add(key='FormulaWeight', var_name='molecular_weight', format='float') 93 self.add(key='FormulaWeightExptl', var_name='molecular_weight_exptl', format='float') 94 self.add(key='FormulaWeightExptlMeth', var_name='molecular_weight_exptl_meth', format='str') 95 self.add(key='Details', var_name='details', format='str') 96 self.add(key='DBQueryDate', var_name='db_query_date', format='str') 97 self.add(key='DBQueryRevisedLastDate', var_name='db_query_revised_last_date', format='str')
98 99 100
101 -class EntityCompIndex(TagCategory):
102 """Base class for the EntityCompIndex tag category.""" 103
104 - def __init__(self, sf):
105 """Setup the Entity tag category. 106 107 @param sf: The saveframe object. 108 @type sf: saveframe instance 109 """ 110 111 # Initialise the baseclass. 112 super(EntityCompIndex, self).__init__(sf) 113 114 # Add the tag info. 115 self.add(key='EntityCompIndexID', var_name='res_nums', format='int') 116 self.add(key='AuthSeqID', var_name='seq_nums', format='str') 117 self.add(key='CompID', var_name='res_names', format='str') 118 self.add(key='CompLabel', var_name='chem_comp', format='str') 119 self.add(key='EntityID', var_name='count_str', format='int')
120