mailRe: r21825 - /trunk/lib/spectrum/nmrpipe.py


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

Header


Content

Posted by Edward d'Auvergne on December 06, 2013 - 12:17:
Hi,

Here we should assume that if the second part of the assignment
contains no residue information, then it should take that information
from the first part.  This is how an assignment such as 'L61N-HN'
should be read.  So instead of a warning for the second dimension, the
values from the first dimension should be silently copied to the
second.  This would be a much nicer behaviour.

Regards,

Edward



On 6 December 2013 12:09,  <tlinnet@xxxxxxxxxxxxx> wrote:
Author: tlinnet
Date: Fri Dec  6 12:09:56 2013
New Revision: 21825

URL: http://svn.gna.org/viewcvs/relax?rev=21825&view=rev
Log:
Fixed for reading spins from a NMRPipe SeriesTab formatted file, where 
dimension 2 misses residue number and residue name.

Work in progress for Support Request #3044, 
(https://gna.org/support/index.php?3044) - Load spins from SPARKY list.

Modified:
    trunk/lib/spectrum/nmrpipe.py

Modified: trunk/lib/spectrum/nmrpipe.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/lib/spectrum/nmrpipe.py?rev=21825&r1=21824&r2=21825&view=diff
==============================================================================
--- trunk/lib/spectrum/nmrpipe.py (original)
+++ trunk/lib/spectrum/nmrpipe.py Fri Dec  6 12:09:56 2013
@@ -109,25 +109,32 @@
         row2 = re.split('([a-zA-Z]+)', assign2)
         name2 = row2[-2] + row2[-1]

-        # Get the residue number.
+        # Get the residue number for dimension 1.
         try:
             res_num1 = int(row1[-3])
+        except:
+            raise RelaxError("Improperly formatted NMRPipe SeriesTab file, 
cannot process the residue number for dimension 1 in assignment: %s." % 
line[0])
+
+        # Get the residue number for dimension 2.
+        try:
             res_num2 = int(row2[-3])
         except:
-            raise RelaxError("Improperly formatted NMRPipe SeriesTab file, 
cannot process the assignment '%s'." % line[0])
+            # We cannot always expect dimension 2 to have residue number.
+            warn(RelaxWarning("Improperly formatted NMRPipe SeriesTab 
file, cannot process the residue number for dimension 2 in assignment: %s. 
Setting residue number to None." % line[0]))
+            res_num2 = None

         # The residue name for dimension 1.
         try:
             res_name1 = row1[-4]
         except:
-            warn(RelaxWarning("Improperly formatted NMRPipe SeriesTab 
file, cannot process the assignment '%s' for residue name dimension 1. 
Setting residue name to None." % line[0]))
+            warn(RelaxWarning("Improperly formatted NMRPipe SeriesTab 
file, cannot process the residue name for dimension 1 in assignment: %s." % 
line[0]))
             res_name1 = None

         # The residue name for dimension 2.
         try:
             res_name2 = row2[-4]
         except:
-            raise warn(RelaxWarning("Improperly formatted NMRPipe 
SeriesTab file, cannot process the assignment '%s' for residue name 
dimension 2.\nSetting residue name to None." % line[0]))
+            warn(RelaxWarning("Improperly formatted NMRPipe SeriesTab 
file, cannot process the residue name for dimension 2 in assignment: %s. 
Setting residue name to None." % line[0]))
             res_name2 = None

         # Get the intensities.


_______________________________________________
relax (http://www.nmr-relax.com)

This is the relax-commits mailing list
relax-commits@xxxxxxx

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits



Related Messages


Powered by MHonArc, Updated Sat Dec 07 12:40:11 2013