break the core of add_motifs loop into a seperate function
authorDiane Trout <diane@caltech.edu>
Thu, 29 Jun 2006 01:16:00 +0000 (01:16 +0000)
committerDiane Trout <diane@caltech.edu>
Thu, 29 Jun 2006 01:16:00 +0000 (01:16 +0000)
alg/mussa.cpp
alg/mussa.hpp

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();
 }
index 25663494bd339091f9056a07d920ec58b0d6cf6d..73070050327d407ac84b65beeba7a377d969f961 100644 (file)
@@ -143,6 +143,8 @@ public:
     void load_old(char * load_file_path, int s_num);
 
     // manage motif lists
+    void add_motif(const std::string& motifs, 
+                   const Color& colors);
     //! add vector of motifs and colors to our motif collection
     /*! this depends on sets and color maps being unique
      *  (aka if you add the same item more than once it doesn't