Sascha Steinbiss pushed to branch upstream at Debian Med / tantan


Commits:
64a1f177 by Sascha Steinbiss at 2024-08-03T23:54:09+02:00
New upstream version 50
- - - - -


5 changed files:

- src/Makefile
- src/mcf_fasta_sequence.cc
- + test/semicolons.fa
- test/tantan_test.out
- test/tantan_test.sh


Changes:

=====================================
src/Makefile
=====================================
@@ -10,7 +10,7 @@ clean:
        rm -f ../bin/tantan
 
 VERSION1 = git describe --dirty
-VERSION2 = echo ' (HEAD -> main, tag: 49) ' | sed -e 's/.*tag: *//' -e 's/[,) 
].*//'
+VERSION2 = echo ' (HEAD -> main, tag: 50) ' | sed -e 's/.*tag: *//' -e 's/[,) 
].*//'
 
 VERSION = \"`test -e ../.git && $(VERSION1) || $(VERSION2)`\"
 


=====================================
src/mcf_fasta_sequence.cc
=====================================
@@ -6,6 +6,7 @@
 
 //#include <iostream>  // for debugging
 #include <istream>
+#include <limits>
 #include <ostream>
 #include <streambuf>
 
@@ -19,7 +20,14 @@ static void readSequence(std::istream &s, std::vector<uchar> 
&sequence,
   while (c != std::streambuf::traits_type::eof()) {
     if (c > ' ') {
       if (c == delimiter) break;
-      sequence.push_back(c);
+      if (c == ';') {  // allow for comment lines starting with ';'
+       do {
+         c = b->snextc();
+         if (c == std::streambuf::traits_type::eof()) return;
+       } while (c != '\n');
+      } else {
+       sequence.push_back(c);
+      }
     }
     c = b->snextc();
   }
@@ -40,8 +48,12 @@ static void readQualityCodes(std::istream &s, 
std::vector<uchar> &qualityCodes,
 }
 
 std::istream &operator>>(std::istream &s, FastaSequence &f) {
-  char firstChar = '>';
-  s >> firstChar;
+  char firstChar;
+  do {
+    firstChar = '>';
+    s >> firstChar;
+  } while (firstChar == ';' &&  // allow for comment lines starting with ';'
+          s.ignore(std::numeric_limits<std::streamsize>::max(), '\n'));
   if (firstChar != '>' && firstChar != '@') s.setstate(std::ios::failbit);
   if (!s) return s;
 


=====================================
test/semicolons.fa
=====================================
@@ -0,0 +1,14 @@
+; CLUSTER: A12
+; N=4
+>seq1
+ATTTCGCTGATTCGGAT
+>seq2
+ATATCCCTGATTCGGAT
+>seq3
+; del 11:13
+ATATCCCTGACGGATAA
+>seq4
+ACCCCCCTGATTCGGAT
+; CLUSTER: A13 
+>seq5
+AAAAAATCTTTCTTTCT


=====================================
test/tantan_test.out
=====================================
@@ -1535,3 +1535,14 @@ SRR019778.95     2       18      4       4       TGAT    
TGAT,TGAT,TGAT,TGAT
 SRR019778.95   22      45      4       5.75    ATAG    
ATAG,ATAG,ATAG,ATAG,ATAG,ATA
 
 hard   0       40      5       7.6     ATCAT   
CATCAT,CATCAT,CAT-AT,CATAT,CATAT,CATAT,CATAT,CAT
+
+>seq1
+ATTTCGCTGATTCGGAT
+>seq2
+ATATCCCTGATTCGGAT
+>seq3
+ATATCCCTGACGGATAA
+>seq4
+ACCCCCCTGATTCGGAT
+>seq5
+AAAAAATCTTTctttCT


=====================================
test/tantan_test.sh
=====================================
@@ -41,4 +41,6 @@ countLowercaseLetters () {
     tantan -f4 -b0 -j0 panda.fastq
     echo
     tantan -f4 -w7000 hard.fa
+    echo
+    tantan -r0.05 semicolons.fa
 } 2>&1 | diff -u tantan_test.out -



View it on GitLab: 
https://salsa.debian.org/med-team/tantan/-/commit/64a1f1772d553331bd1058f0591aada6795498d7

-- 
View it on GitLab: 
https://salsa.debian.org/med-team/tantan/-/commit/64a1f1772d553331bd1058f0591aada6795498d7
You're receiving this email because of your account on salsa.debian.org.


_______________________________________________
debian-med-commit mailing list
[email protected]
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/debian-med-commit

Reply via email to