bpp-seq3  3.0.0
bpp::InvertebrateMitochondrialGeneticCode Class Reference

This class implements the Invertebrate Mitochondrial genetic code as describe on the NCBI website: http://www.ncbi.nlm.nih.gov/Taxonomy/Utils/wprintgc.cgi?mode=t#SG5. More...

#include <Bpp/Seq/GeneticCode/InvertebrateMitochondrialGeneticCode.h>

+ Inheritance diagram for bpp::InvertebrateMitochondrialGeneticCode:
+ Collaboration diagram for bpp::InvertebrateMitochondrialGeneticCode:

Public Member Functions

 InvertebrateMitochondrialGeneticCode (std::shared_ptr< const NucleicAlphabet > alphabet)
 
virtual ~InvertebrateMitochondrialGeneticCode ()
 
virtual InvertebrateMitochondrialGeneticCodeclone () 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 AlphabetgetSourceAlphabet () const override
 Get the source alphabet. More...
 
const AlphabetsourceAlphabet () const override
 Get the source alphabet. More...
 
std::shared_ptr< const AlphabetgetTargetAlphabet () const override
 Get the target alphabet. More...
 
const AlphabettargetAlphabet () 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< Sequencetranslate (const SequenceInterface &sequence) const override
 Translate a whole sequence from source alphabet to target alphabet. More...
 
Specific methods.
virtual std::shared_ptr< const CodonAlphabetgetCodonAlphabet () const
 Alias for getSourceAlphabet return a pointer toward a CodonAlphabet. More...
 
virtual const CodonAlphabetcodonAlphabet () const
 Alias for getSourceAlphabet return a pointer toward a CodonAlphabet. More...
 
virtual std::shared_ptr< const ProteicAlphabetgetProteicAlphabet () const
 Alias for getTargetAlphabet return a pointer toward a ProteicAlphabet. More...
 
