mailr9810 - in /branches/bmrb/bmrblib/kinetics: heteronucl_T1_relaxation.py heteronucl_T2_relaxation.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on October 27, 2009 - 16:42:
Author: bugman
Date: Tue Oct 27 16:42:02 2009
New Revision: 9810

URL: http://svn.gna.org/viewcvs/relax?rev=9810&view=rev
Log:
Updated the v3.1 and earlier T1 and T2 saveframes for all the new info.


Modified:
    branches/bmrb/bmrblib/kinetics/heteronucl_T1_relaxation.py
    branches/bmrb/bmrblib/kinetics/heteronucl_T2_relaxation.py

Modified: branches/bmrb/bmrblib/kinetics/heteronucl_T1_relaxation.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/bmrb/bmrblib/kinetics/heteronucl_T1_relaxation.py?rev=9810&r1=9809&r2=9810&view=diff
==============================================================================
--- branches/bmrb/bmrblib/kinetics/heteronucl_T1_relaxation.py (original)
+++ branches/bmrb/bmrblib/kinetics/heteronucl_T1_relaxation.py Tue Oct 27 
16:42:02 2009
@@ -58,41 +58,69 @@
         self.add_tag_categories()
 
 
-    def add(self, frq=None, res_nums=None, res_names=None, atom_names=None, 
isotope=None, data=None, errors=None):
+    def add(self, sample_cond_list_id=None, 
sample_cond_list_label='$conditions_1', 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, data=None, errors=None):
         """Add relaxation data to the data nodes.
 
-        @keyword frq:           The spectrometer proton frequency, in Hz.
-        @type frq:              float
-        @keyword res_nums:      The residue number list.
-        @type res_nums:         list of int
-        @keyword res_names:     The residue name list.
-        @type res_names:        list of str
-        @keyword atom_names:    The atom name list.
-        @type atom_names:       list of str
-        @keyword isotope:       The isotope type list, ie 15 for '15N'.
-        @type isotope:          list of int
-        @keyword data:          The relaxation data.
-        @type data:             list of float
-        @keyword errors:        The errors associated with the relaxation 
data.
-        @type errors:           list of float
+        @keyword sample_cond_list_id:       The sample conditions list ID 
number.
+        @type sample_cond_list_id:          str
+        @keyword sample_cond_list_label:    The sample conditions list label.
+        @type sample_cond_list_label:       str
+        @keyword frq:                       The spectrometer proton 
frequency, in Hz.
+        @type frq:                          float
+        @keyword details:                   The details tag.
+        @type details:                      None or str
+        @keyword assembly_atom_ids:         The assembly atom ID numbers.
+        @type assembly_atom_ids:            list of int
+        @keyword entity_assembly_ids:       The entity assembly ID numbers.
+        @type entity_assembly_ids:          list of int
+        @keyword entity_ids:                The entity ID numbers.
+        @type entity_ids:                   int
+        @keyword res_nums:                  The residue number list.
+        @type res_nums:                     list of int
+        @keyword res_names:                 The residue name list.
+        @type res_names:                    list of str
+        @keyword atom_names:                The atom name list.
+        @type atom_names:                   list of str
+        @keyword atom_types:                The atom types as IUPAC element 
abbreviations.
+        @type atom_types:                   list of str
+        @keyword isotope:                   The isotope type list, ie 15 for 
'15N'.
+        @type isotope:                      list of int
+        @keyword data:                      The relaxation data.
+        @type data:                         list of float
+        @keyword errors:                    The errors associated with the 
relaxation data.
+        @type errors:                       list of float
         """
 
         # Check the ID info.
-        no_missing(res_nums, 'residue numbers of the ' + repr(int(frq*1e-6)) 
+ ' MHz NOE data')
-        no_missing(res_names, 'residue names of the ' + repr(int(frq*1e-6)) 
+ ' MHz NOE data')
-        no_missing(atom_names, 'atom names of the ' + repr(int(frq*1e-6)) + 
' MHz NOE data')
+        no_missing(entity_ids, 'entity ID numbers of the ' + 
repr(int(frq*1e-6)) + ' MHz R1 data')
+        no_missing(res_nums, 'residue numbers of the ' + repr(int(frq*1e-6)) 
+ ' MHz R1 data')
+        no_missing(res_names, 'residue names of the ' + repr(int(frq*1e-6)) 
+ ' MHz R1 data')
+        no_missing(atom_names, 'atom names of the ' + repr(int(frq*1e-6)) + 
' MHz R1 data')
 
         # The number of elements.
         self.N = len(res_nums)
 
         # Place the args into the namespace.
+        self.sample_cond_list_id = translate(sample_cond_list_id)
+        self.sample_cond_list_label = translate(sample_cond_list_label)
         self.frq = frq
