5 #ifndef BPP_SEQ_ALPHABET_ALPHABET_H
6 #define BPP_SEQ_ALPHABET_ALPHABET_H
68 #pragma GCC diagnostic push
69 #pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
98 public std::enable_shared_from_this<Alphabet>
112 #pragma GCC diagnostic pop
125 virtual std::string
getName(
int state)
const = 0;
137 virtual std::string
getName(
const std::string& state)
const = 0;
245 virtual int charToInt(
const std::string& state)
const = 0;
315 virtual std::vector<int>
getAlias(
int state)
const = 0;
326 virtual std::vector<std::string>
getAlias(
const std::string& state)
const = 0;
338 virtual int getGeneric(
const std::vector<int>& states)
const = 0;
351 virtual std::string
getGeneric(
const std::vector<std::string>& states)
const = 0;
394 virtual bool isGap(
int state)
const = 0;
400 virtual bool isGap(
const std::string& state)
const = 0;
This is the base class to describe states in an Alphabet.
virtual unsigned int getNumberOfChars() const =0
Get the number of supported characters in this alphabet, including generic characters (e....
virtual bool isUnresolved(const std::string &state) const =0
virtual size_t getNumberOfStates() const =0
This is a convenient alias for getNumberOfChars(), returning a size_t instead of unsigned int.
virtual const std::vector< std::string > & getResolvedChars() const =0
virtual std::string getAlphabetType() const =0
Identification method.
virtual const std::vector< int > & getSupportedInts() const =0
virtual bool isResolvedIn(int state1, int state2) const =0
Tells if a given (potentially unresolved) state can be resolved in another resolved state.
virtual std::string getName(const std::string &state) const =0
Get the complete name of a state given its string description.
virtual std::vector< int > getAlias(int state) const =0
Get all resolved states that match a generic state.
virtual bool equals(const Alphabet &alphabet) const =0
Comparison of alphabets.
virtual std::string intToChar(int state) const =0
Give the string description of a state given its int description.
virtual std::string getName(int state) const =0
Get the complete name of a state given its int description.
virtual bool isUnresolved(int state) const =0
virtual int charToInt(const std::string &state) const =0
Give the int description of a state given its string description.
virtual bool isGap(int state) const =0
virtual const std::vector< std::string > & getSupportedChars() const =0
virtual std::vector< std::string > getAlias(const std::string &state) const =0
Get all resolved states that match a generic state.
virtual unsigned int getNumberOfTypes() const =0
Get the number of distinct states in alphabet (e.g. return 15 for DNA alphabet). This is the number o...
virtual int getGapCharacterCode() const =0
virtual std::string getGeneric(const std::vector< std::string > &states) const =0
Get the generic state that match a set of states.
virtual bool isCharInAlphabet(const std::string &state) const =0
Tell if a state (specified by its string description) is allowed by the the alphabet.
virtual ~Alphabet()=default
virtual int getUnknownCharacterCode() const =0
virtual size_t getStateIndex(int state) const =0
virtual int getIntCodeAt(size_t stateIndex) const =0
virtual bool isIntInAlphabet(int state) const =0
Tell if a state (specified by its int description) is allowed by the the alphabet.
virtual int getGeneric(const std::vector< int > &states) const =0
Get the generic state that match a set of states.
virtual unsigned int getStateCodingSize() const =0
Get the size of the string coding a state.
virtual unsigned int getSize() const =0
Get the number of resolved states in the alphabet (e.g. return 4 for DNA alphabet)....
virtual const std::string & getCharCodeAt(size_t stateIndex) const =0
virtual const AlphabetState & getState(int state) const =0
Get a state given its int description.
virtual size_t getStateIndex(const std::string &state) const =0
virtual const AlphabetState & getState(const std::string &state) const =0
Get a state given its string description.
virtual const AlphabetState & getStateAt(size_t stateIndex) const =0
Get a state given its index.
Alphabet * clone() const =0
virtual bool isGap(const std::string &state) const =0
This alphabet is used to deal NumericAlphabet.