The interface class for word alphabets.
More...
#include <Bpp/Seq/Alphabet/WordAlphabet.h>
|
| CoreWordAlphabet () |
|
virtual | ~CoreWordAlphabet () |
|
virtual unsigned int | getLength () const =0 |
|
virtual unsigned int | getSize () const =0 |
|
virtual bool | hasUniqueAlphabet () const =0 |
|
virtual std::shared_ptr< const Alphabet > | getNAlphabet (size_t n) const =0 |
|
virtual int | getWord (const Sequence &seq, size_t pos=0) const =0 |
|
virtual int | getWord (const std::vector< int > &vint, size_t pos=0) const =0 |
| Get the int code for a word given the int code of the underlying positions. More...
|
|
virtual std::string | getWord (const std::vector< std::string > &vpos, size_t pos=0) const =0 |
| Get the char code for a word given the char code of the underlying positions. More...
|
|
virtual int | getNPosition (int word, size_t n) const =0 |
| Get the int code of the n-position of a word given its int description. More...
|
|
virtual std::vector< int > | getPositions (int word) const =0 |
| Get the int codes of each position of a word given its int description. More...
|
|
virtual std::string | getNPosition (const std::string &word, size_t n) const =0 |
| Get the char code of the n-position of a word given its char description. More...
|
|
virtual std::vector< std::string > | getPositions (const std::string &word) const =0 |
| Get the char codes of each position of a word given its char description. More...
|
|
virtual std::unique_ptr< SequenceInterface > | translate (const SequenceInterface &sequence, size_t pos=0) const =0 |
| Translate a whole sequence from letters alphabet to words alphabet. More...
|
|
virtual std::unique_ptr< SequenceInterface > | reverse (const SequenceInterface &sequence) const =0 |
| Translate a whole sequence from words alphabet to letters alphabet. More...
|
|
The interface class for word alphabets.
Definition at line 24 of file WordAlphabet.h.
◆ CoreWordAlphabet()
bpp::CoreWordAlphabet::CoreWordAlphabet |
( |
| ) |
|
|
inline |
◆ ~CoreWordAlphabet()
virtual bpp::CoreWordAlphabet::~CoreWordAlphabet |
( |
| ) |
|
|
inlinevirtual |
◆ containsGap()
virtual bool bpp::CoreWordAlphabet::containsGap |
( |
const std::string & |
state | ) |
const |
|
privatepure virtual |
◆ containsUnresolved()
virtual bool bpp::CoreWordAlphabet::containsUnresolved |
( |
const std::string & |
state | ) |
const |
|
privatepure virtual |
◆ getLength()
virtual unsigned int bpp::CoreWordAlphabet::getLength |
( |
| ) |
const |
|
pure virtual |
◆ getNAlphabet()
virtual std::shared_ptr<const Alphabet> bpp::CoreWordAlphabet::getNAlphabet |
( |
size_t |
n | ) |
const |
|
pure virtual |
◆ getNPosition() [1/2]
virtual std::string bpp::CoreWordAlphabet::getNPosition |
( |
const std::string & |
word, |
|
|
size_t |
n |
|
) |
| const |
|
pure virtual |
Get the char code of the n-position of a word given its char description.
- Parameters
-
word | The char description of the word. |
n | The position in the word (starting at 0). |
- Returns
- The char description of the n-position of the word.
Implemented in bpp::WordAlphabet, and bpp::CodonAlphabet.
◆ getNPosition() [2/2]
virtual int bpp::CoreWordAlphabet::getNPosition |
( |
int |
word, |
|
|
size_t |
n |
|
) |
| const |
|
pure virtual |
Get the int code of the n-position of a word given its int description.
- Parameters
-
word | The int description of the word. |
n | The position in the word (starting at 0). |
- Returns
- The int description of the n-position of the word.
Implemented in bpp::WordAlphabet, and bpp::CodonAlphabet.
◆ getPositions() [1/2]
virtual std::vector<std::string> bpp::CoreWordAlphabet::getPositions |
( |
const std::string & |
word | ) |
const |
|
pure virtual |
Get the char codes of each position of a word given its char description.
- Parameters
-
word | The char description of the word. |
- Returns
- The char description of the three positions of the word.
Implemented in bpp::WordAlphabet, and bpp::CodonAlphabet.
◆ getPositions() [2/2]
virtual std::vector<int> bpp::CoreWordAlphabet::getPositions |
( |
int |
word | ) |
const |
|
pure virtual |
Get the int codes of each position of a word given its int description.
- Parameters
-
word | The int description of the word. |
- Returns
- The int description of the positions of the codon.
Implemented in bpp::WordAlphabet, and bpp::CodonAlphabet.
◆ getSize()
virtual unsigned int bpp::CoreWordAlphabet::getSize |
( |
| ) |
const |
|
pure virtual |
◆ getWord() [1/3]
virtual int bpp::CoreWordAlphabet::getWord |
( |
const Sequence & |
seq, |
|
|
size_t |
pos = 0 |
|
) |
| const |
|
pure virtual |
◆ getWord() [2/3]
virtual int bpp::CoreWordAlphabet::getWord |
( |
const std::vector< int > & |
vint, |
|
|
size_t |
pos = 0 |
|
) |
| const |
|
pure virtual |
Get the int code for a word given the int code of the underlying positions.
The int code of each position must match the corresponding alphabet specified at this position.
- Parameters
-
vint | description for all the positions. |
pos | the start position to match in the vector. |
- Returns
- The int code of the word.
- Exceptions
-
Implemented in bpp::CodonAlphabet, and bpp::WordAlphabet.
◆ getWord() [3/3]
virtual std::string bpp::CoreWordAlphabet::getWord |
( |
const std::vector< std::string > & |
vpos, |
|
|
size_t |
pos = 0 |
|
) |
| const |
|
pure virtual |
Get the char code for a word given the char code of the underlying positions.
The char code of each position must match the corresponding alphabet specified at this position.
- Parameters
-
vpos | vector description for all the positions. |
pos | the start position to match in the vector. |
- Returns
- The string of the word.
- Exceptions
-
Implemented in bpp::WordAlphabet, and bpp::CodonAlphabet.
◆ hasUniqueAlphabet()
virtual bool bpp::CoreWordAlphabet::hasUniqueAlphabet |
( |
| ) |
const |
|
pure virtual |
◆ reverse()
Translate a whole sequence from words alphabet to letters alphabet.
- Parameters
-
sequence | A sequence in words alphabet. |
- Returns
- The corresponding sequence in letters alphabet.
- Exceptions
-
Implemented in bpp::WordAlphabet, and bpp::CodonAlphabet.
◆ translate()
Translate a whole sequence from letters alphabet to words alphabet.
- Parameters
-
sequence | A sequence in letters alphabet. |
pos | the start position (default 0) |
- Returns
- The corresponding sequence in words alphabet.
- Exceptions
-
Implemented in bpp::WordAlphabet, and bpp::CodonAlphabet.
The documentation for this class was generated from the following file: