46 if (sequence.getAlphabet()->getAlphabetType() != getSourceAlphabet()->getAlphabetType())
48 Sequence* tSeq =
new BasicSequence(sequence.getName(),
"", sequence.getComments(), getTargetAlphabet());
50 for (
unsigned int i = 0; i < sequence.size(); ++i)
52 int state = sequence.getValue(i);
63 if (sequence.getAlphabet()->getAlphabetType() != getTargetAlphabet()->getAlphabetType())
65 Sequence* rSeq =
new BasicSequence(sequence.getName(),
"", sequence.getComments(), getSourceAlphabet());
66 for (
unsigned int i = 0; i < sequence.size(); ++i)
68 rSeq->
addElement(reverse(sequence.getValue(i)));
virtual int reverse(int state) const =0
Translate a given state coded as a int from target alphabet to source alphabet.
This alphabet is used to deal NumericAlphabet.
virtual int getGapCharacterCode() const =0
virtual void addElement(const std::string &c)=0
Add a character to the end of the list.
A basic implementation of the Sequence interface.
virtual int translate(int state) const =0
Translate a given state coded as a int from source alphabet to target alphabet.
virtual const Alphabet * getAlphabet() const
Get the alphabet associated to the list.
Exception thrown when two alphabets do not match.