go back to sequence being its own class
[mussa.git] / alg / flp_seqcomp.cpp
index 73150280c16235b0d40b0e9d7a03809a09896657..2c7ad7a4adb9cb2145461149f74f32e55cf49d25 100644 (file)
@@ -14,6 +14,7 @@
 
 #include "mussa_exceptions.hpp"
 #include "alg/flp.hpp"
+#include "alg/sequence.hpp"
 #include <cassert>
 #include <sstream>
 using namespace std;
@@ -46,12 +47,14 @@ FLPs::add(int seq1_i, int seq2_i, int a_score, int i2_offset)
 
 
 void
-FLPs::seqcomp(string sseq1, string sseq2, bool is_RC)
+FLPs::seqcomp(const Sequence& sseq1, const Sequence& sseq2, bool is_RC)
 {
   int start_i, seq1_i, seq2_i, win_i;      // loop variables
   int matches;                    // number of matches in to a window
   int i2_offset;
-  char * seq1, * seq2;
+  Sequence::const_iterator seq1 = sseq1.begin();
+  Sequence::const_iterator seq2 = sseq2.begin();
+
   int seq1_win_num = sseq1.size() - window_size + 1;
   int seq2_win_num = sseq2.size() - window_size + 1;
   alloc_matches(sseq1.size());
@@ -62,9 +65,6 @@ FLPs::seqcomp(string sseq1, string sseq2, bool is_RC)
     throw mussa_error(msg.str());
   }
 
-  seq1 = (char *) sseq1.c_str();
-  seq2 = (char *) sseq2.c_str();
-
   if (is_RC)
     i2_offset = window_size - sseq2.size();
   else