// ----------------------------------------
// ---------- flp.hh -----------
// ----------------------------------------
+#include <boost/filesystem/path.hpp>
#include <list>
#include <string>
#include <vector>
#include <iostream>
+class Sequence;
//! FLP = Fixed Length Pairs (Data)
/*!
* vector of linked lists of the match type struct
*/
class FLPs
{
- public:
+public:
+ typedef size_t size_type;
+
FLPs();
+ FLPs(const FLPs& );
//! Setup a FLP and reserve space for the match lists
/*!
* Initialize the all_matches structure with a list of matches
void setup(int win_size, int hard_thres);
//! compare two sequences and store the list of results in all_matches
- void seqcomp(std::string seq1, std::string seq2, bool is_RC);
+ void seqcomp(const Sequence& seq1, const Sequence& seq2, bool is_RC);
//bool FLPs::match_less(match *match1, match *match2);
//void FLPs::sort();
- //! Return all the matches for a particular window?
+ //! Return all the matches for a particular window? (index and score pairs)
std::list<match> matches(int index) const;
//! Return all the match indexes for a particular window?
std::list<int> match_locations(int index) const;
*/
int size() const;
//! Save all the FLPs to save_file_path
- void save(std::string save_file_path);
+ void save(boost::filesystem::path save_file_path);
//! Load a vector of a lists of FLPs
- void load(std::string file_path);
+ void load(boost::filesystem::path file_path);
+
+ //! how far we are through current seqcomp
+ float progress() const;
+
+ const static int seqcomp_not_running = -1;
private:
//! the number of base pairs in the sliding window
int window_size;
/*! this is mostly so seqcomp can use operator[]
*/
void alloc_matches(std::string::size_type len1=0);
-
-
+
+ //! make sure that a sequence is acceptable to seqcomp
+ void validate_sequence(const Sequence&) const;
+
+ //! current loop index
+ int seqcomp_i;
+ //! end seqcomp index (when terminating, seqcomp_i == seqcomp_end.
+ //! when not running seqcomp_i == seqcomp_end == seqcomp_not_running
+ int seqcomp_end;
};
#endif