[Debichem-commits] [SCM] massXpert mass spectrometry suite: debian packaging branch, debian, updated. upstream/3.2.0-1-g5564507

Filippo Rusconi (Debian Maintainer) rusconi-debian at laposte.net
Thu Nov 24 21:27:30 UTC 2011


The following commit has been merged in the debian branch:
commit b49ae28dd261f1bfc857edfefa4112cec248c5c6
Author: Filippo Rusconi (Debian Maintainer) <rusconi-debian at laposte.net>
Date:   Sat Nov 21 20:02:33 2009 +0100

    Fixed bug with failed parsing of cleavage specifications...
    which have multicharacter codes involved in their definition if the
    number of characters was less than the max authorized code length.

diff --git a/lib/sequence.cpp b/lib/sequence.cpp
index 9c138dd..254a62a 100644
--- a/lib/sequence.cpp
+++ b/lib/sequence.cpp
@@ -421,6 +421,14 @@ namespace massXpert
       {
 	if(iter >= codeLength)
 	  {
+	    // Because we have progressed farther than authorized by
+	    // the number of characters allowed in the monomer codes
+	    // of this polymer chemistry definition, we decrement iter
+	    // and break the loop... Later in this function, we'll set
+	    // the proper index in the sequence where next parsing run
+	    // should occurs (the calling function will increment
+	    // *index by one).
+
 	    --iter;
 	    break;
 	  }
@@ -432,14 +440,23 @@ namespace massXpert
       
 	if(!curChar.isLetter())
 	  {
-	    // 	  qDebug() << __FILE__ << __LINE__
-	    //                  << "The character is not a letter:"
-	    // 		    << curChar;
-	  
-	    --iter;
+// 	    qDebug() << __FILE__ << __LINE__
+// 		     << "The character is not a letter:"
+// 		     << curChar;
 	  
 	    *err = curChar;
-	  
+
+	    // The non-Letter character might be '/', which would be
+	    // perfectly fine, as we use it to symbolize the actual
+	    // cleavage site. Which means that we will continue
+	    // parsing the rest of the string : we have to give the
+	    // current position back to the caller in the *index
+	    // variable for the next call to this function to start at
+	    // next character (not falling back to '/', which would
+	    // make us enter in an infinite loop).
+
+	    *index = *index + iter;
+
 	    return -1;
 	  }
       
@@ -449,9 +466,10 @@ namespace massXpert
 	  {
 	    if (isLower)
 	      {
-// 		qDebug() << "First character of monomer code might not be"
-// 			  << "lower case; sequence is"
-// 			  << m_monomerText.toAscii();
+		qDebug() << __FILE__ << __LINE__ 
+			 << "First character of monomer code might not be"
+			 << "lower case; sequence is"
+			 << m_monomerText.toAscii();
 		
 		*err = curChar;
 	      

-- 
massXpert mass spectrometry suite: debian packaging



More information about the Debichem-commits mailing list