yat  0.14.5pre
DNA.h
1 #ifndef theplu_yat_omic_dna
2 #define theplu_yat_omic_dna
3 
4 // $Id: DNA.h 3550 2017-01-03 05:41:02Z peter $
5 
6 /*
7  Copyright (C) 2010, 2011, 2012, 2013, 2016 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 
141  unsigned short char2code(char) const;
142  char code2char(unsigned short) const;
143  friend bool operator==(const DNA&, const DNA&);
144 };
145 
153  std::string expand(const DNA&);
154 
166  bool operator==(const DNA& lhs, const DNA& rhs);
167 
175  std::ostream& operator<<(std::ostream& os, const DNA& dna);
176 }}}
177 #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 Tue Sep 26 2017 02:33:29 for yat by  doxygen 1.8.5