bpp-seq
2.2.0
|
The base class for word alphabets. More...
#include <Bpp/Seq/Alphabet/WordAlphabet.h>
Public Member Functions | |
WordAlphabet (const std::vector< const Alphabet *> &vAlpha) | |
Builds a new word alphabet from a vector of Alphabets. More... | |
WordAlphabet (const Alphabet *pAlpha, unsigned int num) | |
Builds a new word alphabet from a pointer to number of Alphabets. More... | |
WordAlphabet (const WordAlphabet &bia) | |
WordAlphabet & | operator= (const WordAlphabet &bia) |
WordAlphabet * | clone () const |
virtual | ~WordAlphabet () |
bool | hasUniqueAlphabet () const |
Returns True if the Alphabet of the letters in the word are the same type. More... | |
unsigned int | getLength () const |
Returns the length of the word. More... | |
unsigned int | getNumberOfTypes () const |
Returns the number of resolved states + one for unresolved. More... | |
std::string | getAlphabetType () const |
Identification method. More... | |
int | getUnknownCharacterCode () const |
bool | isUnresolved (int state) const |
bool | isUnresolved (const std::string &state) const |
std::vector< int > | getAlias (int state) const throw (BadIntException) |
Get all resolved states that match a generic state. More... | |
std::vector< std::string > | getAlias (const std::string &state) const throw (BadCharException) |
Get all resolved states that match a generic state. More... | |
int | getGeneric (const std::vector< int > &states) const throw (BadIntException) |
Get the generic state that match a set of states. More... | |
std::string | getGeneric (const std::vector< std::string > &states) const throw (BadCharException) |
Get the generic state that match a set of states. More... | |
Methods redefined from Alphabet | |
std::string | getName (const std::string &state) const throw (BadCharException) |
Get the complete name of a state given its string description. More... | |
int | charToInt (const std::string &state) const throw (BadCharException) |
Give the int description of a state given its string description. More... | |
unsigned int | getSize () const |
Get the number of resolved states in the alphabet (e.g. return 4 for DNA alphabet). This is the method you'll need in most cases. More... | |
Word specific methods | |
const Alphabet * | getNAlphabet (size_t n) const |
Get the pointer to the Alphabet of the n-position. More... | |
virtual int | getWord (const std::vector< int > &vint, size_t pos=0) const throw (IndexOutOfBoundsException) |
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 throw (IndexOutOfBoundsException, BadCharException) |
Get the char code for a word given the char code of the underlying positions. More... | |
int | getNPosition (int word, size_t n) const throw (BadIntException) |
Get the int code of the n-position of a word given its int description. More... | |
std::vector< int > | getPositions (int word) const throw (BadIntException) |
Get the int codes of each position of a word given its int description. More... | |
std::string | getNPosition (const std::string &word, size_t n) const throw (BadCharException) |
Get the char code of the n-position of a word given its char description. More... | |
std::vector< std::string > | getPositions (const std::string &word) const throw (BadCharException) |
Get the char codes of each position of a word given its char description. More... | |
Sequence * | translate (const Sequence &sequence, size_t=0) const throw (AlphabetMismatchException, Exception) |
Translate a whole sequence from letters alphabet to words alphabet. More... | |
Sequence * | reverse (const Sequence &sequence) const throw (AlphabetMismatchException, Exception) |
Translate a whole sequence from words alphabet to letters alphabet. More... | |
Overloaded AbstractAlphabet methods. | |
unsigned int | getStateCodingSize () const |
Get the size of the string coding a state. More... | |
Implement these methods from the Alphabet interface. | |
size_t | getNumberOfStates () const |
This is a convenient alias for getNumberOfChars(), returning a size_t instead of unsigned int. More... | |
unsigned int | getNumberOfChars () const |
Get the number of supported characters in this alphabet, including generic characters (e.g. return 20 for DNA alphabet). More... | |
std::string | getName (int state) const throw (BadIntException) |
Get the complete name of a state given its int description. More... | |
std::string | intToChar (int state) const throw (BadIntException) |
Give the string description of a state given its int description. More... | |
bool | isIntInAlphabet (int state) const |
Tell if a state (specified by its int description) is allowed by the the alphabet. More... | |
bool | isCharInAlphabet (const std::string &state) const |
Tell if a state (specified by its string description) is allowed by the the alphabet. More... | |
const std::vector< int > & | getSupportedInts () const |
const std::vector< std::string > & | getSupportedChars () const |
int | getGapCharacterCode () const |
bool | isGap (int state) const |
bool | isGap (const std::string &state) const |
Specific methods to access AlphabetState | |
virtual AlphabetState & | getStateAt (size_t stateIndex) throw (IndexOutOfBoundsException) |
Get a state at a position in the alphabet_ vector. More... | |
virtual const AlphabetState & | getStateAt (size_t stateIndex) const throw (IndexOutOfBoundsException) |
Get a state at a position in the alphabet_ vector. More... | |
const AlphabetState & | getState (const std::string &letter) const throw (BadCharException) |
Get a state by its letter. More... | |
AlphabetState & | getState (const std::string &letter) throw (BadCharException) |
const AlphabetState & | getState (int num) const throw (BadIntException) |
Get a state by its num. More... | |
AlphabetState & | getState (int num) throw (BadIntException) |
int | getIntCodeAt (size_t stateIndex) const throw (IndexOutOfBoundsException) |
const std::string & | getCharCodeAt (size_t stateIndex) const throw (IndexOutOfBoundsException) |
size_t | getStateIndex (int state) const throw (BadIntException) |
size_t | getStateIndex (const std::string &state) const throw (BadCharException) |
Protected Member Functions | |
virtual void | registerState (AlphabetState *st) throw (Exception) |
Add a state to the Alphabet. More... | |
virtual void | setState (size_t pos, AlphabetState *st) throw (Exception, IndexOutOfBoundsException) |
Set a state in the Alphabet. More... | |
void | resize (size_t size) |
Resize the private alphabet_ vector. More... | |
void | remap () |
Re-update the maps using the alphabet_ vector content. More... | |
bool | equals (const Alphabet &alphabet) const |
Comparison of alphabets. More... | |
Protected Attributes | |
std::vector< const Alphabet *> | vAbsAlph_ |
Available codes | |
These vectors will be computed the first time you call the getAvailableInts or getAvailableChars method. | |
std::vector< std::string > | charList_ |
std::vector< int > | intList_ |
Private Member Functions | |
Inner utilitary functions | |
bool | containsUnresolved (const std::string &state) const throw (BadCharException) |
bool | containsGap (const std::string &state) const throw (BadCharException) |
void | build_ () |
The base class for word alphabets.
These alphabets are compounds of several alphabets. The only constraint on these alphabets is that their words have length one (so it is not possible to make WordAlphabets from other WordAlphabets). The construction is made from a vector of pointers to AbstractAlphabets.
The strings of the WordAlphabet are concatenations of the strings of the Alphabets. They are made from the resolved letters of the Alphabets.
Definition at line 66 of file WordAlphabet.h.
WordAlphabet::WordAlphabet | ( | const std::vector< const Alphabet *> & | vAlpha | ) |
Builds a new word alphabet from a vector of Alphabets.
The unit alphabets are not owned by the world alphabet, and won't be destroyed when this instance is destroyed.
vAlpha | The vector of Alphabets to be used. |
Definition at line 51 of file WordAlphabet.cpp.
References build_().
Referenced by clone().
WordAlphabet::WordAlphabet | ( | const Alphabet * | pAlpha, |
unsigned int | num | ||
) |
Builds a new word alphabet from a pointer to number of Alphabets.
pAlpha | The Pointer to the Alphabet to be used. |
num | the length of the words. |
Definition at line 58 of file WordAlphabet.cpp.
|
inline |
Definition at line 93 of file WordAlphabet.h.
|
inlinevirtual |
Definition at line 107 of file WordAlphabet.h.
|
private |
Definition at line 70 of file WordAlphabet.cpp.
References getSize(), bpp::AbstractAlphabet::registerState(), and vAbsAlph_.
Referenced by WordAlphabet().
|
inlinevirtual |
Give the int description of a state given its string description.
state | The string description. |
BadCharException | When state is not a valid char description. |
Reimplemented from bpp::AbstractAlphabet.
Definition at line 127 of file WordAlphabet.h.
References bpp::AbstractAlphabet::charToInt(), containsGap(), containsUnresolved(), getSize(), and vAbsAlph_.
Referenced by getNPosition(), getPositions(), bpp::EchinodermMitochondrialGeneticCode::isAltStart(), bpp::InvertebrateMitochondrialGeneticCode::isAltStart(), bpp::YeastMitochondrialGeneticCode::isAltStart(), bpp::MoldMitochondrialGeneticCode::isAltStart(), bpp::StandardGeneticCode::isAltStart(), bpp::VertebrateMitochondrialGeneticCode::isAltStart(), bpp::AscidianMitochondrialGeneticCode::isAltStart(), bpp::GeneticCode::isStart(), bpp::EchinodermMitochondrialGeneticCode::isStop(), bpp::StandardGeneticCode::isStop(), bpp::YeastMitochondrialGeneticCode::isStop(), bpp::MoldMitochondrialGeneticCode::isStop(), bpp::InvertebrateMitochondrialGeneticCode::isStop(), bpp::VertebrateMitochondrialGeneticCode::isStop(), bpp::AscidianMitochondrialGeneticCode::isStop(), and isUnresolved().
|
inlinevirtual |
Implements bpp::AbstractAlphabet.
Definition at line 102 of file WordAlphabet.h.
References WordAlphabet().
|
private |
Definition at line 175 of file WordAlphabet.cpp.
Referenced by charToInt().
|
private |
Definition at line 157 of file WordAlphabet.cpp.
Referenced by charToInt().
|
inlineprotectedvirtualinherited |
Comparison of alphabets.
Implements bpp::Alphabet.
Definition at line 268 of file AbstractAlphabet.h.
References bpp::Alphabet::getAlphabetType().
|
virtual |
Get all resolved states that match a generic state.
If the given state is not a generic code then the output vector will contain this unique code.
state | The alias to resolve. |
BadIntException | When state is not a valid integer. |
Reimplemented from bpp::AbstractAlphabet.
Definition at line 206 of file WordAlphabet.cpp.
|
virtual |
Get all resolved states that match a generic state.
If the given state is not a generic code then the output vector will contain this unique code.
state | The alias to resolve. |
BadCharException | When state is not a valid char description. |
Reimplemented from bpp::AbstractAlphabet.
Definition at line 230 of file WordAlphabet.cpp.
|
virtual |
Identification method.
Used to tell if two alphabets describe the same type of sequences. For instance, this method is used by sequence containers to compare two alphabets and allow or deny addition of sequences.
Implements bpp::Alphabet.
Definition at line 135 of file WordAlphabet.cpp.
References vAbsAlph_.
Referenced by hasUniqueAlphabet().
|
inlinevirtualinherited |
stateIndex | The index of the state to fetch. |
Implements bpp::Alphabet.
Definition at line 220 of file AbstractAlphabet.h.
References bpp::AlphabetState::getLetter(), and bpp::AbstractAlphabet::getStateAt().
|
inlinevirtualinherited |
Implements bpp::Alphabet.
Definition at line 159 of file AbstractAlphabet.h.
Referenced by bpp::SequenceTools::replaceStopsWithGaps().
|
virtual |
Get the generic state that match a set of states.
If the given states contain generic code, each generic code is first resolved and then the new generic state is returned. If only a single resolved state is given the function return this state.
states | A vector of states to resolve. |
BadIntException | When a state is not a valid integer. |
Reimplemented from bpp::AbstractAlphabet.
Definition at line 262 of file WordAlphabet.cpp.
|
virtual |
Get the generic state that match a set of states.
If the given states contain generic code, each generic code is first resolved and then the new generic state is returned. If only a single resolved state is given the function return this state.
states | A vector of states to resolve. |
BadCharException | when a state is not a valid char description. |
CharStateNotSupportedException | when the alphabet does not support Char state for unresolved state. |
Reimplemented from bpp::AbstractAlphabet.
Definition at line 269 of file WordAlphabet.cpp.
|
inlinevirtualinherited |
stateIndex | The index of the state to fetch. |
Implements bpp::Alphabet.
Definition at line 216 of file AbstractAlphabet.h.
References bpp::AlphabetState::getNum(), and bpp::AbstractAlphabet::getStateAt().
|
inline |
Returns the length of the word.
Definition at line 156 of file WordAlphabet.h.
References vAbsAlph_.
|
inline |
Get the pointer to the Alphabet of the n-position.
n | The position in the word (starting at 0). |
Definition at line 210 of file WordAlphabet.h.
References vAbsAlph_.
|
virtual |
Get the complete name of a state given its string description.
In case of undefined characters (i.e. N and X for nucleic alphabets), this method will return the name of the undefined word.
state | The string description of the given state. |
BadCharException | When state is not a valid char description. |
Reimplemented from bpp::AbstractAlphabet.
Definition at line 192 of file WordAlphabet.cpp.
References bpp::AbstractAlphabet::getName().
|
virtualinherited |
Get the complete name of a state given its int description.
In case of several states with identical number (i.e. N and X for nucleic alphabets), this method returns the name of the first found in the vector.
state | The int description of the given state. |
BadIntException | When state is not a valid integer. |
Implements bpp::Alphabet.
Definition at line 171 of file AbstractAlphabet.cpp.
|
inline |
Get the int code of the n-position of a word given its int description.
word | The int description of the word. |
n | The position in the word (starting at 0). |
Definition at line 248 of file WordAlphabet.h.
References bpp::AbstractAlphabet::intToChar(), and vAbsAlph_.
Referenced by bpp::SequenceContainerTools::getCodonPosition().
|
inline |
Get the char code of the n-position of a word given its char description.
word | The char description of the word. |
n | The position in the word (starting at 0). |
Definition at line 282 of file WordAlphabet.h.
References charToInt(), and vAbsAlph_.
|
inlinevirtualinherited |
Get the number of supported characters in this alphabet, including generic characters (e.g. return 20 for DNA alphabet).
Implements bpp::Alphabet.
Definition at line 146 of file AbstractAlphabet.h.
References bpp::AbstractAlphabet::alphabet_.
Referenced by getNumberOfTypes(), getSize(), and bpp::NucleicAlphabet::registerState().
|
inlinevirtualinherited |
This is a convenient alias for getNumberOfChars(), returning a size_t instead of unsigned int.
This funcion is typically used il loops over all states of an alphabet.
Implements bpp::Alphabet.
Definition at line 145 of file AbstractAlphabet.h.
References bpp::AbstractAlphabet::alphabet_.
|
inlinevirtual |
Returns the number of resolved states + one for unresolved.
Implements bpp::Alphabet.
Definition at line 166 of file WordAlphabet.h.
References bpp::AbstractAlphabet::getNumberOfChars().
|
inline |
Get the int codes of each position of a word given its int description.
word | The int description of the word. |
Definition at line 264 of file WordAlphabet.h.
References charToInt(), bpp::AbstractAlphabet::intToChar(), and vAbsAlph_.
Referenced by bpp::GeneticCode::isFourFoldDegenerated(), bpp::CodonSiteTools::numberOfSynonymousDifferences(), and bpp::CodonSiteTools::numberOfSynonymousPositions().
|
inline |
Get the char codes of each position of a word given its char description.
word | The char description of the word. |
Definition at line 300 of file WordAlphabet.h.
References charToInt().
|
inlinevirtual |
Get the number of resolved states in the alphabet (e.g. return 4 for DNA alphabet). This is the method you'll need in most cases.
Implements bpp::Alphabet.
Definition at line 138 of file WordAlphabet.h.
References bpp::AbstractAlphabet::getNumberOfChars().
Referenced by build_(), charToInt(), and getUnknownCharacterCode().
|
virtualinherited |
Get a state by its letter.
This method must be overloaded in specialized classes to send back a reference of the corect type.
letter | The letter of the state to find. |
BadCharException | If the letter is not in the Alphabet. |
Implements bpp::Alphabet.
Reimplemented in bpp::NucleicAlphabet, and bpp::ProteicAlphabet.
Definition at line 94 of file AbstractAlphabet.cpp.
Referenced by bpp::CaseMaskedAlphabet::CaseMaskedAlphabet(), bpp::ProteicAlphabet::getState(), and bpp::NucleicAlphabet::getState().
|
inherited |
Definition at line 130 of file AbstractAlphabet.cpp.
|
virtualinherited |
Get a state by its num.
This method must be overloaded in specialized classes to send back a reference of the corect type.
num | The num of the state to find. |
BadIntException | If the num is not in the Alphabet. |
Implements bpp::Alphabet.
Reimplemented in bpp::NucleicAlphabet, and bpp::ProteicAlphabet.
Definition at line 112 of file AbstractAlphabet.cpp.
|
inherited |
Definition at line 139 of file AbstractAlphabet.cpp.
|
virtualinherited |
Get a state at a position in the alphabet_ vector.
This method must be overloaded in specialized classes to send back a reference of the corect type.
stateIndex | The index of the state in the alphabet_ vector. |
IndexOutOfBoundsException | If the index is invalid. |
Reimplemented in bpp::NucleicAlphabet, bpp::NumericAlphabet, and bpp::ProteicAlphabet.
Definition at line 148 of file AbstractAlphabet.cpp.
Referenced by bpp::AbstractAlphabet::getCharCodeAt(), bpp::AbstractAlphabet::getIntCodeAt(), bpp::ProteicAlphabet::getStateAt(), bpp::NumericAlphabet::getStateAt(), and bpp::NucleicAlphabet::getStateAt().
|
virtualinherited |
Get a state at a position in the alphabet_ vector.
This method must be overloaded in specialized classes to send back a reference of the corect type.
stateIndex | The index of the state in the alphabet_ vector. |
IndexOutOfBoundsException | If the index is invalid. |
Implements bpp::Alphabet.
Reimplemented in bpp::NucleicAlphabet, bpp::NumericAlphabet, and bpp::ProteicAlphabet.
Definition at line 156 of file AbstractAlphabet.cpp.
|
inlinevirtual |
Get the size of the string coding a state.
Reimplemented from bpp::AbstractAlphabet.
Definition at line 339 of file WordAlphabet.h.
References vAbsAlph_.
|
virtualinherited |
Implements bpp::Alphabet.
Definition at line 121 of file AbstractAlphabet.cpp.
Referenced by bpp::AAIndex2Entry::getIndex().
|
virtualinherited |
Implements bpp::Alphabet.
Definition at line 103 of file AbstractAlphabet.cpp.
|
virtualinherited |
Note for developers of new alphabets: we return a const reference here since the list is supposed to be stored within the class and should not be modified outside the class.
Implements bpp::Alphabet.
Definition at line 301 of file AbstractAlphabet.cpp.
Referenced by bpp::CaseMaskedAlphabet::CaseMaskedAlphabet().
|
virtualinherited |
Note for developers of new alphabets: we return a const reference here since the list is supposed to be stored within the class and should not be modified outside the class.
Implements bpp::Alphabet.
Definition at line 284 of file AbstractAlphabet.cpp.
|
inlinevirtual |
Implements bpp::Alphabet.
Definition at line 173 of file WordAlphabet.h.
References getSize().
Referenced by bpp::AscidianMitochondrialGeneticCode::AscidianMitochondrialGeneticCode(), bpp::EchinodermMitochondrialGeneticCode::EchinodermMitochondrialGeneticCode(), bpp::InvertebrateMitochondrialGeneticCode::InvertebrateMitochondrialGeneticCode(), isUnresolved(), bpp::MoldMitochondrialGeneticCode::MoldMitochondrialGeneticCode(), bpp::StandardGeneticCode::StandardGeneticCode(), bpp::VertebrateMitochondrialGeneticCode::VertebrateMitochondrialGeneticCode(), and bpp::YeastMitochondrialGeneticCode::YeastMitochondrialGeneticCode().
|
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.
vint | description for all the positions. |
pos | the start position to match in the vector. |
IndexOutOfBoundsException | In case of wrong position. |
Definition at line 276 of file WordAlphabet.cpp.
|
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.
vpos | vector description for all the positions. |
pos | the start position to match in the vector. |
IndexOutOfBoundsException | In case of wrong position. |
Definition at line 292 of file WordAlphabet.cpp.
bool WordAlphabet::hasUniqueAlphabet | ( | ) | const |
Returns True if the Alphabet of the letters in the word are the same type.
Definition at line 146 of file WordAlphabet.cpp.
References getAlphabetType(), and vAbsAlph_.
|
virtualinherited |
Give the string description of a state given its int description.
state | The int description. |
BadIntException | When state is not a valid integer. |
Implements bpp::Alphabet.
Reimplemented in bpp::RNY.
Definition at line 185 of file AbstractAlphabet.cpp.
Referenced by bpp::RNY::getAlias(), bpp::GeneticCode::getCodingSequence(), getNPosition(), bpp::NucleicAlphabet::getOverlap(), getPositions(), bpp::EchinodermMitochondrialGeneticCode::isAltStart(), bpp::StandardGeneticCode::isAltStart(), bpp::YeastMitochondrialGeneticCode::isAltStart(), bpp::InvertebrateMitochondrialGeneticCode::isAltStart(), bpp::MoldMitochondrialGeneticCode::isAltStart(), bpp::AscidianMitochondrialGeneticCode::isAltStart(), bpp::VertebrateMitochondrialGeneticCode::isAltStart(), bpp::GeneticCode::isStart(), bpp::EchinodermMitochondrialGeneticCode::isStop(), bpp::StandardGeneticCode::isStop(), bpp::MoldMitochondrialGeneticCode::isStop(), bpp::YeastMitochondrialGeneticCode::isStop(), bpp::InvertebrateMitochondrialGeneticCode::isStop(), bpp::AscidianMitochondrialGeneticCode::isStop(), bpp::VertebrateMitochondrialGeneticCode::isStop(), and bpp::NucleicAlphabet::subtract().
|
virtualinherited |
Tell if a state (specified by its string description) is allowed by the the alphabet.
state | The string description. |
Implements bpp::Alphabet.
Reimplemented in bpp::LetterAlphabet.
Definition at line 202 of file AbstractAlphabet.cpp.
|
inlinevirtualinherited |
state | The state to test. |
Implements bpp::Alphabet.
Reimplemented in bpp::RNY, and bpp::NumericAlphabet.
Definition at line 160 of file AbstractAlphabet.h.
|
inlinevirtualinherited |
state | The state to test. |
Implements bpp::Alphabet.
Definition at line 161 of file AbstractAlphabet.h.
References bpp::AbstractAlphabet::charToInt().
|
virtualinherited |
Tell if a state (specified by its int description) is allowed by the the alphabet.
state | The int description. |
Implements bpp::Alphabet.
Definition at line 192 of file AbstractAlphabet.cpp.
|
inlinevirtual |
state | The state to test. |
Implements bpp::Alphabet.
Definition at line 178 of file WordAlphabet.h.
References getUnknownCharacterCode().
Referenced by bpp::CodonSiteTools::numberOfSynonymousPositions().
|
inlinevirtual |
state | The state to test. |
Implements bpp::Alphabet.
Definition at line 179 of file WordAlphabet.h.
References charToInt(), and getUnknownCharacterCode().
|
inline |
Definition at line 95 of file WordAlphabet.h.
References bpp::AbstractAlphabet::operator=(), and vAbsAlph_.
Referenced by bpp::CodonAlphabet::operator=().
|
protectedvirtualinherited |
Add a state to the Alphabet.
st | The state to add. |
Exception | If a wrong alphabet state is provided. |
Reimplemented in bpp::LetterAlphabet, bpp::NucleicAlphabet, bpp::NumericAlphabet, and bpp::DefaultAlphabet.
Definition at line 70 of file AbstractAlphabet.cpp.
Referenced by bpp::BinaryAlphabet::BinaryAlphabet(), build_(), bpp::IntegerAlphabet::IntegerAlphabet(), bpp::DefaultAlphabet::registerState(), bpp::NumericAlphabet::registerState(), bpp::LetterAlphabet::registerState(), and bpp::RNY::RNY().
|
inlineprotectedinherited |
Re-update the maps using the alphabet_ vector content.
Definition at line 258 of file AbstractAlphabet.h.
References bpp::AbstractAlphabet::alphabet_, bpp::AbstractAlphabet::letters_, bpp::AbstractAlphabet::nums_, and bpp::AbstractAlphabet::updateMaps_().
Referenced by bpp::NumericAlphabet::remap().
|
inlineprotectedinherited |
Resize the private alphabet_ vector.
size | The new size of the Alphabet. |
Definition at line 253 of file AbstractAlphabet.h.
References bpp::AbstractAlphabet::alphabet_.
Referenced by bpp::IntegerAlphabet::IntegerAlphabet().
Sequence * WordAlphabet::reverse | ( | const Sequence & | sequence | ) | const |
throw | ( | AlphabetMismatchException, | |||
Exception | |||||
) |
Translate a whole sequence from words alphabet to letters alphabet.
sequence | A sequence in words alphabet. |
AlphabetMismatchException | If the sequence alphabet do not match the target alphabet. |
Exception | Other kind of error, depending on the implementation. |
Definition at line 333 of file WordAlphabet.cpp.
References bpp::Sequence::append(), and bpp::BasicSymbolList::size().
|
protectedvirtualinherited |
Set a state in the Alphabet.
pos | The index of the state in the alphabet_ vector. |
st | The new state to put in the Alphabet. |
Exception | If a wrong alphabet state is provided. |
IndexOutOfBoundsException | If an incorrect index is provided. |
Reimplemented in bpp::LetterAlphabet, bpp::NucleicAlphabet, and bpp::NumericAlphabet.
Definition at line 79 of file AbstractAlphabet.cpp.
Referenced by bpp::NumericAlphabet::setState(), and bpp::LetterAlphabet::setState().
Sequence * WordAlphabet::translate | ( | const Sequence & | sequence, |
size_t | pos = 0 |
||
) | const | ||
throw | ( | AlphabetMismatchException, | |
Exception | |||
) |
Translate a whole sequence from letters alphabet to words alphabet.
sequence | A sequence in letters alphabet. |
pos | the start postion (default 0) |
AlphabetMismatchException | If the sequence alphabet do not match the source alphabet. |
Exception | Other kind of error, depending on the implementation. |
Definition at line 309 of file WordAlphabet.cpp.
|
mutableprotectedinherited |
Definition at line 99 of file AbstractAlphabet.h.
Referenced by bpp::AbstractAlphabet::operator=().
|
mutableprotectedinherited |
Definition at line 100 of file AbstractAlphabet.h.
Referenced by bpp::AbstractAlphabet::operator=().
|
protected |
Definition at line 70 of file WordAlphabet.h.
Referenced by build_(), charToInt(), bpp::CodonAlphabet::getAlphabetType(), getAlphabetType(), getLength(), getNAlphabet(), getNPosition(), bpp::CodonAlphabet::getNucleicAlphabet(), getPositions(), getStateCodingSize(), hasUniqueAlphabet(), operator=(), and WordAlphabet().