Commit 0623dbf2 authored by Mathieu Giraud's avatar Mathieu Giraud

fasta.{cpp,h}: ignore lines beginning by '#', except for the quality line of .fastq

This is better than 13380ba7.
parent 6da0b270
......@@ -197,7 +197,7 @@ void OnlineFasta::next() {
} else {
unexpectedEOF();
}
line = getInterestingLine();
line = getInterestingLine(state);
}
if (state >= FASTX_FASTQ_ID && state < FASTX_FASTQ_QUAL)
......@@ -217,11 +217,14 @@ void OnlineFasta::next() {
unexpectedEOF();
}
string OnlineFasta::getInterestingLine() {
string OnlineFasta::getInterestingLine(int state) {
string line;
while (line.length() == 0 && hasNext() && getline(*input, line)) {
line_nb++;
remove_trailing_whitespaces(line);
if (line.length() && line[0] == '#' && state != FASTX_FASTQ_SEP)
line = "" ;
}
return line;
}
......
......@@ -147,7 +147,7 @@ class OnlineFasta {
* non-whitespace character.
* @return A non-empty string whose trailing whitespaces have been removed
*/
string getInterestingLine();
string getInterestingLine(int state = FASTX_UNINIT);
/**
* Called when we have an unexcepted EOF.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment