Getting closer to a subanalysis mode
[mussa.git] / alg / mussa.hpp
index 6f7d0a33fb5c4846f6d252e953e9b8c83dad13b0..25663494bd339091f9056a07d920ec58b0d6cf6d 100644 (file)
@@ -16,6 +16,7 @@
 #include <QObject> 
 
 #include <boost/filesystem/path.hpp>
+#include <boost/shared_ptr.hpp>
 
 #include <list>
 #include <string>
@@ -113,8 +114,10 @@ public:
 
     //! appends a string sequence to the list of the_seqs
     // void append_sequence(std::string a_seq);
-    //! appends a sequence to the list of the_seqs
-    void append_sequence(Sequence a_seq);
+    //! appends a sequence to the list of the_seqs (makes copy)
+    void append_sequence(const Sequence& a_seq);
+    //! append a sequence to the list of seqs (shared)
+    void append_sequence(boost::shared_ptr<Sequence> a_seq);
 
     //! Load a sequence from a fasta file and any annotations
     /*! \param[in] seq_file the full path to the fasta file
@@ -131,7 +134,8 @@ public:
                        boost::filesystem::path annot_file, 
                        int fasta_index, int sub_seq_start=0, int sub_seq_end=0);
     //! allow examining the sequences we have loaded
-    const std::vector<Sequence>& sequences() const;
+    typedef std::vector<boost::shared_ptr<Sequence> > vector_sequence_type;
+    const vector_sequence_type& sequences() const;
 
     // deprecated - support bridge for python version of mussa
     // these save & load from the old file format
@@ -160,7 +164,7 @@ public:
     const std::set<std::string>& motifs() const;
 
     //! return color mapper
-    AnnotationColors& colorMapper();
+    boost::shared_ptr<AnnotationColors> colorMapper();
 
   private:
     //! push motifs to our attached sequences
@@ -184,7 +188,7 @@ public:
     bool thres_append;
 
     //! sequence data
-    std::vector<Sequence> the_seqs;
+    vector_sequence_type the_seqs;
     //! the seqcomp data
     std::vector<std::vector<FLPs> > all_comps;
     //! N-way data, ie the mussa results  
@@ -193,7 +197,7 @@ public:
     //! motif list
     std::set<std::string> motif_sequences;
     //! color manager
-    AnnotationColors color_mapper;
+    boost::shared_ptr<AnnotationColors> color_mapper;
 
     // Private methods
     //! runs all the seqcomps needed to support the nway comparison