massive code move
[mussa.git] / flp.hh
1 #ifndef _MUSSA_FLP_H_
2 #define _MUSSA_FLP_H_
3 //  This file is part of the Mussa source distribution.
4 //  http://mussa.caltech.edu/
5 //  Contact author: Tristan  De Buysscher, tristan@caltech.edu
6
7 // This program and all associated source code files are Copyright (C) 2005
8 // the California Institute of Technology, Pasadena, CA, 91125 USA.  It is
9 // under the GNU Public License; please see the included LICENSE.txt
10 // file for more information, or contact Tristan directly.
11
12
13 //                        ----------------------------------------
14 //                            ---------- flp.hh  -----------
15 //                        ----------------------------------------
16
17 #include <list>
18 #include <string>
19 #include <vector>
20
21 //! FLP = Fixed Length Pairs (Data)
22 /*!
23  * vector of linked lists of the match type struct
24  */
25 class FLPs
26 {
27   private:
28     //! the number of base pairs used to compute this sliding window
29     int window_size;
30     //! the minimum tnumber of base pairs need for this window to be saved.
31     int hard_threshold;
32     int seq1_length, seq2_length, seq1_win_num, seq2_win_num;
33     std::string ana_type;
34
35     struct match
36     {
37       int index;
38       int score;
39     };
40
41   public:
42     FLPs();
43     void setup(std::string type, int win_size, int hard_thres, int len1, int len2);
44     inline void add(int seq1_i, int seq2_i, int a_score, int i2_offset);
45     void seqcomp(std::string seq1, std::string seq2, bool is_RC);
46   //bool FLPs::match_less(match *match1, match *match2);
47   //void FLPs::sort();
48     std::list<int> matches(int index);
49   //version with int threshold 
50     std::list<int> thres_matches(int index, int thres);
51     int win_num();
52     void file_save(std::string save_file_path);
53     void file_load(std::string file_path);
54
55     std::vector<std::list<match> > all_matches;
56 };
57 #endif