00001 #ifndef theplu_yat_omic_dna
00002 #define theplu_yat_omic_dna
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include <boost/operators.hpp>
00026
00027 #include <iosfwd>
00028 #include <map>
00029 #include <string>
00030 #include <vector>
00031
00032 namespace theplu {
00033 namespace yat {
00034 namespace omic {
00035
00062 class DNA : boost::operators<DNA>
00063 {
00064 public:
00070 DNA(void);
00071
00075 DNA(const DNA&);
00076
00084 explicit DNA(char c);
00085
00093 DNA complement(void) const;
00094
00098 char get(void) const;
00099
00108 DNA& operator&=(const DNA& rhs);
00109
00118 DNA& operator|=(const DNA& rhs);
00119
00128 DNA& operator^=(const DNA& rhs);
00129
00130 private:
00131 unsigned short code_;
00132 static std::map<char, unsigned short> char2code_;
00133 static std::vector<char> code2char_;
00134
00135 void init(void) const;
00136
00137 friend bool operator==(const DNA&, const DNA&);
00138 };
00139
00147 std::string expand(const DNA&);
00148
00160 bool operator==(const DNA& lhs, const DNA& rhs);
00161
00169 std::ostream& operator<<(std::ostream& os, const DNA& dna);
00170 }}}
00171 #endif