virtual const ProteicAlphabetproteicAlphabet () 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< SequencegetCodingSequence (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 CodonAlphabetcodonAlphabet_
 
std::shared_ptr< const ProteicAlphabetproteicAlphabet_
 
std::map< int, int > tlnTable_
 

Private Member Functions

void init_ ()
 

Detailed Description

This class implements the Invertebrate Mitochondrial genetic code as describe on the NCBI website: http://www.ncbi.nlm.nih.gov/Taxonomy/Utils/wprintgc.cgi?mode=t#SG5.

Definition at line 19 of file InvertebrateMitochondrialGeneticCode.h.

Constructor & Destructor Documentation

◆ InvertebrateMitochondrialGeneticCode()

bpp::InvertebrateMitochondrialGeneticCode::InvertebrateMitochondrialGeneticCode ( std::shared_ptr< const NucleicAlphabet alphabet)
inline

Definition at line 23 of file InvertebrateMitochondrialGeneticCode.h.

References init_().

Referenced by clone().

◆ ~InvertebrateMitochondrialGeneticCode()

virtual bpp::InvertebrateMitochondrialGeneticCode::~InvertebrateMitochondrialGeneticCode ( )
inlinevirtual

Definition at line 29 of file InvertebrateMitochondrialGeneticCode.h.

Member Function Documentation

◆ areSynonymous() [1/2]

bool bpp::GeneticCode::areSynonymous ( const std::string &  i,
const std::string &  j 
) const
inlineinherited

Tell if two codons are synonymous, that is, if they encode the same amino-acid.

Parameters
iThe character code for the first codon.
jThe character code for the second codon.
Returns
True if the two codons are synonymous.

Definition at line 217 of file GeneticCode.h.

References bpp::GeneticCode::translate().

◆ areSynonymous() [2/2]

bool bpp::GeneticCode::areSynonymous ( int  i,
int  j 
) const
inlineinherited

Tell if two codons are synonymous, that is, if they encode the same amino-acid.

Parameters
iThe numeric code for the first codon.
jThe numeric code for the second codon.
Returns
True if the two codons are synonymous.

Definition at line 205 of file GeneticCode.h.

References bpp::GeneticCode::translate().

Referenced by bpp::CodonSiteTools::numberOfSynonymousDifferences().

◆ clone()

virtual InvertebrateMitochondrialGeneticCode* bpp::InvertebrateMitochondrialGeneticCode::clone ( ) const
inlinevirtual

◆ codonAlphabet()

virtual const CodonAlphabet& bpp::GeneticCode::codonAlphabet ( ) const
inlinevirtualinherited

Alias for getSourceAlphabet return a pointer toward a CodonAlphabet.

Returns
A reference toward the codon alphabet.

Definition at line 111 of file GeneticCode.h.

References bpp::GeneticCode::codonAlphabet_.

◆ getCodingSequence()

unique_ptr< Sequence > GeneticCode::getCodingSequence ( const SequenceInterface sequence,
bool  lookForInitCodon = false,
bool  includeInitCodon = false 
) const
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.

Parameters
sequenceThe sequence to parse.
lookForInitCodonTell if the AUG codon must be found.
includeInitCodon(if lookForInitCodon is true) tell if the init codon must be included in the subsequence.
Returns
A nucleotide/codon 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().

◆ getCodonAlphabet()

virtual std::shared_ptr<const CodonAlphabet> bpp::GeneticCode::getCodonAlphabet ( ) const
inlinevirtualinherited

◆ getNumberOfStopCodons()

size_t bpp::InvertebrateMitochondrialGeneticCode::getNumberOfStopCodons ( ) const
inlinevirtual
Returns
The number of stop codons.

Implements bpp::GeneticCode.

Definition at line 37 of file InvertebrateMitochondrialGeneticCode.h.

◆ getProteicAlphabet()

virtual std::shared_ptr<const ProteicAlphabet> bpp::GeneticCode::getProteicAlphabet ( ) const
inlinevirtualinherited

Alias for getTargetAlphabet return a pointer toward a ProteicAlphabet.

Returns
A pointer toward the protein alphabet.

Definition at line 118 of file GeneticCode.h.

References bpp::GeneticCode::proteicAlphabet_.

◆ getSourceAlphabet()

std::shared_ptr<const Alphabet> bpp::GeneticCode::getSourceAlphabet ( ) const
inlineoverridevirtualinherited

Get the source alphabet.

Returns
A pointer toward the source alphabet.

Implements bpp::TransliteratorInterface.

Definition at line 74 of file GeneticCode.h.

References bpp::GeneticCode::codonAlphabet_.

Referenced by bpp::CodonSiteTools::isSynonymousPolymorphic().

◆ getStopCodonsAsChar()

std::vector<std::string> bpp::InvertebrateMitochondrialGeneticCode::getStopCodonsAsChar ( ) const
inlinevirtual
Returns
A vector will all char codes for stop codons.

Implements bpp::GeneticCode.

Definition at line 44 of file InvertebrateMitochondrialGeneticCode.h.

◆ getStopCodonsAsInt()

std::vector<int> bpp::InvertebrateMitochondrialGeneticCode::getStopCodonsAsInt ( ) const
inlinevirtual
Returns
A vector will all int codes for stop codons.

Implements bpp::GeneticCode.

Definition at line 39 of file InvertebrateMitochondrialGeneticCode.h.

◆ getSynonymous() [1/2]

std::vector< std::string > GeneticCode::getSynonymous ( const std::string &  aminoacid) const
inherited

◆ getSynonymous() [2/2]

vector< int > GeneticCode::getSynonymous ( int  aminoacid) const
inherited

◆ getTargetAlphabet()

std::shared_ptr<const Alphabet> bpp::GeneticCode::getTargetAlphabet ( ) const
inlineoverridevirtualinherited

Get the target alphabet.

Returns
A pointer toward the target alphabet.

Implements bpp::TransliteratorInterface.

Definition at line 78 of file GeneticCode.h.

References bpp::GeneticCode::proteicAlphabet_.

◆ init_()

void InvertebrateMitochondrialGeneticCode::init_ ( )
private

◆ isAltStart() [1/2]

bool bpp::InvertebrateMitochondrialGeneticCode::isAltStart ( const std::string &  state) const
inlinevirtual

Tells is a particular codon is an alternative start codon.

Parameters
stateThe character code for the state to test.
Returns
True if the state corresponds to an alternative start codon.

Implements bpp::GeneticCode.

Definition at line 69 of file InvertebrateMitochondrialGeneticCode.h.

References bpp::GeneticCode::codonAlphabet_.

◆ isAltStart() [2/2]

bool bpp::InvertebrateMitochondrialGeneticCode::isAltStart ( int  state) const
inlinevirtual

Tells is a particular codon is an alternative start codon.

Parameters
stateThe numeric code for the state to test.
Returns
True if the state corresponds to an alternative start codon.

Implements bpp::GeneticCode.

Definition at line 62 of file InvertebrateMitochondrialGeneticCode.h.

References bpp::GeneticCode::codonAlphabet_.

◆ isFourFoldDegenerated()

bool GeneticCode::isFourFoldDegenerated ( int  codon) const
inherited
Returns
True if the specified codon is fourfold degenerated (that is, if a mutation in the fourth position does not change the aminoacid).
Author
Benoit Nabholz, Annabelle Haudry
Parameters
codonThe 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().

◆ isStart() [1/2]

virtual bool bpp::GeneticCode::isStart ( const std::string &  state) const
inlinevirtualinherited

Tells is a particular codon is a start codon.

Parameters
stateThe character code for the state to test.
Returns
True if the state corresponds to a start codon.

Definition at line 177 of file GeneticCode.h.

References bpp::GeneticCode::codonAlphabet_, and bpp::GeneticCode::isStart().

◆ isStart() [2/2]

virtual bool bpp::GeneticCode::isStart ( int  state) const
inlinevirtualinherited

Tells is a particular codon is a start codon.

Parameters
stateThe numeric code for the state to test.
Returns
True if the state corresponds to a start codon.

Definition at line 164 of file GeneticCode.h.

References bpp::GeneticCode::codonAlphabet_.

Referenced by bpp::SequenceTools::getCDS(), and bpp::GeneticCode::isStart().

◆ isStop() [1/2]

bool bpp::InvertebrateMitochondrialGeneticCode::isStop ( const std::string &  state) const
inlinevirtual

Tells is a particular codon is a stop codon.

Parameters
stateThe character code for the state to test.
Returns
True if the state corresponds to a stop codon.

Implements bpp::GeneticCode.

Definition at line 56 of file InvertebrateMitochondrialGeneticCode.h.

References bpp::GeneticCode::codonAlphabet_.

◆ isStop() [2/2]

bool bpp::InvertebrateMitochondrialGeneticCode::isStop ( int  state) const
inlinevirtual

Tells is a particular codon is a stop codon.

Parameters
stateThe numeric code for the state to test.
Returns
True if the state corresponds to a stop codon.

Implements bpp::GeneticCode.

Definition at line 49 of file InvertebrateMitochondrialGeneticCode.h.

References bpp::GeneticCode::codonAlphabet_.

◆ proteicAlphabet()

virtual const ProteicAlphabet& bpp::GeneticCode::proteicAlphabet ( ) const
inlinevirtualinherited

Alias for getTargetAlphabet return a pointer toward a ProteicAlphabet.

Returns
A reference toward the protein alphabet.

Definition at line 125 of file GeneticCode.h.

References bpp::GeneticCode::proteicAlphabet_.

◆ sourceAlphabet()

const Alphabet& bpp::GeneticCode::sourceAlphabet ( ) const
inlineoverridevirtualinherited

◆ targetAlphabet()

const Alphabet& bpp::GeneticCode::targetAlphabet ( ) const
inlineoverridevirtualinherited

Get the target alphabet.

Returns
A reference toward the target alphabet.

Implements bpp::TransliteratorInterface.

Definition at line 80 of file GeneticCode.h.

References bpp::GeneticCode::proteicAlphabet_.

◆ translate() [1/3]

std::unique_ptr<Sequence> bpp::GeneticCode::translate ( const SequenceInterface sequence) const
inlineoverridevirtualinherited

Translate a whole sequence from source alphabet to target alphabet.

Parameters
sequenceA sequence in source alphabet.
Returns
The corresponding sequence in target alphabet.

Implements bpp::TransliteratorInterface.

Definition at line 86 of file GeneticCode.h.

References bpp::AbstractTransliterator::translate().

◆ translate() [2/3]

std::string GeneticCode::translate ( const std::string &  state) const
overridevirtualinherited

Translate a given state coded as a string from source alphabet to target alphabet.

Parameters
stateA state in source alphabet.
Returns
The corresponding state in target alphabet.

Implements bpp::AbstractTransliterator.

Definition at line 34 of file GeneticCode.cpp.

References bpp::GeneticCode::codonAlphabet_, bpp::GeneticCode::proteicAlphabet_, and bpp::GeneticCode::translate().

◆ translate() [3/3]

int GeneticCode::translate ( int  state) const
overridevirtualinherited

Translate a given state coded as a int from source alphabet to target alphabet.

Parameters
stateA state in source alphabet.
Returns
The corresponding state in target 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().

Member Data Documentation

◆ codonAlphabet_

◆ proteicAlphabet_

◆ tlnTable_

std::map<int, int> bpp::GeneticCode::tlnTable_
protectedinherited

Definition at line 54 of file GeneticCode.h.

Referenced by bpp::GeneticCode::translate().


The documentation for this class was generated from the following files: