bpp-seq  2.1.0
 All Classes Namespaces Files Functions Variables Friends Pages
bpp::VertebrateMitochondrialGeneticCode Class Reference

This class implements the vertebrate mitochondrial genetic code as describe on the NCBI web site: http://www.ncbi.nlm.nih.gov/Taxonomy/Utils/wprintgc.cgi?mode=t#SG2. More...

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

+ Inheritance diagram for bpp::VertebrateMitochondrialGeneticCode:
+ Collaboration diagram for bpp::VertebrateMitochondrialGeneticCode:

Public Member Functions

 VertebrateMitochondrialGeneticCode (const NucleicAlphabet *alpha)
 
virtual ~VertebrateMitochondrialGeneticCode ()
 
int translate (int state) const throw (Exception)
 Translate a given state coded as a int from source alphabet to target alphabet. More...
 
std::string translate (const std::string &state) const throw (Exception)
 Translate a given state coded as a string from source alphabet to target alphabet. More...
 
Sequencetranslate (const Sequence &sequence) const throw (Exception)
 Translate a whole sequence from source alphabet to target alphabet. More...
 
Methods form the Transliterator interface.
const AlphabetgetSourceAlphabet () const
 Get the source alphabet. More...
 
const AlphabetgetTargetAlphabet () const
 Get the target alphabet. More...
 
Specific methods.
bool areSynonymous (int i, int j) const throw (BadIntException)
 
bool areSynonymous (const std::string &i, const std::string &j) const throw (BadCharException)
 
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

const CodonAlphabetcodonAlphabet_
 
const ProteicAlphabetproteicAlphabet_
 

Detailed Description

This class implements the vertebrate mitochondrial genetic code as describe on the NCBI web site: http://www.ncbi.nlm.nih.gov/Taxonomy/Utils/wprintgc.cgi?mode=t#SG2.

Definition at line 54 of file VertebrateMitochondrialGeneticCode.h.

Constructor & Destructor Documentation

VertebrateMitochondrialGeneticCode::VertebrateMitochondrialGeneticCode ( const NucleicAlphabet alpha)
VertebrateMitochondrialGeneticCode::~VertebrateMitochondrialGeneticCode ( )
virtual

Member Function Documentation

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

Definition at line 131 of file GeneticCode.h.

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

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

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

Definition at line 135 of file GeneticCode.h.

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

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 128 of file GeneticCode.cpp.

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

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

Get the source alphabet.

Returns
The source alphabet.

Implements bpp::Transliterator.

Definition at line 115 of file GeneticCode.h.

References bpp::GeneticCode::codonAlphabet_.

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

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

Definition at line 55 of file GeneticCode.cpp.

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

Definition at line 76 of file GeneticCode.cpp.

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

Get the target alphabet.

Returns
The target alphabet.

Implements bpp::Transliterator.

Definition at line 116 of file GeneticCode.h.

References bpp::GeneticCode::proteicAlphabet_.

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 97 of file GeneticCode.cpp.

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

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

int VertebrateMitochondrialGeneticCode::translate ( int  state) const throw (Exception)
virtual

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::GeneticCode.

Definition at line 63 of file VertebrateMitochondrialGeneticCode.cpp.

string VertebrateMitochondrialGeneticCode::translate ( const std::string &  state) const throw (Exception)
virtual

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::GeneticCode.

Definition at line 168 of file VertebrateMitochondrialGeneticCode.cpp.

Sequence* bpp::VertebrateMitochondrialGeneticCode::translate ( const Sequence sequence) const throw (Exception)
inlinevirtual

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::GeneticCode.

Definition at line 64 of file VertebrateMitochondrialGeneticCode.h.

References bpp::GeneticCode::translate().

Member Data Documentation


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