load and display a motif list
[mussa.git] / alg / sequence.hpp
index 9b52497ea181dd752092295cf50e03ff82979caa..e4771f200c97960d44a5eaf89a89d4019c206601 100644 (file)
@@ -28,8 +28,10 @@ struct annot
   annot();
   annot(int start, int end, std::string type, std::string name);
   
-  int start, end;
-  std::string name, type;
+  int start;
+  int end;
+  std::string type;
+  std::string name;
 };
 
 /* The way that motifs are found currently doesn't really 
@@ -59,7 +61,6 @@ class Sequence
 
     void motif_scan(std::string a_motif, std::vector<int> * motif_match_starts);
     std::string rc_motif(std::string a_motif);
-    std::string motif_validate(std::string a_motif);
   public:
     typedef std::string::iterator iterator;
     typedef std::string::const_iterator const_iterator;
@@ -109,8 +110,19 @@ class Sequence
 
     const std::string& get_header() const;
     //! add a motif to our list of motifs
+    /*! \throws motif_normalize_error if there's something wrong with a_motif
+     */
     void add_motif(std::string a_motif);
+    //! clear our list of found motifs
+    void clear_motifs();
+    //! search a sequence for a_motif
+    /*! \throws motif_normalize_error if there's something wrong with a_motif
+     */
     std::vector<int> find_motif(std::string a_motif);
+    //! convert IUPAC symbols to upperase
+    /*! \throws motif_normalize_error if there is an invalid symbol
+     */
+    static std::string motif_normalize(std::string a_motif);
     void save(std::fstream &save_file);
     void load_museq(std::string load_file_path, int seq_num); 
 };