-        self.res_nums = translate(res_nums)
-        self.res_names = translate(res_names)
-        self.atom_names = translate(atom_names)
-        self.isotope = translate(isotope)
-        self.data = translate(data)
-        self.errors = translate(errors)
+        self.details = translate(details)
+
+        # Convert to lists and check the lengths.
+        for name in ['assembly_atom_ids', 'entity_assembly_ids', 
'entity_ids', 'res_nums', 'seq_id', 'res_names', 'atom_names', 'atom_types', 
'isotope', 'data', 'errors']:
+            # Get the object.
+            obj = locals()[name]
+
+            # None objects.
+            if obj == None:
+                obj = [None] * self.N
+
+            # Check the length.
+            if len(obj) != self.N:
+                raise NameError("The number of elements in the '%s' arg does 
not match that of 'res_nums'." % name)
+
+            # Place the args into the namespace, translating for BMRB.
+            setattr(self, name, translate(obj))
 
         # Set up the R1 specific variables.
         self.r1_inc = self.r1_inc + 1
@@ -139,12 +167,14 @@
             self.sf.frame.tagtables.append(TagTable(free=True, 
tagnames=[self.tag_names_full['HeteronuclT1ListID']], 
tagvalues=[[str(self.sf.r1_inc)]]))
 
         # Sample info.
+        self.sf.frame.tagtables.append(TagTable(free=True, 
tagnames=[self.tag_names_full['SampleConditionListID']], 
tagvalues=[[self.sf.sample_cond_list_id]]))
         self.sf.frame.tagtables.append(TagTable(free=True, 
tagnames=[self.tag_names_full['SampleConditionListLabel']], 
tagvalues=[['$conditions_1']]))
 
         # NMR info.
         self.sf.frame.tagtables.append(TagTable(free=True, 
tagnames=[self.tag_names_full['SpectrometerFrequency1H']], 
tagvalues=[[str(self.sf.frq/1e6)]]))
         self.sf.frame.tagtables.append(TagTable(free=True, 
tagnames=[self.tag_names_full['T1CoherenceType']], 
tagvalues=[[self.variables['coherence']]]))
         self.sf.frame.tagtables.append(TagTable(free=True, 
tagnames=[self.tag_names_full['T1ValUnits']], tagvalues=[['1/s']]))
+        self.sf.frame.tagtables.append(TagTable(free=True, 
tagnames=[self.tag_names_full['Details']], tagvalues=[[self.sf.details]]))
 
 
     def tag_setup(self, tag_category_label=None, sep=None):
@@ -161,10 +191,12 @@
 
         # Tag names for the relaxation data.
         self.tag_names['SfCategory'] = 'Saveframe_category'
+        self.tag_names['SampleConditionListID'] = 'Sample_condition_list_ID'
         self.tag_names['SampleConditionListLabel'] = 
'Sample_conditions_label'
         self.tag_names['SpectrometerFrequency1H'] = 
'Spectrometer_frequency_1H'
         self.tag_names['T1CoherenceType'] = 'T1_coherence_type'
         self.tag_names['T1ValUnits'] = 'T1_value_units'
+        self.tag_names['Details'] = 'Details'
 
         # Class variables.
         self.variables['coherence'] = 'Nz'

Modified: branches/bmrb/bmrblib/kinetics/heteronucl_T2_relaxation.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/bmrb/bmrblib/kinetics/heteronucl_T2_relaxation.py?rev=9810&r1=9809&r2=9810&view=diff
==============================================================================
--- branches/bmrb/bmrblib/kinetics/heteronucl_T2_relaxation.py (original)
+++ branches/bmrb/bmrblib/kinetics/heteronucl_T2_relaxation.py Tue Oct 27 
16:42:02 2009
@@ -58,41 +58,69 @@
         self.add_tag_categories()
 
 
-    def add(self, frq=None, res_nums=None, res_names=None, atom_names=None, 
isotope=None, data=None, errors=None):
+    def add(self, sample_cond_list_id=None, 
sample_cond_list_label='$conditions_1', 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, data=None, errors=None):
         """Add relaxation data to the data nodes.
 
-        @keyword frq:           The spectrometer proton frequency, in Hz.
-        @type frq:              float
-        @keyword res_nums:      The residue number list.
-        @type res_nums:         list of int
-        @keyword res_names:     The residue name list.
-        @type res_names:        list of str
-        @keyword atom_names:    The atom name list.
-        @type atom_names:       list of str
-        @keyword isotope:       The isotope type list, ie 15 for '15N'.
-        @type isotope:          list of int
-        @keyword data:          The relaxation data.
-        @type data:             list of float
-        @keyword errors:        The errors associated with the relaxation 
data.
-        @type errors:           list of float
+        @keyword sample_cond_list_id:       The sample conditions list ID 
number.
+        @type sample_cond_list_id:          str
+        @keyword sample_cond_list_label:    The sample conditions list label.
+        @type sample_cond_list_label:       str
+        @keyword frq:                       The spectrometer proton 
frequency, in Hz.
+        @type frq:                          float
+        @keyword details:                   The details tag.
+        @type details:                      None or str
+        @keyword assembly_atom_ids:         The assembly atom ID numbers.
+        @type assembly_atom_ids:            list of int
+        @keyword entity_assembly_ids:       The entity assembly ID numbers.
+        @type entity_assembly_ids:          list of int
+        @keyword entity_ids:                The entity ID numbers.
+        @type entity_ids:                   int
+        @keyword res_nums:                  The residue number list.
+        @type res_nums:                     list of int
+        @keyword res_names:                 The residue name list.
+        @type res_names:                    list of str
+        @keyword atom_names:                The atom name list.
+        @type atom_names:                   list of str
+        @keyword atom_types:                The atom types as IUPAC element 
abbreviations.
+        @type atom_types:                   list of str
+        @keyword isotope:                   The isotope type list, ie 15 for 
'15N'.
+        @type isotope:                      list of int
+        @keyword data:                      The relaxation data.
+        @type data:                         list of float
+        @keyword errors:                    The errors associated with the 
relaxation data.
+        @type errors:                       list of float
         """
 
         # Check the ID info.
-        no_missing(res_nums, 'residue numbers of the ' + repr(int(frq*1e-6)) 
+ ' MHz NOE data')
-        no_missing(res_names, 'residue names of the ' + repr(int(frq*1e-6)) 
+ ' MHz NOE data')
-        no_missing(atom_names, 'atom names of the ' + repr(int(frq*1e-6)) + 
' MHz NOE data')
+        no_missing(entity_ids, 'entity ID numbers of the ' + 
repr(int(frq*1e-6)) + ' MHz R2 data')
+        no_missing(res_nums, 'residue numbers of the ' + repr(int(frq*1e-6)) 
+ ' MHz R2 data')
+        no_missing(res_names, 'residue names of the ' + repr(int(frq*1e-6)) 
+ ' MHz R2 data')
+        no_missing(atom_names, 'atom names of the ' + repr(int(frq*1e-6)) + 
' MHz R2 data')
 
         # The number of elements.
         self.N = len(res_nums)
 
         # Place the args into the namespace.
+        self.sample_cond_list_id = translate(sample_cond_list_id)
+        self.sample_cond_list_label = translate(sample_cond_list_label)
         self.frq = frq
-        self.res_nums = translate(res_nums)
-        self.res_names = translate(res_names)
-        self.atom_names = translate(atom_names)
-        self.isotope = translate(isotope)
-        self.data = translate(data)
-        self.errors = translate(errors)
+        self.details = translate(details)
+
+        # Convert to lists and check the lengths.
+        for name in ['assembly_atom_ids', 'entity_assembly_ids', 
'entity_ids', 'res_nums', 'seq_id', 'res_names', 'atom_names', 'atom_types', 
'isotope', 'data', 'errors']:
+            # Get the object.
+            obj = locals()[name]
+
+            # None objects.
+            if obj == None:
+                obj = [None] * self.N
+
+            # Check the length.
+            if len(obj) != self.N:
+                raise NameError("The number of elements in the '%s' arg does 
not match that of 'res_nums'." % name)
+
+            # Place the args into the namespace, translating for BMRB.
+            setattr(self, name, translate(obj))
 
         # Set up the R2 specific variables.
         self.r2_inc = self.r2_inc + 1
@@ -141,12 +169,14 @@
             self.sf.frame.tagtables.append(TagTable(free=True, 
tagnames=[self.tag_names_full['HeteronuclT2ListID']], 
tagvalues=[[str(self.sf.r2_inc)]]))
 
         # Sample info.
+        self.sf.frame.tagtables.append(TagTable(free=True, 
tagnames=[self.tag_names_full['SampleConditionListID']], 
tagvalues=[[self.sf.sample_cond_list_id]]))
         self.sf.frame.tagtables.append(TagTable(free=True, 
tagnames=[self.tag_names_full['SampleConditionListLabel']], 
tagvalues=[['$conditions_1']]))
 
         # NMR info.
         self.sf.frame.tagtables.append(TagTable(free=True, 
tagnames=[self.tag_names_full['SpectrometerFrequency1H']], 
tagvalues=[[str(self.sf.frq/1e6)]]))
         self.sf.frame.tagtables.append(TagTable(free=True, 
tagnames=[self.tag_names_full['T2CoherenceType']], 
tagvalues=[[self.variables['coherence']]]))
         self.sf.frame.tagtables.append(TagTable(free=True, 
tagnames=[self.tag_names_full['T2ValUnits']], tagvalues=[['1/s']]))
+        self.sf.frame.tagtables.append(TagTable(free=True, 
tagnames=[self.tag_names_full['Details']], tagvalues=[[self.sf.details]]))
 
 
     def tag_setup(self, tag_category_label=None, sep=None):
@@ -163,10 +193,12 @@
 
         # Tag names for the relaxation data.
         self.tag_names['SfCategory'] = 'Saveframe_category'
+        self.tag_names['SampleConditionListID'] = 'Sample_condition_list_ID'
         self.tag_names['SampleConditionListLabel'] = 
'Sample_conditions_label'
         self.tag_names['SpectrometerFrequency1H'] = 
'Spectrometer_frequency_1H'
         self.tag_names['T2CoherenceType'] = 'T2_coherence_type'
         self.tag_names['T2ValUnits'] = 'T2_value_units'
+        self.tag_names['Details'] = 'Details'
 
         # Class variables.
         self.variables['coherence'] = 'Ny'




Related Messages


Powered by MHonArc, Updated Tue Oct 27 17:00:02 2009