copy motifs to a new subanalysis
[mussa.git] / alg / sequence.cpp
index 270cc4e9ed5900db1eed1f7c4e37978fa47b9409..7538e4649cb2852d468e1549a53469d60a5c94b1 100644 (file)
@@ -921,12 +921,12 @@ Sequence::motif_scan(const Sequence& a_motif, std::vector<int> * motif_match_sta
   Sequence::value_type motif_char;
   Sequence::value_type seq_char;
 
-  while (seq_i < seq->length())
+  while (seq_i < size())
   {
     // this is pretty much a straight translation of Nora's python code
     // to match iupac letter codes
     motif_char = toupper(a_motif[motif_i]);
-    seq_char = toupper(seq->at(seq_i));
+    seq_char = toupper(seq->at(seq_start+seq_i));
     if (motif_char =='N')
       motif_i++;
     else if (motif_char == seq_char)