yat  0.12.3pre
DNA.h
1 #ifndef theplu_yat_omic_dna
2 #define theplu_yat_omic_dna
3 
4 // $Id: DNA.h 3114 2013-11-10 23:51:47Z peter $
5 
6 /*
7  Copyright (C) 2010, 2011, 2012, 2013 Peter Johansson
8 
9  This file is part of the yat library, http://dev.thep.lu.se/yat
10 
11  The yat library is free software; you can redistribute it and/or
12  modify it under the terms of the GNU General Public License as
13  published by the Free Software Foundation; either version 3 of the
14  License, or (at your option) any later version.
15 
16  The yat library is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  General Public License for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with yat. If not, see <http://www.gnu.org/licenses/>.
23 */
24 
25 #include <boost/operators.hpp>
26 
27 #include <iosfwd>
28 #include <string>
29 #include <vector>
30 
31 namespace theplu {
32 namespace yat {
33 namespace omic {
34 
61  class DNA : boost::operators<DNA>
62  {
63  public:
69  DNA(void);
70 
74  DNA(const DNA&);
75 
83  explicit DNA(char c);
84 
92  DNA complement(void) const;
93 
97  char get(void) const;
98 
107  DNA& operator&=(const DNA& rhs);
108 
117  DNA& operator|=(const DNA& rhs);
118 
127  DNA& operator^=(const DNA& rhs);
128 
136  DNA& operator=(char c);
137 
138  private:
139  unsigned short code_;
140  static std::vector<unsigned short> char2code_;
141  static std::string code2char_;
142 
143  void init(void) const;
144 
145  friend bool operator==(const DNA&, const DNA&);
146 };
147 
155  std::string expand(const DNA&);
156 
168  bool operator==(const DNA& lhs, const DNA& rhs);
169 
177  std::ostream& operator<<(std::ostream& os, const DNA& dna);
178 }}}
179 #endif
DNA & operator=(char c)
assign from a char
DNA complement(void) const
DNA & operator|=(const DNA &rhs)
DNA & operator&=(const DNA &rhs)
DNA(void)
Default Constructor.
DNA & operator^=(const DNA &rhs)
Definition: DNA.h:61

Generated on Mon Jun 1 2015 12:29:51 for yat by  doxygen 1.8.5