libsequence  1.9.5
SeqAlphabets.hpp
Go to the documentation of this file.
1 #ifndef __SEQUENCE_SEQALPHABETS_HPP__
3 #define __SEQUENCE_SEQALPHABETS_HPP__
4 
5 #include <array>
6 #include <functional>
7 
12 namespace Sequence {
13 
18  using alphabet_t = std::array<const char,16>;
19 
29  extern const alphabet_t dna_alphabet;
30 
37  extern const alphabet_t dna_poly_alphabet;
38 
44  extern const alphabet_t::size_type NOTPOLYCHAR;
45 
50  extern const alphabet_t::size_type POLYEOS;
51 
59  bool isDNA( const char & ch);
60 
66  struct ambiguousNucleotide : public std::unary_function<char,bool>
67  {
72  bool operator()(const char & c) const;
73  };
74 
83  struct invalidPolyChar : public std::unary_function<char,bool>
84  {
91  bool operator()(const char & nucleotide) const;
92  };
93 }
94 
95 #endif
bool isDNA(const char &ch)
test if character is part of Sequence::dna_alphabet
Definition: SeqAlphabets.cc:25
std::array< const char, 16 > alphabet_t
Container type for nucleotide alphabets.
Tests if a character is in the set A,G,C,T.
The namespace in which this library resides.
const alphabet_t dna_alphabet
Alphabet for DNA sequences Valid DNA characters. Upper-case only. Only - is accepted as gap character...
Definition: SeqAlphabets.cc:8
bool operator()(const char &c) const
Definition: SeqAlphabets.cc:32
This functor can be used to determine if a range contains characters that the SNP analysis routines i...
const alphabet_t::size_type NOTPOLYCHAR
An index from dna_poly_alphabet >= this is not a valid character for variation analysis.
Definition: SeqAlphabets.cc:18
const alphabet_t dna_poly_alphabet
Alphabet for polymorphism (SNP) analysis. 16 characters are used so that we may encode 2 nucleotides ...
Definition: SeqAlphabets.cc:13
const alphabet_t::size_type POLYEOS
The value of terminating an encoded string of SNP data.
Definition: SeqAlphabets.cc:20