break the core of add_motifs loop into a seperate function
[mussa.git] / alg / mussa.cpp
index 79078b2cb1447b3ba4c2ca46d0a3500116fc2337..2391b0478080863d196271df6d1204e04d175787 100644 (file)
@@ -710,6 +710,12 @@ Mussa::load_old(char * load_file_path, int s_num)
   //the_paths.save("tmp.save");
 }
 
+void Mussa::add_motif(const string& motif, const Color& color)
+{
+  motif_sequences.insert(motif);
+  color_mapper->appendInstanceColor("motif", motif, color);
+}
+
 void Mussa::add_motifs(const vector<string>& motifs, 
                        const vector<Color>& colors)
 {
@@ -719,8 +725,7 @@ void Mussa::add_motifs(const vector<string>& motifs,
 
   for(size_t i = 0; i != motifs.size(); ++i)
   {
-    motif_sequences.insert(motifs[i]);
-    color_mapper->appendInstanceColor("motif", motifs[i], colors[i]);
+    add_motif(motifs[i], colors[i]);
   }
   update_sequences_motifs();
 }