Commit ad60c833 authored by Mikaël Salson's avatar Mikaël Salson

Fasta: operator<< can now output FASTQ

When the Sequence contains quality information, it outputs a FASTQ rather than a FASTA.
This may be useful is one day we output FASTQ information (we never know, isn't it?)
parent 49a71463
......@@ -245,7 +245,16 @@ ostream& operator<<(ostream& out, Fasta& fasta){
}
ostream &operator<<(ostream &out, const Sequence &seq) {
out << ">" << seq.label << endl;
bool is_fastq=false;
if (seq.quality.length() > 0) {
is_fastq = true;
out << "@";
} else
out << ">";
out << seq.label << endl;
out << seq.sequence << endl;
if (is_fastq) {
out << "+" << endl << seq.quality << endl;
}
return out;
}
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