bpp-seq3  3.0.0
DefaultAlphabet.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: The Bio++ Development Group
2 //
3 // SPDX-License-Identifier: CECILL-2.1
4 
5 #ifndef BPP_SEQ_ALPHABET_DEFAULTALPHABET_H
6 #define BPP_SEQ_ALPHABET_DEFAULTALPHABET_H
7 
8 #include <Bpp/Text/TextTools.h>
9 
10 #include "LetterAlphabet.h"
11 
12 namespace bpp
13 {
21  public LetterAlphabet
22 {
23 protected:
24  std::string chars_;
25 
26 public:
27  // class constructor
29 
31 
33  {
35  chars_ = bia.chars_;
36  return *this;
37  }
38 
40  {
41  return new DefaultAlphabet(*this);
42  }
43 
44 
45  // class destructor
46  virtual ~DefaultAlphabet() {}
47 
48 public:
49  unsigned int getSize() const { return 26; }
50  unsigned int getNumberOfTypes() const { return 27; }
51  std::string getAlphabetType() const { return "Default"; }
52  int getUnknownCharacterCode() const { return 37; }
53  bool isUnresolved(int state) const { return state == 37; }
54  bool isUnresolved(const std::string& state) const { return false; }
55 };
56 } // end of namespace bpp.
57 #endif // BPP_SEQ_ALPHABET_DEFAULTALPHABET_H
The DefaultAlphabet class.
DefaultAlphabet * clone() const
bool isUnresolved(int state) const
bool isUnresolved(const std::string &state) const
int getUnknownCharacterCode() const
unsigned int getNumberOfTypes() const
Get the number of distinct states in alphabet (e.g. return 15 for DNA alphabet). This is the number o...
unsigned int getSize() const
Get the number of resolved states in the alphabet (e.g. return 4 for DNA alphabet)....
DefaultAlphabet & operator=(const DefaultAlphabet &bia)
DefaultAlphabet(const DefaultAlphabet &bia)
std::string getAlphabetType() const
Identification method.
Specialized partial implementation of Alphabet using single letters.
LetterAlphabet & operator=(const LetterAlphabet &bia)
This alphabet is used to deal NumericAlphabet.