58 auto& os = target->ostream();
59 for(
Sequence const& sequence : sequence_set ) {
67 os <<
"@" << seq.
label() <<
"\n";
70 if( line_length_ > 0 ) {
71 for(
size_t i = 0; i < seq.
length(); i += line_length_ ) {
74 os << seq.
sites().substr( i, line_length_ ) <<
"\n";
77 os << seq.
sites() <<
"\n";
82 os <<
"+" << seq.
label() <<
"\n";
95 if( line_length_ > 0 ) {
96 for(
size_t i = 0; i < scores.size(); i += line_length_ ) {
99 os << scores.substr( i, line_length_ ) <<
"\n";
102 os << scores <<
"\n";
109 if( fill_missing_quality_ == 255 ) {
110 throw std::runtime_error(
111 "Sequence without phred scores found. "
112 "Use FastqWriter::fill_missing_quality() to use dummy score values instead."
119 auto const dummy_str = std::string( seq.
sites().size(), dummy_chr );
120 assert( dummy_str.size() == seq.
sites().size() );
122 if( line_length_ > 0 ) {
123 for(
size_t i = 0; i < dummy_str.size(); i += line_length_ ) {
126 os << dummy_str.substr( i, line_length_ ) <<
"\n";
129 os << dummy_str <<
"\n";
135 throw std::runtime_error(
136 "Invalid Sequence with phred scores of different length than the sequence has sites."
147 line_length_ = value;
158 fill_missing_quality_ = value;
164 return fill_missing_quality_;
169 repeat_label_ = value;
175 return repeat_label_;