Skip to content

Commit

Permalink
update parser for new jellyfish
Browse files Browse the repository at this point in the history
  • Loading branch information
rob-p committed Sep 26, 2015
1 parent 64db891 commit 660fb04
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions include/PairSequenceParser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ class pair_sequence_parser : public jellyfish::cooperative_pool2<pair_sequence_p
if(type1 == DONE_TYPE || type2 == DONE_TYPE)
return open_next_files(st);
if(type1 != type2)
eraise(std::runtime_error) << "Paired files are of different format";
throw std::runtime_error("Paired files are of different format");
if(type1 == ERROR_TYPE || type2 == ERROR_TYPE)
eraise(std::runtime_error) << "Unsupported format";
throw std::runtime_error("Unsupported format");
st.type = type1;
}

Expand Down Expand Up @@ -165,17 +165,17 @@ class pair_sequence_parser : public jellyfish::cooperative_pool2<pair_sequence_p
hsq.seq.append(tmp); // two lines avoiding copying
}
if(!is.good())
eraise(std::runtime_error) << "Truncated fastq file";
std::runtime_error("Truncated fastq file");
is.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
hsq.qual.clear();
while(hsq.qual.size() < hsq.seq.size() && is.good()) {
std::getline(is, tmp);
hsq.qual.append(tmp);
}
if(hsq.qual.size() != hsq.seq.size())
eraise(std::runtime_error) << "Invalid fastq file: wrong number of quals";
throw std::runtime_error("Invalid fastq file: wrong number of quals");
if(is.peek() != EOF && is.peek() != '@')
eraise(std::runtime_error) << "Invalid fastq file: header missing";
throw std::runtime_error("Invalid fastq file: header missing");

}

Expand Down

0 comments on commit 660fb04

Please sign in to comment.