From: Diane Trout Date: Thu, 29 Jun 2006 01:16:00 +0000 (+0000) Subject: break the core of add_motifs loop into a seperate function X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=mussa.git;a=commitdiff_plain;h=1e542af4d46a4f028b9ca331dd27e7e6bbe0bf38 break the core of add_motifs loop into a seperate function --- diff --git a/alg/mussa.cpp b/alg/mussa.cpp index 79078b2..2391b04 100644 --- a/alg/mussa.cpp +++ b/alg/mussa.cpp @@ -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& motifs, const vector& colors) { @@ -719,8 +725,7 @@ void Mussa::add_motifs(const vector& 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(); } diff --git a/alg/mussa.hpp b/alg/mussa.hpp index 2566349..7307005 100644 --- a/alg/mussa.hpp +++ b/alg/mussa.hpp @@ -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