bpp-seq3
3.0.0
|
This class implements the standard genetic code as describe on the NCBI web site: http://www.ncbi.nlm.nih.gov/Taxonomy/Utils/wprintgc.cgi?mode=t#SG1. More...
#include <Bpp/Seq/GeneticCode/StandardGeneticCode.h>
Public Member Functions | |
StandardGeneticCode (std::shared_ptr< const NucleicAlphabet > alphabet) | |
virtual | ~StandardGeneticCode () |
virtual StandardGeneticCode * | clone () const |
size_t | getNumberOfStopCodons () const |
std::vector< int > | getStopCodonsAsInt () const |
std::vector< std::string > | getStopCodonsAsChar () const |
bool | isStop (int state) const |
Tells is a particular codon is a stop codon. More... | |
bool | isStop (const std::string &state) const |
Tells is a particular codon is a stop codon. More... | |
bool | isAltStart (int state) const |
Tells is a particular codon is an alternative start codon. More... | |
bool | isAltStart (const std::string &state) const |
Tells is a particular codon is an alternative start codon. More... | |
Methods form the Transliterator interface. | |
std::shared_ptr< const Alphabet > | getSourceAlphabet () const override |
Get the source alphabet. More... | |
const Alphabet & | sourceAlphabet () const override |
Get the source alphabet. More... | |
std::shared_ptr< const Alphabet > | getTargetAlphabet () const override |
Get the target alphabet. More... | |
const Alphabet & | targetAlphabet () const override |
Get the target alphabet. More... | |
int | translate (int state) const override |
Translate a given state coded as a int from source alphabet to target alphabet. More... | |
std::string | translate (const std::string &state) const override |
Translate a given state coded as a string from source alphabet to target alphabet. More... | |
std::unique_ptr< Sequence > | translate (const SequenceInterface &sequence) const override |
Translate a whole sequence from source alphabet to target alphabet. More... | |
Specific methods. | |
virtual std::shared_ptr< const CodonAlphabet > | getCodonAlphabet () const |
Alias for getSourceAlphabet return a pointer toward a CodonAlphabet. More... | |
virtual const CodonAlphabet & | codonAlphabet () const |
Alias for getSourceAlphabet return a pointer toward a CodonAlphabet. More... | |
virtual std::shared_ptr< const ProteicAlphabet > | getProteicAlphabet () const |
Alias for getTargetAlphabet return a pointer toward a ProteicAlphabet. More... | |
virtual const ProteicAlphabet & | proteicAlphabet () const |
Alias for getTargetAlphabet return a pointer toward a ProteicAlphabet. More... | |
virtual bool | isStart (int state) const |
Tells is a particular codon is a start codon. More... | |
virtual bool | isStart (const std::string &state) const |
Tells is a particular codon is a start codon. More... | |
bool | areSynonymous (int i, int j) const |
Tell if two codons are synonymous, that is, if they encode the same amino-acid. More... | |
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. More... | |
std::vector< int > | getSynonymous (int aminoacid) const |
std::vector< std::string > | getSynonymous (const std::string &aminoacid) const |
bool | isFourFoldDegenerated (int codon) const |
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. More... | |
Protected Attributes | |
std::shared_ptr< const CodonAlphabet > | codonAlphabet_ |
std::shared_ptr< const ProteicAlphabet > | proteicAlphabet_ |
std::map< int, int > | tlnTable_ |
Private Member Functions | |
void | init_ () |
This class implements the standard genetic code as describe on the NCBI web site: http://www.ncbi.nlm.nih.gov/Taxonomy/Utils/wprintgc.cgi?mode=t#SG1.
Definition at line 18 of file StandardGeneticCode.h.
|
inline |
|
inlinevirtual |
Definition at line 28 of file StandardGeneticCode.h.
|
inlineinherited |
Tell if two codons are synonymous, that is, if they encode the same amino-acid.
i | The character code for the first codon. |
j | The character code for the second codon. |
Definition at line 217 of file GeneticCode.h.
References bpp::GeneticCode::translate().
|
inlineinherited |
Tell if two codons are synonymous, that is, if they encode the same amino-acid.
i | The numeric code for the first codon. |
j | The numeric code for the second codon. |
Definition at line 205 of file GeneticCode.h.
References bpp::GeneticCode::translate().
Referenced by bpp::CodonSiteTools::numberOfSynonymousDifferences().
|
inlinevirtual |
Implements bpp::GeneticCode.
Definition at line 30 of file StandardGeneticCode.h.
References StandardGeneticCode().
|
inlinevirtualinherited |
Alias for getSourceAlphabet return a pointer toward a CodonAlphabet.
Definition at line 111 of file GeneticCode.h.
References bpp::GeneticCode::codonAlphabet_.
|
inherited |
Get the subsequence corresponding to the coding part of a given sequence.
If lookForInitCodon if set to 'true', the subsequence will start at the first AUG motif, otherwise the subsequence will start at the beginning of the sequence. The subsequence ends at the first stop codon (excluded) found, or the end of the sequence.
The sequence may have a nucleotide or codon alphabet. The subsequence has the same alphabet, name and comments of the input sequence. In case of nucleotide sequence and if the lookForInitCodon option is checked, the phase will be determined from the sequence.
sequence | The sequence to parse. |
lookForInitCodon | Tell if the AUG codon must be found. |
includeInitCodon | (if lookForInitCodon is true) tell if the init codon must be included in the subsequence. |
Definition at line 114 of file GeneticCode.cpp.
References bpp::CruxSymbolListInterface::alphabet(), bpp::GeneticCode::codonAlphabet_, bpp::AlphabetTools::isCodonAlphabet(), bpp::AlphabetTools::isNucleicAlphabet(), bpp::GeneticCode::isStop(), and bpp::CruxSymbolListInterface::size().
|
inlinevirtualinherited |
Alias for getSourceAlphabet return a pointer toward a CodonAlphabet.
Definition at line 104 of file GeneticCode.h.
References bpp::GeneticCode::codonAlphabet_.
Referenced by bpp::CodonSiteTools::fixedDifferences(), bpp::CodonSiteTools::meanNumberOfSynonymousPositions(), bpp::CodonSiteTools::numberOfNonSynonymousSubstitutions(), bpp::CodonSiteTools::numberOfSynonymousDifferences(), bpp::CodonSiteTools::numberOfSynonymousPositions(), bpp::CodonSiteTools::piNonSynonymous(), and bpp::CodonSiteTools::piSynonymous().
|
inlinevirtual |
Implements bpp::GeneticCode.
Definition at line 36 of file StandardGeneticCode.h.
|
inlinevirtualinherited |
Alias for getTargetAlphabet return a pointer toward a ProteicAlphabet.
Definition at line 118 of file GeneticCode.h.
References bpp::GeneticCode::proteicAlphabet_.
|
inlineoverridevirtualinherited |
Get the source alphabet.
Implements bpp::TransliteratorInterface.
Definition at line 74 of file GeneticCode.h.
References bpp::GeneticCode::codonAlphabet_.
Referenced by bpp::CodonSiteTools::isSynonymousPolymorphic().
|
inlinevirtual |
Implements bpp::GeneticCode.
Definition at line 43 of file StandardGeneticCode.h.
|
inlinevirtual |
Implements bpp::GeneticCode.
Definition at line 38 of file StandardGeneticCode.h.
|
inherited |
Definition at line 63 of file GeneticCode.cpp.
References bpp::GeneticCode::codonAlphabet_, bpp::GeneticCode::proteicAlphabet_, and bpp::GeneticCode::translate().
|
inherited |
Definition at line 42 of file GeneticCode.cpp.
References bpp::GeneticCode::codonAlphabet_, bpp::GeneticCode::proteicAlphabet_, and bpp::GeneticCode::translate().
|
inlineoverridevirtualinherited |
Get the target alphabet.
Implements bpp::TransliteratorInterface.
Definition at line 78 of file GeneticCode.h.
References bpp::GeneticCode::proteicAlphabet_.
|
private |
Definition at line 13 of file StandardGeneticCode.cpp.
Referenced by StandardGeneticCode().
|
inlinevirtual |
Tells is a particular codon is an alternative start codon.
state | The character code for the state to test. |
Implements bpp::GeneticCode.
Definition at line 68 of file StandardGeneticCode.h.
References bpp::GeneticCode::codonAlphabet_.
|
inlinevirtual |
Tells is a particular codon is an alternative start codon.
state | The numeric code for the state to test. |
Implements bpp::GeneticCode.
Definition at line 61 of file StandardGeneticCode.h.
References bpp::GeneticCode::codonAlphabet_.
|
inherited |
codon | The codon to test. |
Definition at line 84 of file GeneticCode.cpp.
References bpp::GeneticCode::codonAlphabet_, bpp::GeneticCode::isStop(), and bpp::GeneticCode::translate().
Referenced by bpp::CodonSiteTools::isFourFoldDegenerated().
|
inlinevirtualinherited |
Tells is a particular codon is a start codon.
state | The character code for the state to test. |
Definition at line 177 of file GeneticCode.h.
References bpp::GeneticCode::codonAlphabet_, and bpp::GeneticCode::isStart().
|
inlinevirtualinherited |
Tells is a particular codon is a start codon.
state | The numeric code for the state to test. |
Definition at line 164 of file GeneticCode.h.
References bpp::GeneticCode::codonAlphabet_.
Referenced by bpp::SequenceTools::getCDS(), and bpp::GeneticCode::isStart().
|
inlinevirtual |
Tells is a particular codon is a stop codon.
state | The character code for the state to test. |
Implements bpp::GeneticCode.
Definition at line 55 of file StandardGeneticCode.h.
References bpp::GeneticCode::codonAlphabet_.
|
inlinevirtual |
Tells is a particular codon is a stop codon.
state | The numeric code for the state to test. |
Implements bpp::GeneticCode.
Definition at line 48 of file StandardGeneticCode.h.
References bpp::GeneticCode::codonAlphabet_.
|
inlinevirtualinherited |
Alias for getTargetAlphabet return a pointer toward a ProteicAlphabet.
Definition at line 125 of file GeneticCode.h.
References bpp::GeneticCode::proteicAlphabet_.
|
inlineoverridevirtualinherited |
Get the source alphabet.
Implements bpp::TransliteratorInterface.
Definition at line 76 of file GeneticCode.h.
References bpp::GeneticCode::codonAlphabet_.
Referenced by bpp::CodonSiteTools::fixedDifferences(), bpp::CodonSiteTools::isSynonymousPolymorphic(), bpp::CodonSiteTools::meanNumberOfSynonymousPositions(), bpp::CodonSiteTools::numberOfNonSynonymousSubstitutions(), bpp::CodonSiteTools::piNonSynonymous(), and bpp::CodonSiteTools::piSynonymous().
|
inlineoverridevirtualinherited |
Get the target alphabet.
Implements bpp::TransliteratorInterface.
Definition at line 80 of file GeneticCode.h.
References bpp::GeneticCode::proteicAlphabet_.
|
inlineoverridevirtualinherited |
Translate a whole sequence from source alphabet to target alphabet.
sequence | A sequence in source alphabet. |
Implements bpp::TransliteratorInterface.
Definition at line 86 of file GeneticCode.h.
References bpp::AbstractTransliterator::translate().
|
overridevirtualinherited |
Translate a given state coded as a string from source alphabet to target alphabet.
state | A state in source alphabet. |
Implements bpp::AbstractTransliterator.
Definition at line 34 of file GeneticCode.cpp.
References bpp::GeneticCode::codonAlphabet_, bpp::GeneticCode::proteicAlphabet_, and bpp::GeneticCode::translate().
|
overridevirtualinherited |
Translate a given state coded as a int from source alphabet to target alphabet.
state | A state in source alphabet. |
Implements bpp::AbstractTransliterator.
Definition at line 20 of file GeneticCode.cpp.
References bpp::GeneticCode::codonAlphabet_, bpp::GeneticCode::isStop(), and bpp::GeneticCode::tlnTable_.
Referenced by bpp::GeneticCode::areSynonymous(), bpp::GeneticCode::getSynonymous(), bpp::GeneticCode::isFourFoldDegenerated(), bpp::CodonSiteTools::isSynonymousPolymorphic(), bpp::CodonSiteTools::numberOfSynonymousPositions(), and bpp::GeneticCode::translate().
|
protectedinherited |
Definition at line 52 of file GeneticCode.h.
Referenced by bpp::GeneticCode::codonAlphabet(), bpp::GeneticCode::getCodingSequence(), bpp::GeneticCode::getCodonAlphabet(), bpp::GeneticCode::getSourceAlphabet(), bpp::GeneticCode::getSynonymous(), bpp::AscidianMitochondrialGeneticCode::isAltStart(), bpp::CiliateNuclearGeneticCode::isAltStart(), bpp::EchinodermMitochondrialGeneticCode::isAltStart(), bpp::InvertebrateMitochondrialGeneticCode::isAltStart(), bpp::MoldMitochondrialGeneticCode::isAltStart(), isAltStart(), bpp::VertebrateMitochondrialGeneticCode::isAltStart(), bpp::YeastMitochondrialGeneticCode::isAltStart(), bpp::GeneticCode::isFourFoldDegenerated(), bpp::GeneticCode::isStart(), bpp::AscidianMitochondrialGeneticCode::isStop(), bpp::CiliateNuclearGeneticCode::isStop(), bpp::EchinodermMitochondrialGeneticCode::isStop(), bpp::InvertebrateMitochondrialGeneticCode::isStop(), bpp::MoldMitochondrialGeneticCode::isStop(), isStop(), bpp::VertebrateMitochondrialGeneticCode::isStop(), bpp::YeastMitochondrialGeneticCode::isStop(), bpp::GeneticCode::sourceAlphabet(), and bpp::GeneticCode::translate().
|
protectedinherited |
Definition at line 53 of file GeneticCode.h.
Referenced by bpp::GeneticCode::getProteicAlphabet(), bpp::GeneticCode::getSynonymous(), bpp::GeneticCode::getTargetAlphabet(), bpp::GeneticCode::proteicAlphabet(), bpp::GeneticCode::targetAlphabet(), and bpp::GeneticCode::translate().
|
protectedinherited |
Definition at line 54 of file GeneticCode.h.
Referenced by bpp::GeneticCode::translate().