bpp-seq  2.2.0
bpp::EchinodermMitochondrialGeneticCode Class Reference

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

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

+ Inheritance diagram for bpp::EchinodermMitochondrialGeneticCode:
+ Collaboration diagram for bpp::EchinodermMitochondrialGeneticCode:

Public Member Functions

 EchinodermMitochondrialGeneticCode (const NucleicAlphabet *alphabet)
 
virtual ~EchinodermMitochondrialGeneticCode ()
 
virtual EchinodermMitochondrialGeneticCodeclone () const
 
size_t getNumberOfStopCodons () const
 
std::vector< int > getStopCodonsAsInt () const
 
std::vector< std::string > getStopCodonsAsChar () const
 
bool isStop (int state) const throw (BadIntException)
 Tells is a particular codon is a stop codon. More...
 
bool isStop (const std::string &state) const throw (BadCharException)
 Tells is a particular codon is a stop codon. More...
 
bool isAltStart (int state) const throw (BadIntException)
 Tells is a particular codon is an alternative start codon. More...
 
bool isAltStart (const std::string &state) const throw (BadCharException)
 Tells is a particular codon is an alternative start codon. More...
 
Methods form the Transliterator interface.
const CodonAlphabetgetSourceAlphabet () const
 Get the source alphabet. More...
 
const ProteicAlphabetgetTargetAlphabet () const
 Get the target alphabet. More...
 
virtual int translate (int state) const throw (BadIntException, Exception)
 Translate a given state coded as a int from source alphabet to target alphabet. More...
 
virtual std::string translate (const std::string &state) const throw (BadCharException, Exception)
 Translate a given state coded as a string from source alphabet to target alphabet. More...
 
virtual Sequencetranslate (const Sequence &sequence) const throw (Exception)
 Translate a whole sequence from source alphabet to target alphabet. More...
 
Specific methods.
virtual bool isStart (int state) const throw (BadIntException)
 Tells is a particular codon is a start codon. More...
 
virtual bool isStart (const std::string &state) const throw (BadCharException)
 Tells is a particular codon is a start codon. More...
 
bool areSynonymous (int i, int j) const throw (BadIntException)
 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 throw (BadCharException)
 Tell if two codons are synonymous, that is, if they encode the same amino-acid. More...
 
std::vector< int > getSynonymous (int aminoacid) const throw (BadIntException)
 
std::vector< std::string > getSynonymous (const std::string &aminoacid) const throw (BadCharException)
 
bool isFourFoldDegenerated (int codon) const
 
SequencegetCodingSequence (const Sequence &sequence, bool lookForInitCodon=false, bool includeInitCodon=false) const throw (Exception)
 Get the subsequence corresponding to the coding part of a given sequence. More...
 

Protected Attributes

CodonAlphabet codonAlphabet_
 
ProteicAlphabet proteicAlphabet_
 
std::map< int, int > tlnTable_
 

Detailed Description

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

Definition at line 54 of file EchinodermMitochondrialGeneticCode.h.

Constructor & Destructor Documentation

◆ EchinodermMitochondrialGeneticCode()

EchinodermMitochondrialGeneticCode::EchinodermMitochondrialGeneticCode ( const NucleicAlphabet alphabet)

◆ ~EchinodermMitochondrialGeneticCode()

virtual bpp::EchinodermMitochondrialGeneticCode::~EchinodermMitochondrialGeneticCode ( )
inlinevirtual

Definition at line 60 of file EchinodermMitochondrialGeneticCode.h.

Member Function Documentation

◆ areSynonymous() [1/2]

bool bpp::GeneticCode::areSynonymous ( int  i,
int  j 
) const
throw (BadIntException
)
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.
Exceptions
BadIntExceptionif at least one of the states is not supported by the alphabet.

Definition at line 206 of file GeneticCode.h.

References bpp::GeneticCode::translate().

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

◆ areSynonymous() [2/2]

bool bpp::GeneticCode::areSynonymous ( const std::string &  i,
const std::string &  j 
) const
throw (BadCharException
)
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.
Exceptions
BadCharExceptionif at least one of the states is not supported by the alphabet.

Definition at line 219 of file GeneticCode.h.

References bpp::GeneticCode::translate().

◆ clone()

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

◆ getCodingSequence()

Sequence * GeneticCode::getCodingSequence ( const Sequence sequence,
bool  lookForInitCodon = false,
bool  includeInitCodon = false 
) const
throw (Exception
)
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 begining 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 149 of file GeneticCode.cpp.

References bpp::AbstractAlphabet::intToChar(), bpp::AlphabetTools::isCodonAlphabet(), bpp::AlphabetTools::isNucleicAlphabet(), bpp::SymbolList::size(), and bpp::SequenceTools::subseq().

◆ getNumberOfStopCodons()

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

Implements bpp::GeneticCode.

Definition at line 67 of file EchinodermMitochondrialGeneticCode.h.

◆ getSourceAlphabet()

const CodonAlphabet* bpp::GeneticCode::getSourceAlphabet ( ) const
inlinevirtualinherited

Get the source alphabet.

Returns
The source alphabet.

Implements bpp::Transliterator.

Definition at line 106 of file GeneticCode.h.

References bpp::GeneticCode::codonAlphabet_.

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

