|
bpp-seq
2.1.0
|
Partial implementation of the Transliterator interface for genetic code object. More...
#include <Bpp/Seq/GeneticCode/GeneticCode.h>
Inheritance diagram for bpp::GeneticCode:
Collaboration diagram for bpp::GeneticCode:Public Member Functions | |
| GeneticCode () | |
| GeneticCode (const GeneticCode &gc) | |
| GeneticCode & | operator= (const GeneticCode &gc) |
| virtual | ~GeneticCode () |
Methods form the Transliterator interface. | |
| const Alphabet * | getSourceAlphabet () const |
| Get the source alphabet. | |
| const Alphabet * | getTargetAlphabet () const |
| Get the target alphabet. | |
| virtual int | translate (int state) const =0 throw (BadIntException, Exception) |
| Translate a given state coded as a int from source alphabet to target alphabet. | |
| virtual std::string | translate (const std::string &state) const =0 throw (BadCharException, Exception) |
| Translate a given state coded as a string from source alphabet to target alphabet. | |
| virtual Sequence * | translate (const Sequence &sequence) const throw (Exception) |
| Translate a whole sequence from source alphabet to target alphabet. | |
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 |
| Sequence * | getCodingSequence (const Sequence &sequence, bool lookForInitCodon=false, bool includeInitCodon=false) const throw (Exception) |
| Get the subsequence corresponding to the coding part of a given sequence. | |
Protected Attributes | |
| const CodonAlphabet * | codonAlphabet_ |
| const ProteicAlphabet * | proteicAlphabet_ |
Partial implementation of the Transliterator interface for genetic code object.
A genetic code object if a translator from a codon alphabet to a proteic alphabet. Depending on the codon alphabet used, several genetic code can be implemented.
Definition at line 79 of file GeneticCode.h.
| bpp::GeneticCode::GeneticCode | ( | ) | [inline] |
Definition at line 87 of file GeneticCode.h.
| bpp::GeneticCode::GeneticCode | ( | const GeneticCode & | gc | ) | [inline] |
Definition at line 93 of file GeneticCode.h.
| virtual bpp::GeneticCode::~GeneticCode | ( | ) | [inline, virtual] |
Definition at line 107 of file GeneticCode.h.
| bool bpp::GeneticCode::areSynonymous | ( | int | i, |
| int | j | ||
| ) | const throw (BadIntException) [inline] |
Definition at line 131 of file GeneticCode.h.
References translate().
Referenced by bpp::CodonSiteTools::numberOfSynonymousDifferences().
| bool bpp::GeneticCode::areSynonymous | ( | const std::string & | i, |
| const std::string & | j | ||
| ) | const throw (BadCharException) [inline] |
Definition at line 135 of file GeneticCode.h.
References translate().
| Sequence * GeneticCode::getCodingSequence | ( | const Sequence & | sequence, |
| bool | lookForInitCodon = false, |
||
| bool | includeInitCodon = false |
||
| ) | const throw (Exception) |
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.
| 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 128 of file GeneticCode.cpp.
References bpp::AbstractAlphabet::intToChar(), bpp::AlphabetTools::isCodonAlphabet(), bpp::AlphabetTools::isNucleicAlphabet(), bpp::SymbolList::size(), and bpp::SequenceTools::subseq().
| const Alphabet* bpp::GeneticCode::getSourceAlphabet | ( | ) | const [inline, virtual] |
Get the source alphabet.
Implements bpp::Transliterator.
Definition at line 115 of file GeneticCode.h.
References codonAlphabet_.
Referenced by bpp::CodonSiteTools::numberOfSynonymousDifferences().
| vector< int > GeneticCode::getSynonymous | ( | int | aminoacid | ) | const throw (BadIntException) |
Definition at line 55 of file GeneticCode.cpp.
| std::vector< std::string > GeneticCode::getSynonymous | ( | const std::string & | aminoacid | ) | const throw (BadCharException) |
Definition at line 76 of file GeneticCode.cpp.
| const Alphabet* bpp::GeneticCode::getTargetAlphabet | ( | ) | const [inline, virtual] |
Get the target alphabet.
Implements bpp::Transliterator.
Definition at line 116 of file GeneticCode.h.
References proteicAlphabet_.
| bool GeneticCode::isFourFoldDegenerated | ( | int | codon | ) | const |
| codon | The codon to test. |
Definition at line 97 of file GeneticCode.cpp.
References codonAlphabet_, bpp::CodonAlphabet::getCodon(), bpp::WordAlphabet::getPositions(), bpp::CodonAlphabet::isStop(), and translate().
Referenced by bpp::CodonSiteTools::isFourFoldDegenerated().
| GeneticCode& bpp::GeneticCode::operator= | ( | const GeneticCode & | gc | ) | [inline] |
Definition at line 99 of file GeneticCode.h.
References codonAlphabet_, and proteicAlphabet_.
| virtual int bpp::GeneticCode::translate | ( | int | state | ) | const throw (BadIntException, Exception) [pure virtual] |
Translate a given state coded as a int from source alphabet to target alphabet.
| state | A state in source alphabet. |
| BadIntException | If the state is not a proper state for source alphabet. |
| Exception | Other kind of error, depending on the implementation. |
Implements bpp::AbstractTransliterator.
Implemented in bpp::InvertebrateMitochondrialGeneticCode, bpp::YeastMitochondrialGeneticCode, bpp::EchinodermMitochondrialGeneticCode, bpp::StandardGeneticCode, and bpp::VertebrateMitochondrialGeneticCode.
Referenced by areSynonymous(), isFourFoldDegenerated(), and translate().
| virtual std::string bpp::GeneticCode::translate | ( | const std::string & | state | ) | const throw (BadCharException, Exception) [pure virtual] |
Translate a given state coded as a string from source alphabet to target alphabet.
| state | A state in source alphabet. |
| BadCharException | If the state is not a proper state for source alphabet. |
| Exception | Other kind of error, depending on the implementation. |
Implements bpp::AbstractTransliterator.
Implemented in bpp::InvertebrateMitochondrialGeneticCode, bpp::YeastMitochondrialGeneticCode, bpp::EchinodermMitochondrialGeneticCode, bpp::StandardGeneticCode, and bpp::VertebrateMitochondrialGeneticCode.
| virtual Sequence* bpp::GeneticCode::translate | ( | const Sequence & | sequence | ) | const throw (Exception) [inline, virtual] |
Translate a whole sequence from source alphabet to target alphabet.
| sequence | A sequence in source alphabet. |
| AlphabetMismatchException | If the sequence alphabet do not match the source alphabet. |
| Exception | Other kind of error, depending on the implementation. |
Reimplemented from bpp::AbstractTransliterator.
Reimplemented in bpp::InvertebrateMitochondrialGeneticCode, bpp::YeastMitochondrialGeneticCode, bpp::EchinodermMitochondrialGeneticCode, bpp::StandardGeneticCode, and bpp::VertebrateMitochondrialGeneticCode.
Definition at line 119 of file GeneticCode.h.
References translate().
const CodonAlphabet* bpp::GeneticCode::codonAlphabet_ [protected] |
Definition at line 83 of file GeneticCode.h.
Referenced by bpp::EchinodermMitochondrialGeneticCode::EchinodermMitochondrialGeneticCode(), getSourceAlphabet(), bpp::InvertebrateMitochondrialGeneticCode::InvertebrateMitochondrialGeneticCode(), isFourFoldDegenerated(), operator=(), bpp::StandardGeneticCode::StandardGeneticCode(), bpp::VertebrateMitochondrialGeneticCode::VertebrateMitochondrialGeneticCode(), bpp::YeastMitochondrialGeneticCode::YeastMitochondrialGeneticCode(), bpp::EchinodermMitochondrialGeneticCode::~EchinodermMitochondrialGeneticCode(), bpp::InvertebrateMitochondrialGeneticCode::~InvertebrateMitochondrialGeneticCode(), bpp::StandardGeneticCode::~StandardGeneticCode(), bpp::VertebrateMitochondrialGeneticCode::~VertebrateMitochondrialGeneticCode(), and bpp::YeastMitochondrialGeneticCode::~YeastMitochondrialGeneticCode().
const ProteicAlphabet* bpp::GeneticCode::proteicAlphabet_ [protected] |
Definition at line 84 of file GeneticCode.h.
Referenced by bpp::EchinodermMitochondrialGeneticCode::EchinodermMitochondrialGeneticCode(), getTargetAlphabet(), bpp::InvertebrateMitochondrialGeneticCode::InvertebrateMitochondrialGeneticCode(), operator=(), bpp::StandardGeneticCode::StandardGeneticCode(), bpp::VertebrateMitochondrialGeneticCode::VertebrateMitochondrialGeneticCode(), bpp::YeastMitochondrialGeneticCode::YeastMitochondrialGeneticCode(), bpp::EchinodermMitochondrialGeneticCode::~EchinodermMitochondrialGeneticCode(), bpp::InvertebrateMitochondrialGeneticCode::~InvertebrateMitochondrialGeneticCode(), bpp::StandardGeneticCode::~StandardGeneticCode(), bpp::VertebrateMitochondrialGeneticCode::~VertebrateMitochondrialGeneticCode(), and bpp::YeastMitochondrialGeneticCode::~YeastMitochondrialGeneticCode().