5 #ifndef BPP_SEQ_ALPHABET_NUCLEICALPHABET_H
6 #define BPP_SEQ_ALPHABET_NUCLEICALPHABET_H
59 throw Exception(
"NucleicAlphabet::registerState. Incorrect alphabet type.");
68 throw Exception(
"NucleicAlphabet::setState. Incorrect alphabet type.");
121 std::map<int, size_t>::const_iterator it =
binCodes_.find(code);
123 throw BadIntException(code,
"NucleicAlphabet::getState(unsigned char): Binary code not in alphabet",
this);
173 std::string
subtract(
const std::string& s1,
const std::string& s2)
const
224 std::string
getOverlap(
const std::string& s1,
const std::string& s2)
const
virtual AlphabetState & getStateAt(size_t stateIndex)
Get a state at a position in the alphabet_ vector.
unsigned int getNumberOfChars() const
Get the number of supported characters in this alphabet, including generic characters (e....
const AlphabetState & getState(const std::string &letter) const
Get a state by its letter.
std::string intToChar(int state) const
Give the string description of a state given its int description.
This is the base class to describe states in an Alphabet.
int getNum() const
Get the state's number.
An alphabet exception thrown when trying to specify a bad int to the alphabet.
Specialized partial implementation of Alphabet using single letters.
void registerState(AlphabetState *st)
Add a state to the Alphabet.
LetterAlphabet & operator=(const LetterAlphabet &bia)
void setState(size_t pos, AlphabetState *st)
Set a state in the Alphabet.
int charToInt(const std::string &state) const
Give the int description of a state given its string description.
This is the base class to describe states in a NucleicAlphabet.
int getBinaryCode() const
Get the state's binary representation.
The abstract base class for nucleic alphabets.
NucleicAlphabetState & getStateAt(size_t stateIndex)
Get a state at a position in the alphabet_ vector.
void setState(size_t pos, AlphabetState *st)
Set a state in the Alphabet.
virtual NucleicAlphabet * clone() const =0
int getOverlap(int s1, int s2) const
Get the overlap between to states.
const NucleicAlphabetState & getStateByBinCode(int code) const
Get a state by its binary representation.
int getUnknownCharacterCode() const
const NucleicAlphabetState & getState(const std::string &letter) const
Get a state by its letter.
unsigned int getNumberOfTypes() const
Get the number of distinct states in alphabet (e.g. return 15 for DNA alphabet). This is the number o...
bool isUnresolved(int state) const
const NucleicAlphabetState & getState(int num) const
Get a state by its num.
void registerState(AlphabetState *st)
Add a state to the Alphabet.
bool isUnresolved(const std::string &state) const
std::string subtract(const std::string &s1, const std::string &s2) const
Subtract states.
NucleicAlphabet & operator=(const NucleicAlphabet &bia)
std::string getOverlap(const std::string &s1, const std::string &s2) const
Get the overlap between to states.
unsigned int getSize() const
Get the number of resolved states in the alphabet (e.g. return 4 for DNA alphabet)....
void updateBinMaps_(size_t pos, const NucleicAlphabetState &st)
const NucleicAlphabetState & getStateAt(size_t stateIndex) const
Get a state at a position in the alphabet_ vector.
virtual ~NucleicAlphabet()
int subtract(int s1, int s2) const
Subtract states.
std::map< int, size_t > binCodes_
NucleicAlphabet(const NucleicAlphabet &bia)
This alphabet is used to deal NumericAlphabet.