mailr5607 - /1.3/generic_fns/palmer.py


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

Header


Content

Posted by sebastien . morin . 1 on April 12, 2008 - 22:39:
Author: semor
Date: Sat Apr 12 22:39:33 2008
New Revision: 5607

URL: http://svn.gna.org/viewcvs/relax?rev=5607&view=rev
Log:
Corrected more of the bugs introduced in former revisions as part of the move 
to the new design.

These were spotted by Edward d'Auvergne in a post at:
https://mail.gna.org/public/relax-devel/2008-04/msg00056.html (# Message-id:
<1208030368.8064.47.camel@localhost>)


Modified:
    1.3/generic_fns/palmer.py

Modified: 1.3/generic_fns/palmer.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/generic_fns/palmer.py?rev=5607&r1=5606&r2=5607&view=diff
==============================================================================
--- 1.3/generic_fns/palmer.py (original)
+++ 1.3/generic_fns/palmer.py Sat Apr 12 22:39:33 2008
@@ -505,7 +505,7 @@
         chdir(orig_dir)
 
 
-    def extract(self, dir):
+    def extract(self, dir, spin_id=None):
         """Function for extracting the Modelfree4 results out of the 'mfout' 
file."""
 
         # Alias the current data pipe.
@@ -545,65 +545,63 @@
 
         # Loop over the sequence.
         pos = 0
-        for i in xrange(len(cdp.res)):
-            # Reassign the data structure.
-            data = cdp.res[i]
+        for spin in spin_loop(spin_id):
 
             # Skip unselected residues.
-            if not data.select:
+            if not spin.select:
                 continue
 
             # Missing data sets.
-            if not hasattr(data, 'model'):
+            if not hasattr(spin, 'model'):
                 continue
 
             # No relaxation data.
-            if not hasattr(data, 'num_frq'):
+            if not hasattr(spin, 'num_frq'):
                 continue
 
             # Get the S2 data.
-            if 'S2' in data.params:
-                data.s2, data.s2_err = self.get_mf_data(self.mfout_S2_pos + 
pos)
+            if 'S2' in spin.params:
+                spin.s2, spin.s2_err = self.get_mf_data(self.mfout_S2_pos + 
pos)
 
             # Get the S2f data.
-            if 'S2f' in data.params or 'S2s' in data.params:
-                data.s2f, data.s2f_err = self.get_mf_data(self.mfout_S2f_pos 
+ pos)
+            if 'S2f' in spin.params or 'S2s' in spin.params:
+                spin.s2f, spin.s2f_err = self.get_mf_data(self.mfout_S2f_pos 
+ pos)
 
             # Get the S2s data.
-            if 'S2f' in data.params or 'S2s' in data.params:
-                data.s2s, data.s2s_err = self.get_mf_data(self.mfout_S2s_pos 
+ pos)
+            if 'S2f' in spin.params or 'S2s' in spin.params:
+                spin.s2s, spin.s2s_err = self.get_mf_data(self.mfout_S2s_pos 
+ pos)
 
             # Get the te data.
-            if 'te' in data.params:
-                data.te, data.te_err = self.get_mf_data(self.mfout_te_pos + 
pos)
-                data.te = data.te / 1e12
-                data.te_err = data.te_err / 1e12
+            if 'te' in spin.params:
+                spin.te, spin.te_err = self.get_mf_data(self.mfout_te_pos + 
pos)
+                spin.te = spin.te / 1e12
+                spin.te_err = spin.te_err / 1e12
 
             # Get the ts data.
-            if 'ts' in data.params:
-                data.ts, data.ts_err = self.get_mf_data(self.mfout_te_pos + 
pos)
-                data.ts = data.ts / 1e12
-                data.ts_err = data.ts_err / 1e12
+            if 'ts' in spin.params:
+                spin.ts, spin.ts_err = self.get_mf_data(self.mfout_te_pos + 
pos)
+                spin.ts = spin.ts / 1e12
+                spin.ts_err = spin.ts_err / 1e12
 
             # Get the Rex data.
-            if 'Rex' in data.params:
-                data.rex, data.rex_err = self.get_mf_data(self.mfout_Rex_pos 
+ pos)
+            if 'Rex' in spin.params:
+                spin.rex, spin.rex_err = self.get_mf_data(self.mfout_Rex_pos 
+ pos)
                 try:
-                    data.rex = data.rex / (2.0 * pi * data.frq[0])**2
-                    data.rex_err = data.rex_err / (2.0 * pi * data.frq[0])**2
+                    spin.rex = spin.rex / (2.0 * pi * spin.frq[0])**2
+                    spin.rex_err = spin.rex_err / (2.0 * pi * spin.frq[0])**2
                 except TypeError:
                     # Bug in Modelfree4's mfout output file (fusion of 
columns).
-                    data.rex = None
-                    data_rex_err = None
+                    spin.rex = None
+                    spin_rex_err = None
 
             # Get the chi-squared data.
             if not sims:
                 row = split(self.mfout_lines[self.mfout_chi2_pos + pos])
-                data.chi2 = float(row[1])
+                spin.chi2 = float(row[1])
             else:
                 # The mfout chi2 position (with no sims) plus 2 (for the 
extra XML) plus the residue position times 22 (because of the simulated SSE 
rows).
                 row = split(self.mfout_lines[self.mfout_chi2_pos + 2 + 
22*pos])
-                data.chi2 = float(row[1])
+                spin.chi2 = float(row[1])
 
             # Increment the residue position.
             pos = pos + 1




Related Messages


Powered by MHonArc, Updated Sat Apr 12 23:20:17 2008