5 #ifndef BPP_SEQ_GENETICCODE_GENETICCODE_H
6 #define BPP_SEQ_GENETICCODE_GENETICCODE_H
10 #include "../Alphabet/AlphabetTools.h"
11 #include "../Alphabet/CodonAlphabet.h"
12 #include "../Alphabet/ProteicAlphabet.h"
13 #include "../Transliterator.h"
57 GeneticCode(std::shared_ptr<const NucleicAlphabet> alphabet) :
84 std::string
translate(
const std::string& state)
const override;
148 virtual bool isStop(
int state)
const = 0;
156 virtual bool isStop(
const std::string& state)
const = 0;
177 virtual bool isStart(
const std::string& state)
const
224 std::vector<std::string>
getSynonymous(
const std::string& aminoacid)
const;
Partial implementation of the Transliterator interface.
int translate(int state) const override=0
Translate a given state coded as a int from source alphabet to target alphabet.
Partial implementation of the Transliterator interface for genetic code object.
const Alphabet & targetAlphabet() const override
Get the target alphabet.
virtual bool isStop(const std::string &state) const =0
Tells is a particular codon is a stop codon.
bool isFourFoldDegenerated(int codon) const
bool areSynonymous(const std::string &i, const std::string &j) const
Tell if two codons are synonymous, that is, if they encode the same amino-acid.
std::unique_ptr< Sequence > getCodingSequence(const SequenceInterface &sequence, bool lookForInitCodon=false, bool includeInitCodon=false) const
Get the subsequence corresponding to the coding part of a given sequence.
virtual const CodonAlphabet & codonAlphabet() const
Alias for getSourceAlphabet return a pointer toward a CodonAlphabet.
std::vector< int > getSynonymous(int aminoacid) const
virtual bool isAltStart(int state) const =0
Tells is a particular codon is an alternative start codon.
std::unique_ptr< Sequence > translate(const SequenceInterface &sequence) const override
Translate a whole sequence from source alphabet to target alphabet.
virtual size_t getNumberOfStopCodons() const =0
virtual std::shared_ptr< const CodonAlphabet > getCodonAlphabet() const
Alias for getSourceAlphabet return a pointer toward a CodonAlphabet.
std::shared_ptr< const CodonAlphabet > codonAlphabet_
int translate(int state) const override
Translate a given state coded as a int from source alphabet to target alphabet.
virtual bool isStart(int state) const
Tells is a particular codon is a start codon.
std::shared_ptr< const Alphabet > getSourceAlphabet() const override
Get the source alphabet.
const Alphabet & sourceAlphabet() const override
Get the source alphabet.
virtual bool isAltStart(const std::string &state) const =0
Tells is a particular codon is an alternative start codon.
bool areSynonymous(int i, int j) const
Tell if two codons are synonymous, that is, if they encode the same amino-acid.
virtual const ProteicAlphabet & proteicAlphabet() const
Alias for getTargetAlphabet return a pointer toward a ProteicAlphabet.
std::map< int, int > tlnTable_
virtual std::vector< int > getStopCodonsAsInt() const =0
std::shared_ptr< const Alphabet > getTargetAlphabet() const override
Get the target alphabet.
std::shared_ptr< const ProteicAlphabet > proteicAlphabet_
virtual bool isStart(const std::string &state) const
Tells is a particular codon is a start codon.
virtual std::vector< std::string > getStopCodonsAsChar() const =0
virtual GeneticCode * clone() const override=0
virtual std::shared_ptr< const ProteicAlphabet > getProteicAlphabet() const
Alias for getTargetAlphabet return a pointer toward a ProteicAlphabet.
virtual bool isStop(int state) const =0
Tells is a particular codon is a stop codon.
GeneticCode(std::shared_ptr< const NucleicAlphabet > alphabet)
This alphabet is used to deal with proteins.
Exception thrown when a stop codon is found.
virtual ~StopCodonException()
virtual const std::string & getCodon() const
StopCodonException(const std::string &text, const std::string &codon)
This alphabet is used to deal NumericAlphabet.