Package bmrblib :: Package kinetics :: Module heteronucl_NOEs_v3_2
[hide private]
[frames] | no frames]

Source Code for Module bmrblib.kinetics.heteronucl_NOEs_v3_2

  1  ############################################################################# 
  2  #                                                                           # 
  3  # The BMRB library.                                                         # 
  4  #                                                                           # 
  5  # Copyright (C) 2009 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 v3.2 Heteronuclear NOE data saveframe category. 
 24   
 25  See http://www.bmrb.wisc.edu/dictionary/3.2html/SaveFramePage.html#heteronucl_NOEs. 
 26  """ 
 27   
 28  # relax module imports. 
 29  from bmrblib.misc import translate 
 30  from bmrblib.kinetics.heteronucl_NOEs_v3_1 import HeteronuclNOESaveframe_v3_1, HeteronuclNOEList_v3_1, HeteronuclNOEExperiment_v3_1, HeteronuclNOESoftware_v3_1, HeteronuclNOE_v3_1 
 31  from bmrblib.pystarlib.TagTable import TagTable 
 32   
 33   
34 -class HeteronuclNOESaveframe_v3_2(HeteronuclNOESaveframe_v3_1):
35 """The v3.2 Heteronuclear NOE data saveframe class.""" 36
37 - def add(self, sample_cond_list_id=None, sample_cond_list_label='$conditions_1', temp_calibration=None, temp_control=None, peak_intensity_type=None, frq=None, details=None, assembly_atom_ids=None, entity_assembly_ids=None, entity_ids=None, res_nums=None, seq_id=None, res_names=None, atom_names=None, atom_types=None, isotope=None, assembly_atom_ids_2=None, entity_assembly_ids_2=None, entity_ids_2=None, res_nums_2=None, seq_id_2=None, res_names_2=None, atom_names_2=None, atom_types_2=None, isotope_2=None, data=None, errors=None):
38 """Add relaxation data to the data nodes. 39 40 @keyword sample_cond_list_id: The sample conditions list ID number. 41 @type sample_cond_list_id: str 42 @keyword sample_cond_list_label: The sample conditions list label. 43 @type sample_cond_list_label: str 44 @keyword temp_calibration: The temperature calibration method. 45 @type temp_calibration: str 46 @keyword temp_control: The temperature control method. 47 @type temp_control: str 48 @keyword peak_intensity_type: The peak intensity type - one of 'height' or 'volume'. 49 @type peak_intensity_type: str 50 @keyword frq: The spectrometer proton frequency, in Hz. 51 @type frq: float 52 @keyword details: The details tag. 53 @type details: None or str 54 @keyword assembly_atom_ids: The assembly atom ID numbers. 55 @type assembly_atom_ids: list of int 56 @keyword entity_assembly_ids: The entity assembly ID numbers. 57 @type entity_assembly_ids: list of int 58 @keyword entity_ids: The entity ID numbers. 59 @type entity_ids: int 60 @keyword res_nums: The residue number list. 61 @type res_nums: list of int 62 @keyword res_names: The residue name list. 63 @type res_names: list of str 64 @keyword atom_names: The atom name list. 65 @type atom_names: list of str 66 @keyword atom_types: The atom types as IUPAC element abbreviations. 67 @type atom_types: list of str 68 @keyword isotope: The isotope type list, ie 15 for '15N'. 69 @type isotope: list of int 70 @keyword assembly_atom_ids_2: The assembly atom ID numbers. This is for the second atom used in the heteronuclear NOE. 71 @type assembly_atom_ids_2: list of int 72 @keyword entity_assembly_ids_2: The entity assembly ID numbers. This is for the second atom used in the heteronuclear NOE. 73 @type entity_assembly_ids_2: list of int 74 @keyword entity_ids_2: The entity ID numbers. This is for the second atom used in the heteronuclear NOE. 75 @type entity_ids_2: int 76 @keyword res_nums_2: The residue number list. This is for the second atom used in the heteronuclear NOE. 77 @type res_nums_2: list of int 78 @keyword res_names_2: The residue name list. This is for the second atom used in the heteronuclear NOE. 79 @type res_names_2: list of str 80 @keyword atom_names_2: The atom name list. This is for the second atom used in the heteronuclear NOE. 81 @type atom_names_2: list of str 82 @keyword atom_types_2: The atom types as IUPAC element abbreviations. This is for the second atom used in the heteronuclear NOE. 83 @type atom_types_2: list of str 84 @keyword isotope_2: The isotope type list, ie 1 for '1H'. This is for the second atom used in the heteronuclear NOE. 85 @type isotope_2: list of int 86 @keyword data: The relaxation data. 87 @type data: list of float 88 @keyword errors: The errors associated with the relaxation data. 89 @type errors: list of float 90 """ 91 92 # Check the args. 93 if not temp_calibration: 94 raise NameError("The temperature calibration method has not been specified.") 95 if not temp_control: 96 raise NameError("The temperature control method has not been specified.") 97 if not peak_intensity_type: 98 raise NameError("The peak intensity type has not been specified.") 99 100 # Place the args into the namespace. 101 self.temp_calibration = translate(temp_calibration) 102 self.temp_control = translate(temp_control) 103 self.peak_intensity_type = translate(peak_intensity_type) 104 105 # Execute the v3.1 add method. 106 HeteronuclNOESaveframe_v3_1.add(self, 107 sample_cond_list_id=sample_cond_list_id, 108 sample_cond_list_label=sample_cond_list_label, 109 frq=frq, 110 details=details, 111 assembly_atom_ids=assembly_atom_ids, 112 entity_assembly_ids=entity_assembly_ids, 113 entity_ids=entity_ids, 114 res_nums=res_nums, 115 seq_id=seq_id, 116 res_names=res_names, 117 atom_names=atom_names, 118 atom_types=atom_types, 119 isotope=isotope, 120 assembly_atom_ids_2=assembly_atom_ids_2, 121 entity_assembly_ids_2=entity_assembly_ids_2, 122 entity_ids_2=entity_ids_2, 123 res_nums_2=res_nums_2, 124 seq_id_2=seq_id_2, 125 res_names_2=res_names_2, 126 atom_names_2=atom_names_2, 127 atom_types_2=atom_types_2, 128 isotope_2=isotope_2, 129 data=data, 130 errors=errors)
131 132
133 - def add_tag_categories(self):
134 """Create the v3.2 tag categories.""" 135 136 # The tag category objects. 137 self.heteronuclRxlist = HeteronuclNOEList_v3_2(self) 138 self.heteronuclRxexperiment = HeteronuclNOEExperiment_v3_1(self) 139 self.heteronuclRxsoftware = HeteronuclNOESoftware_v3_1(self) 140 self.Rx = HeteronuclNOE_v3_1(self)
141 142 143
144 -class HeteronuclNOEList_v3_2(HeteronuclNOEList_v3_1):
145 """v3.1 HeteronuclNOEList tag category.""" 146
147 - def create(self):
148 """Create the HeteronuclNOEList tag category.""" 149 150 # The save frame category. 151 self.sf.frame.tagtables.append(self.create_tag_table([['SfCategory', 'cat_name']], free=True)) 152 self.sf.frame.tagtables.append(TagTable(free=True, tagnames=[self.tag_names_full['SfFramecode']], tagvalues=[[self.sf.sf_label]])) 153 154 # NOE ID number. 155 if 'HeteronuclNOEListID' in self.tag_names: 156 self.sf.frame.tagtables.append(TagTable(free=True, tagnames=[self.tag_names_full['HeteronuclNOEListID']], tagvalues=[[str(self.sf.noe_inc)]])) 157 158 # Sample info. 159 self.sf.frame.tagtables.append(TagTable(free=True, tagnames=[self.tag_names_full['SampleConditionListID']], tagvalues=[[self.sf.sample_cond_list_id]])) 160 self.sf.frame.tagtables.append(TagTable(free=True, tagnames=[self.tag_names_full['SampleConditionListLabel']], tagvalues=[['$conditions_1']])) 161 162 # NMR info. 163 self.sf.frame.tagtables.append(TagTable(free=True, tagnames=[self.tag_names_full['TempCalibrationMethod']], tagvalues=[[self.sf.temp_calibration]])) 164 self.sf.frame.tagtables.append(TagTable(free=True, tagnames=[self.tag_names_full['TempControlMethod']], tagvalues=[[self.sf.temp_control]])) 165 self.sf.frame.tagtables.append(TagTable(free=True, tagnames=[self.tag_names_full['SpectrometerFrequency1H']], tagvalues=[[str(self.sf.frq/1e6)]])) 166 self.sf.frame.tagtables.append(TagTable(free=True, tagnames=[self.tag_names_full['HeteronuclearNOEValType']], tagvalues=[[self.sf.peak_intensity_type]])) 167 self.sf.frame.tagtables.append(TagTable(free=True, tagnames=[self.tag_names_full['Details']], tagvalues=[[self.sf.details]]))
168 169
170 - def tag_setup(self, tag_category_label=None, sep=None):
171 """Set up the tag names. 172 173 @keyword tag_category_label: The tag name prefix specific for the tag category. 174 @type tag_category_label: None or str 175 @keyword sep: The string separating the tag name prefix and suffix. 176 @type sep: str 177 """ 178 179 # Execute the base class tag_setup() method. 180 HeteronuclNOEList_v3_1.tag_setup(self, tag_category_label='Heteronucl_NOE_list', sep=sep) 181 182 # Tag names for the relaxation data. 183 self.tag_names['TempCalibrationMethod'] = 'Temp_calibration_method' 184 self.tag_names['TempControlMethod'] = 'Temp_control_method' 185 self.tag_names['HeteronuclearNOEValType'] = 'Heteronuclear_NOE_val_type'
186