mailr9868 - in /branches/bmrb: data/exp_info.py generic_fns/relax_data.py test_suite/system_tests/scripts/bmrb_rw.py


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

Header


Content

Posted by edward on November 05, 2009 - 13:23:
Author: bugman
Date: Thu Nov  5 13:23:26 2009
New Revision: 9868

URL: http://svn.gna.org/viewcvs/relax?rev=9868&view=rev
Log:
The relax_data.peak_intensity_type() user function is now fully operational.

The BMRB system test has been repaired for the user function argument name 
change.


Modified:
    branches/bmrb/data/exp_info.py
    branches/bmrb/generic_fns/relax_data.py
    branches/bmrb/test_suite/system_tests/scripts/bmrb_rw.py

Modified: branches/bmrb/data/exp_info.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/bmrb/data/exp_info.py?rev=9868&r1=9867&r2=9868&view=diff
==============================================================================
--- branches/bmrb/data/exp_info.py (original)
+++ branches/bmrb/data/exp_info.py Thu Nov  5 13:23:26 2009
@@ -169,6 +169,51 @@
                 return self.temp_control[i].method
 
 
+    def setup_peak_intensity_type(self, ri_label, frq_label, type):
+        """Store the peak intensity type.
+
+        @param ri_label:    The relaxation data type, ie 'R1', 'R2', or 
'NOE'.
+        @type ri_label:     str
+        @param frq_label:   The field strength label.
+        @type frq_label:    str
+        @param type:        The peak intensity type, one of 'height' or 
'volume'.
+        @type type:         str
+        """
+
+        # Initialise the container if needed.
+        if not hasattr(self, "peak_intensity_type"):
+            # The list.
+            self.peak_intensity_type = ContainerList()
+
+            # The name of the container.
+            self.peak_intensity_type.container_name = 
"peak_intensity_type_list"
+
+            # The description of the container.
+            self.peak_intensity_type.container_desc = "List of peak 
intensity types."
+
+        # Find if the type has already been set.
+        for i in range(len(self.peak_intensity_type)):
+            if self.peak_intensity_type[i].ri_label == ri_label and 
self.peak_intensity_type[i].frq_label == frq_label:
+                raise RelaxError("The peak intensity type for the '%s' 
ri_label and '%s' frq_label has already been set.")
+
+        # Init the container.
+        peak_intensity_type = Element()
+
+        # The name of the container.
+        peak_intensity_type.element_name = "peak_intensity_type"
+
+        # The description of the container.
+        peak_intensity_type.element_desc = "Temperature control methods for 
the relaxation data."
+
+        # Set the attributes.
+        peak_intensity_type.ri_label = ri_label
+        peak_intensity_type.frq_label = frq_label
+        peak_intensity_type.type = type
+
+        # Append the container.
+        self.peak_intensity_type.append(peak_intensity_type)
+
+
     def setup_thiol(self, state):
         """Set up the thiol state of the system.
 

Modified: branches/bmrb/generic_fns/relax_data.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/bmrb/generic_fns/relax_data.py?rev=9868&r1=9867&r2=9868&view=diff
==============================================================================
--- branches/bmrb/generic_fns/relax_data.py (original)
+++ branches/bmrb/generic_fns/relax_data.py Thu Nov  5 13:23:26 2009
@@ -767,6 +767,41 @@
 
         # Update all data structures.
         update_data_structures_spin(spin, ri_label, frq_label, frq, 
values[i], errors[i])
+
+
+def peak_intensity_type(ri_label=None, frq_label=None, type=None):
+    """Set the type of intensity measured for the peaks.
+
+    @param ri_label:    The relaxation data type, ie 'R1', 'R2', or 'NOE'.
+    @type ri_label:     str
+    @param frq_label:   The field strength label.
+    @type frq_label:    str
+    @param type:        The peak intensity type, one of 'height' or 'volume'.
+    @type type:         str
+    """
+
+    # Test if the current pipe exists.
+    pipes.test()
+
+    # Test if sequence data is loaded.
+    if not exists_mol_res_spin_data():
+        raise RelaxNoSequenceError
+
+    # Test if relaxation data corresponding to 'ri_label' and 'frq_label' 
already exists.
+    if not test_labels(ri_label, frq_label):
+        raise RelaxNoRiError(ri_label, frq_label)
+
+    # Check the values, and warn if not in the list.
+    valid = ['height', 'volume']
+    if type not in valid:
+        raise RelaxError("The '%s' peak intensity type is unknown.  Please 
select one of %s." % (type, valid))
+
+    # Set up the experimental info data container, if needed.
+    if not hasattr(cdp, 'exp_info'):
+        cdp.exp_info = ExpInfo()
+
+    # Store the type.
+    cdp.exp_info.setup_peak_intensity_type(ri_label, frq_label, type)
 
 
 def read(ri_label=None, frq_label=None, frq=None, file=None, dir=None, 
file_data=None, spin_id_col=None, mol_name_col=None, res_num_col=None, 
res_name_col=None, spin_num_col=None, spin_name_col=None, data_col=None, 
error_col=None, sep=None, spin_id=None):

Modified: branches/bmrb/test_suite/system_tests/scripts/bmrb_rw.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/bmrb/test_suite/system_tests/scripts/bmrb_rw.py?rev=9868&r1=9867&r2=9868&view=diff
==============================================================================
--- branches/bmrb/test_suite/system_tests/scripts/bmrb_rw.py (original)
+++ branches/bmrb/test_suite/system_tests/scripts/bmrb_rw.py Thu Nov  5 
13:23:26 2009
@@ -43,7 +43,7 @@
 for i in range(6):
     relax_data.temp_calibration(ri_label=ri_labels[i], 
frq_label=frq_labels[i], method='methanol')
     relax_data.temp_control(ri_label=ri_labels[i], frq_label=frq_labels[i], 
method='single fid interleaving')
-    relax_data.peak_intensity_type(ri_label=ri_labels[i], 
frq_label=frq_labels[i], intensity='height')
+    relax_data.peak_intensity_type(ri_label=ri_labels[i], 
frq_label=frq_labels[i], type='height')
 
 # Set up some BMRB information.
 bmrb.software_select('NMRPipe')




Related Messages


Powered by MHonArc, Updated Thu Nov 05 14:00:02 2009