attach motifs to a sequence object
[mussa.git] / alg / sequence.hpp
index 39313bede0ab0351c444db00381042e10b1096df..9b52497ea181dd752092295cf50e03ff82979caa 100644 (file)
 //! Attach annotation information to a sequence track
 struct annot
 {
+  annot();
+  annot(int start, int end, std::string type, std::string name);
+  
   int start, end;
   std::string name, type;
 };
 
+/* The way that motifs are found currently doesn't really 
+ * indicate that the match was a reverse compliment
+ */
+struct motif : public annot
+{
+  std::string sequence;
+
+  //! this constructor is for when we're adding motifs to our annotations
+  motif(int start, std::string motif);
+};
+
 //! sequence track for mussa.
 class Sequence
 {
@@ -40,6 +54,8 @@ class Sequence
     std::string species;
 
     std::list<annot> annots;
+    //! a seperate list for motifs since we're currently not saving them
+    std::list<motif> motif_list;
 
     void motif_scan(std::string a_motif, std::vector<int> * motif_match_starts);
     std::string rc_motif(std::string a_motif);
@@ -69,7 +85,8 @@ class Sequence
     /*! \throws mussa_load_error 
      */
     void load_annot(const std::string file_path, int start_index, int end_index);
-    const std::list<annot> annotations() const;
+    const std::list<annot>& annotations() const;
+    const std::list<motif>& motifs() const;
 
     // simple access functions
     void set_seq(const std::string& a_seq);
@@ -91,6 +108,8 @@ class Sequence
     void clear();
 
     const std::string& get_header() const;
+    //! add a motif to our list of motifs
+    void add_motif(std::string a_motif);
     std::vector<int> find_motif(std::string a_motif);
     void save(std::fstream &save_file);
     void load_museq(std::string load_file_path, int seq_num);