26 throw Exception (
"SequenceTools::concatenate : Sequence's names don't match");
34 sequence.insert(sequence.end(), sequence2.begin(), sequence2.end());
35 qualities.insert(qualities.end(), qualities2.begin(), qualities2.end());
37 return make_unique<SequenceWithQuality>(seqwq1.
getName(), sequence, qualities, seqwq1.
getComments(), alphaPtr);
47 if (sequence.
getAlphabet()->getAlphabetType() ==
"DNA alphabet")
51 else if (sequence.
getAlphabet()->getAlphabetType() ==
"RNA alphabet")
60 auto seqwq = make_unique<SequenceWithQuality>(*seq, sequence.
getQualities());
70 if (sequence.
getAlphabet()->getAlphabetType() !=
"DNA alphabet")
74 auto seq = transc_.translate(sequence);
75 auto seqwq = make_unique<SequenceWithQuality>(*seq, sequence.
getQualities());
85 if (sequence.
getAlphabet()->getAlphabetType() !=
"RNA alphabet")
90 auto seq = transc_.reverse(sequence);
93 auto seqwq = make_unique<SequenceWithQuality>(*seq, scores);
104 auto iSeq = unique_ptr<SequenceWithQuality>(sequence.
clone());
105 iSeq->setContent(iContent);
106 iSeq->setQualities(iQualities);
116 vector<int> qualities;
118 for (
size_t i = 0; i < seq.
size(); ++i)
120 if (!alpha->isGap(seq[i]))
122 content.push_back(seq[i]);
126 auto newSeq = unique_ptr<SequenceWithQuality>(seq.
clone());
127 newSeq->setContent(content);
128 newSeq->setQualities(qualities);
const std::string & getName() const override
Get the name of this sequence.
The alphabet exception base class.
Exception thrown when two alphabets do not match.
virtual std::shared_ptr< const Alphabet > getAlphabet() const =0
Get the alphabet associated to the list.
virtual size_t size() const =0
Get the number of elements in the list.
Replication between to nucleic acids.
int translate(int state) const override
Translate a given state coded as a int from source alphabet to target alphabet.
A SequenceWithAnnotation class with quality scores attached.
SequenceWithQuality * clone() const override
const std::vector< int > & getQualities() const
Get the whole quality scores.
virtual const std::vector< T > & getContent() const =0
This alphabet is used to deal NumericAlphabet.