track where our analysis is saved and if the analysis is empty
[mussa.git] / alg / mussa.cpp
index 6990db7bac926b554651cc151f4959c12c5e9a0e..194501dad670fbb497756da0f507ffac40f4d79e 100644 (file)
@@ -44,12 +44,18 @@ Mussa::Mussa(const Mussa& m)
     thres_append(m.thres_append),
     motif_sequences(m.motif_sequences),
     color_mapper(m.color_mapper),
+    analysis_path(m.analysis_path),
     dirty(m.dirty)
 {
   connect(&the_paths, SIGNAL(progress(const std::string&, int, int)), 
           this, SIGNAL(progress(const std::string&, int, int)));
 }
 
+boost::filesystem::path Mussa::get_analysis_path() const
+{
+  return analysis_path;
+}
+
 // set all parameters to null state
 void
 Mussa::clear()
@@ -63,10 +69,23 @@ Mussa::clear()
   thres_append = false;
   motif_sequences.clear();
   if(color_mapper) color_mapper->clear();
+  the_seqs.clear();
   the_paths.clear();
+  analysis_path = fs::path();
   dirty = false;
 }
 
+bool Mussa::is_dirty() const
+{
+  return dirty;
+}
+
+bool Mussa::empty() const
+{
+  return the_seqs.empty();
+}
+
+
 // these 5 simple methods manually set the parameters for doing an analysis
 // used so that the gui can take input from user and setup the analysis
 // note - still need a set_append(bool, bool) method...
@@ -556,6 +575,7 @@ Mussa::save(fs::path save_path)
     }
   }
   dirty = false;
+  analysis_path = save_path;
 }
 
 void
@@ -577,6 +597,7 @@ Mussa::load(fs::path ana_file)
   vector<FLPs> empty_FLP_vector;
   FLPs dummy_comp;
 
+  analysis_path = ana_file;
   //clog << "ana_file name " << ana_file.string() << endl;
   analysis_name = ana_path.leaf();
   //clog << " ana_name " << analysis_name << endl;