//the_paths.save("tmp.save");
}
+void Mussa::add_motifs(const vector<string>& motifs,
+ const vector<Color>& colors)
+{
+ if (motifs.size() != colors.size()) {
+ throw mussa_error("motif and color vectors must be the same size");
+ }
+
+ for(size_t i = 0; i != motifs.size(); ++i)
+ {
+ motif_sequences.insert(motifs[i]);
+ color_mapper.appendInstanceColor("motif", motifs[i], colors[i]);
+ }
+ update_sequences_motifs();
+}
+
// I mostly split the ifstream out so I can use a stringstream to test it.
void Mussa::load_motifs(std::istream &in)
{
continue;
}
}
+ update_sequences_motifs();
+}
+
+void Mussa::load_motifs(string filename)
+{
+ ifstream f;
+ f.open(filename.c_str(), ifstream::in);
+ load_motifs(f);
+}
+
+void Mussa::update_sequences_motifs()
+{
// once we've loaded all the motifs from the file,
// lets attach them to the sequences
for(vector<Sequence>::iterator seq_i = the_seqs.begin();
}
}
-void Mussa::load_motifs(string filename)
+const set<string>& Mussa::motifs() const
{
- ifstream f;
- f.open(filename.c_str(), ifstream::in);
- load_motifs(f);
+ return motif_sequences;
}
AnnotationColors& Mussa::colorMapper()