7 fastq::fastq(
void) : Seq(), quality(
std::string()), repeat_name(true) {}
9 fastq::fastq(
const std::string &name,
const std::string &seq,
10 const std::string &qual)
11 : Seq(name, seq), quality(qual), repeat_name(true)
15 fastq::fastq(std::string &&name, std::string &&seq, std::string &&qual)
16 : Seq(
std::move(name),
std::move(seq)), quality(
std::move(qual)),
21 fastq::fastq(
const Seq &s)
22 :
Seq(s.name, s.seq), quality(
std::string()), repeat_name(true)
27 :
Seq(
std::move(s)), quality(
std::string()), repeat_name(true)
40 if (stream.peek() == EOF)
42 if (
char(stream.peek()) !=
'@')
43 throw std::runtime_error(
"Sequence::fastq::read - error: record " 44 "did not begin with \'@\'");
46 stream.ignore(1,
'@');
47 std::getline(stream, name);
48 std::getline(stream, seq);
50 if (
char(stream.peek()) !=
'+')
51 throw std::runtime_error(
"Sequence::fastq::read - error: third " 52 "line did not begin with \'+\'");
53 stream >> temp >> std::ws;
56 quality.resize(seq.length());
57 stream.read(&quality[0], std::streamsize(seq.length()));
59 if (seq.length() != quality.length())
60 throw std::runtime_error(
"Sequence::fastq::read - error: sequence " 61 "and quality strings differ in length");
68 stream <<
'@' << name <<
'\n' << seq <<
'\n' <<
'+';
69 if (this->repeat_name)
73 stream <<
'\n' << quality;
std::ostream & print(std::ostream &s) const
void repname(const bool &)
Set to true or false for repeating the seq name on third line of output.
Abstract interface to sequence objects.
The namespace in which this library resides.
std::istream & read(std::istream &s)