Move alphabet type into SeqString
[mussa.git] / alg / motif_parser.cpp
index 633e905bd07f1f83d7d3636ab857e42babf0a1cf..c59c2873e160d697ab46d2b08510d1d985f905cf 100644 (file)
@@ -1,6 +1,7 @@
 #include "mussa_exceptions.hpp"
-#include "alg/alphabet.hpp"
-#include "alg/motif_parser.hpp"
+#include "alphabet.hpp"
+#include "motif_parser.hpp"
+#include "seq.hpp"
 
 #include <boost/spirit/core.hpp>
 #include <boost/spirit/actor/push_back_actor.hpp>
@@ -56,7 +57,7 @@ void motif_parser::push_motif::operator()(
   Iterator end) const
 {
   float red, green, blue, alpha;
-  Sequence seq(parsed->sequence, Sequence::nucleic_alphabet);
+  Sequence seq(parsed->sequence, nucleic_alphabet);
   seq.set_fasta_header(parsed->name);
   
   alpha = 1.0;
@@ -74,7 +75,8 @@ void motif_parser::push_motif::operator()(
     break;
   }
   Color c(red, green, blue, alpha);
-  parsed->color_mapper->appendInstanceColor("motif", seq.c_str(), c);
+  std::string motif_subseq(seq.begin(), seq.end());
+  parsed->color_mapper->appendInstanceColor("motif", motif_subseq, c);
   parsed->motifs.insert(seq);
   
   parsed->sequence.clear();
@@ -129,4 +131,4 @@ void motif_parser::ParsedMotifs::parse(const std::string &data)
     motifs.clear();
     throw motif_load_error(msg.str());
   }
-}
\ No newline at end of file
+}