add callback for tracking analysis progress
[mussa.git] / alg / mussa.hpp
index 2ba11719bed212cbef33c4ce9093652a2919451c..cfb9ece6b95b9ef95d4ffce13283e8b9d03081b9 100644 (file)
@@ -22,6 +22,7 @@
 #include <istream>
 
 #include "alg/annotation_colors.hpp"
+#include "alg/mussa_callback.hpp"
 #include "alg/nway_paths.hpp"
 #include "alg/sequence.hpp"
 
@@ -29,7 +30,6 @@ std::string int_to_str(int an_int);
 
 class Mussa
 {
-  friend class ConnWindow;
   public:
     enum analysis_modes { TransitiveNway, RadialNway, EntropyNway, 
                           RecursiveNway };
@@ -62,6 +62,10 @@ class Mussa
      *  (silly delayed loading of sequence data)
      */
     int size() const;
+
+    void set_analysis_callback(analysis_callback cb);
+    analysis_callback get_analysis_calback() const;
+
     //! set number of bases for this window size
     void set_window(int a_window);
     //! get number of bases for the sliding window
@@ -94,12 +98,9 @@ class Mussa
     //! run seqcomp and the nway filtering algorithm.
     /*!analyze will run seqcomp and then the nway algorithm
      * on whatever sequences have been loaded into this mussa instance.
-     * w & t are for command line override functionality, set to 0 to ignore
      * \throws mussa_analysis_error 
      */
-    void analyze(int w=0, int t=0, 
-                 enum analysis_modes ana_mode=TransitiveNway,
-                 double ent_thres=0.0);
+    void analyze();
     /*! Run the nway filtering algorithm, 
      *  this might be used when changing the soft threshhold?
      */
@@ -173,6 +174,8 @@ class Mussa
     bool win_append; 
     //! should we append _t<threshold> to the saved analysis
     bool thres_append;
+    //! callback, periodically called as we run an analysis
+    analysis_callback analysis_cb;
 
     //! sequence data
     std::vector<Sequence> the_seqs;
@@ -187,7 +190,7 @@ class Mussa
     AnnotationColors color_mapper;
 
     // Private methods
-    //! loads sequence and annotations from fasta and annotation file
+    //! runs all the seqcomps needed to support the nway comparison
     void seqcomp();
 
 };