Update mussa to build on ubuntu 10.04 with qt 4.6.2 +boost 1.40.0.1
[mussa.git] / alg / conserved_path.hpp
index cc2dda1736a9a6b326dfd14ac1153c907de010db..7ff26613ab23ae2ea5ce16998348a022dfaaeccc 100644 (file)
@@ -13,7 +13,7 @@ struct ConservedPath
 
   ConservedPath();
   ConservedPath(const ConservedPath& );
-  ConservedPath(double score, path_type path);
+  ConservedPath(size_t window_size, double score, path_type path);
 
   //! reset our path to be empty (including setting threshold to 0)
   void clear();
@@ -29,38 +29,28 @@ struct ConservedPath
 
   friend bool operator==(const ConservedPath& a, const ConservedPath &b);
   friend bool operator!=(const ConservedPath& a, const ConservedPath &b);
+  friend bool operator<(const ConservedPath& a, const ConservedPath &b);
   friend std::ostream& operator<<(std::ostream&, const ConservedPath&);
 
   //! return true if all elements of the path are "next to" our current path.
   /*! Next to is defined as being window index + 1
    *  that definition may not properly track reverse compliment
+   *  \throws conserved_path_size_mismatch
    */
   bool nextTo(const ConservedPath& next) const;
   //! indicate which elements of the path are reversed
   std::vector<bool> reverseComplimented() const;
+  //! return the list of indexes normalized (to the left)
+  path_type normalizedIndexes() const;
+  //! extend our current path
+  //! (aka increment our window size  by growth)
+  ConservedPath& extend(int growth=1);
 
+  //! window size (really should always be positive
+  size_t window_size;
   //! either number of conserved bases or average entropy
   double score;
   //! offsets into each of our sequences representing the start of our window
-  std::vector<path_element> track_indexes;
-};
-
-struct ExtendedConservedPath : public ConservedPath
-{
-  ExtendedConservedPath();
-  ExtendedConservedPath(const ExtendedConservedPath& other);
-  ExtendedConservedPath(int win_size, ConservedPath conserved_path);
-  ExtendedConservedPath(int win_size, double score, std::vector<int> path);
-
-  //! extend our current path
-  /*! (aka increment our window size  by growth)
-   */
-  ExtendedConservedPath& extend(int growth=1);
-
-  // output some useful information
-  friend std::ostream& operator<<(std::ostream&, const ExtendedConservedPath&);
-
-  //! size of extended window
-  int window_size;
+  path_type track_indexes;
 };
 #endif