◆ getStopCodonsAsChar()

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

Implements bpp::GeneticCode.

Definition at line 76 of file EchinodermMitochondrialGeneticCode.h.

◆ getStopCodonsAsInt()

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

Implements bpp::GeneticCode.

Definition at line 69 of file EchinodermMitochondrialGeneticCode.h.

◆ getSynonymous() [1/2]

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

Definition at line 77 of file GeneticCode.cpp.

◆ getSynonymous() [2/2]

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

Definition at line 98 of file GeneticCode.cpp.

◆ getTargetAlphabet()

const ProteicAlphabet* bpp::GeneticCode::getTargetAlphabet ( ) const
inlinevirtualinherited

Get the target alphabet.

Returns
The target alphabet.

Implements bpp::Transliterator.

Definition at line 107 of file GeneticCode.h.

References bpp::GeneticCode::proteicAlphabet_.

◆ isAltStart() [1/2]

bool bpp::EchinodermMitochondrialGeneticCode::isAltStart ( int  state) const
throw (BadIntException
)
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.
Exceptions
BadIntExceptionif the state is not supported by the alphabet.

Implements bpp::GeneticCode.

Definition at line 94 of file EchinodermMitochondrialGeneticCode.h.

References bpp::GeneticCode::codonAlphabet_, and bpp::AbstractAlphabet::intToChar().

◆ isAltStart() [2/2]

bool bpp::EchinodermMitochondrialGeneticCode::isAltStart ( const std::string &  state) const
throw (BadCharException
)
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.
Exceptions
BadCharExceptionif the state is not supported by the alphabet.

Implements bpp::GeneticCode.

Definition at line 100 of file EchinodermMitochondrialGeneticCode.h.

References bpp::WordAlphabet::charToInt(), and 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 119 of file GeneticCode.cpp.

References bpp::GeneticCode::codonAlphabet_, bpp::CodonAlphabet::getCodon(), bpp::WordAlphabet::getPositions(), bpp::GeneticCode::isStop(), and bpp::GeneticCode::translate().

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

◆ isStart() [1/2]

virtual bool bpp::GeneticCode::isStart ( int  state) const
throw (BadIntException
)
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.
Exceptions
BadIntExceptionif the state is not supported by the alphabet.

Definition at line 163 of file GeneticCode.h.

References bpp::GeneticCode::codonAlphabet_, and bpp::AbstractAlphabet::intToChar().

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

◆ isStart() [2/2]

virtual bool bpp::GeneticCode::isStart ( const std::string &  state) const
throw (BadCharException
)
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.
Exceptions
BadCharExceptionif the state is not supported by the alphabet.

Definition at line 176 of file GeneticCode.h.

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

◆ isStop() [1/2]

bool bpp::EchinodermMitochondrialGeneticCode::isStop ( int  state) const
throw (BadIntException
)
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.
Exceptions
BadIntExceptionif the state is not supported by the alphabet.

Implements bpp::GeneticCode.

Definition at line 83 of file EchinodermMitochondrialGeneticCode.h.

References bpp::GeneticCode::codonAlphabet_, and bpp::AbstractAlphabet::intToChar().

◆ isStop() [2/2]

bool bpp::EchinodermMitochondrialGeneticCode::isStop ( const std::string &  state) const
throw (BadCharException
)
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.
Exceptions
BadCharExceptionif the state is not supported by the alphabet.

Implements bpp::GeneticCode.

Definition at line 89 of file EchinodermMitochondrialGeneticCode.h.

References bpp::WordAlphabet::charToInt(), and bpp::GeneticCode::codonAlphabet_.

◆ translate() [1/3]

int GeneticCode::translate ( int  state) const
throw (BadIntException,
Exception
)
virtualinherited

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.
Exceptions
BadIntExceptionIf the state is not a proper state for source alphabet.
ExceptionOther kind of error, depending on the implementation.

Implements bpp::AbstractTransliterator.

Definition at line 55 of file GeneticCode.cpp.

Referenced by bpp::GeneticCode::areSynonymous(), and bpp::GeneticCode::isFourFoldDegenerated().

◆ translate() [2/3]

std::string GeneticCode::translate ( const std::string &  state) const
throw (BadCharException,
Exception
)
virtualinherited

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.
Exceptions
BadCharExceptionIf the state is not a proper state for source alphabet.
ExceptionOther kind of error, depending on the implementation.

Implements bpp::AbstractTransliterator.

Definition at line 69 of file GeneticCode.cpp.

◆ translate() [3/3]

virtual Sequence* bpp::GeneticCode::translate ( const Sequence sequence) const
throw (Exception
)
inlinevirtualinherited

Translate a whole sequence from source alphabet to target alphabet.

Parameters
sequenceA sequence in source alphabet.
Returns
The corresponding sequence in target alphabet.
Exceptions
AlphabetMismatchExceptionIf the sequence alphabet do not match the source alphabet.
ExceptionOther kind of error, depending on the implementation.

Reimplemented from bpp::AbstractTransliterator.

Definition at line 110 of file GeneticCode.h.

References bpp::AbstractTransliterator::translate().

Member Data Documentation

◆ codonAlphabet_

◆ proteicAlphabet_

◆ tlnTable_


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