48 if (input && ! input.eof()) {
52 getline(input, buffer);
58 if (buffer[0] ==
'@') {
59 seq.
setName(std::string(buffer.begin() + 1, buffer.end()));
62 getline(input, buffer);
65 getline(input, buffer);
67 std::string secName = std::string(buffer.begin() + 1, buffer.end());
69 throw Exception(
"Names are not equivalent for sequence(@ line) and quality (+ line)");
73 getline(input, buffer);
76 for (
size_t i = 0 ; i < buffer.size() ; i++) {
90 std::string qual(seq.
size(),
static_cast<char>(33));
93 for (
size_t i = 0 ; i < sq.
size() ; i++) {
95 if (q < 33 || q > 126) {
100 }
catch (
const std::bad_cast& e) {
101 throw Exception(
"seq must be a SequenceWithQuality object");
103 output <<
"@" << seq.
getName() << std::endl;
104 output << seq.
toString() << std::endl;
110 output << qual << std::endl;
virtual std::string toString() const=0
virtual size_t size() const=0
void writeSequence(std::ostream &output, const Sequence &seq) const
bool nextSequence(std::istream &input, Sequence &seq) const
void setQuality(size_t pos, int quality)
int getQuality(size_t pos) const
virtual void setContent(const std::string &sequence)=0
virtual void setName(const std::string &name)=0
virtual const std::string & getName() const=0
bool isEmpty(const std::string &s)