bpp-seq3  3.0.0
DNA.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_DNA_H
6 #define BPP_SEQ_ALPHABET_DNA_H
7 
8 
9 #include "NucleicAlphabet.h"
10 
11 // From the STL:
12 #include <string>
13 #include <vector>
14 
15 namespace bpp
16 {
24 class DNA :
25  public NucleicAlphabet
26 {
27 public:
32  DNA(bool exclamationMarkCountsAsGap = false);
33 
34  DNA(const DNA& bia) : NucleicAlphabet(bia) {}
35 
36  DNA& operator=(const DNA& bia)
37  {
39  return *this;
40  }
41 
42  DNA* clone() const
43  {
44  return new DNA(*this);
45  }
46 
47  virtual ~DNA() {}
48 
49 public:
50  bool isResolvedIn(int state1, int state2) const;
51 
52  std::vector<int> getAlias(int state) const;
53  std::vector<std::string> getAlias(const std::string& state) const;
54  int getGeneric(const std::vector<int>& states) const;
55  std::string getGeneric(const std::vector<std::string>& states) const;
56  std::string getAlphabetType() const { return "DNA"; }
57 };
58 } // end of namespace bpp.
59 #endif // BPP_SEQ_ALPHABET_DNA_H
This alphabet is used to deal with DNA sequences.
Definition: DNA.h:26
std::vector< int > getAlias(int state) const
Get all resolved states that match a generic state.
Definition: DNA.cpp:85
DNA & operator=(const DNA &bia)
Definition: DNA.h:36
DNA(bool exclamationMarkCountsAsGap=false)
Definition: DNA.cpp:20
bool isResolvedIn(int state1, int state2) const
Tells if a given (potentially unresolved) state can be resolved in another resolved state.
Definition: DNA.cpp:52
std::string getAlphabetType() const
Identification method.
Definition: DNA.h:56
virtual ~DNA()
Definition: DNA.h:47
DNA(const DNA &bia)
Definition: DNA.h:34
DNA * clone() const
Definition: DNA.h:42
int getGeneric(const std::vector< int > &states) const
Get the generic state that match a set of states.
Definition: DNA.cpp:123
The abstract base class for nucleic alphabets.
NucleicAlphabet & operator=(const NucleicAlphabet &bia)
This alphabet is used to deal NumericAlphabet.