Skip to content

Commit

Permalink
Include full header lines with FASTA/FASTQ output
Browse files Browse the repository at this point in the history
  • Loading branch information
DerrickWood committed Dec 14, 2014
1 parent 7730317 commit 86c9cc3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/classify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,13 +254,13 @@ void classify_sequence(DNASequence &dna, ostringstream &koss,
bool print = call ? Print_classified : Print_unclassified;
if (print) {
if (Fastq_input) {
(*oss_ptr) << "@" << dna.id << endl
(*oss_ptr) << "@" << dna.header_line << endl
<< dna.seq << endl
<< "+" << endl
<< dna.quals << endl;
}
else {
(*oss_ptr) << ">" << dna.id << endl
(*oss_ptr) << ">" << dna.header_line << endl
<< dna.seq << endl;
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/seqreader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ namespace kraken {
valid = false;
return dna;
}
istringstream seq_id(line.substr(1));
dna.header_line = line.substr(1);
istringstream seq_id(dna.header_line);
seq_id >> dna.id;

ostringstream seq_ss;
Expand Down Expand Up @@ -111,7 +112,8 @@ namespace kraken {
valid = false;
return dna;
}
istringstream line_ss(line.substr(1));
dna.header_line = line.substr(1);
istringstream line_ss(dna.header_line);

line_ss >> dna.id;
getline(file, dna.seq);
Expand Down
1 change: 1 addition & 0 deletions src/seqreader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
namespace kraken {
typedef struct {
std::string id;
std::string header_line; // id + optional description
std::string seq;
std::string quals;
} DNASequence;
Expand Down

0 comments on commit 86c9cc3

Please sign in to comment.