0929bd18b7d41b4f485e5493e0e1dc90c18f8487
[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
22 // FLP = Fixed Length Pairs (Data)
23 // vector of linked lists of the match type struct
24 class FLPs
25 {
26   private:
27     int window_size;
28     int hard_threshold;
29     int seq1_length, seq2_length, seq1_win_num, seq2_win_num;
30     std::string ana_type;
31
32     struct match
33     {
34       int index;
35       int score;
36     };
37
38   public:
39     FLPs();
40     void setup(std::string type, int win_size, int hard_thres, int len1, int len2);
41     inline void add(int seq1_i, int seq2_i, int a_score, int i2_offset);
42     void seqcomp(std::string seq1, std::string seq2, bool is_RC);
43   //bool FLPs::match_less(match *match1, match *match2);
44   //void FLPs::sort();
45     std::list<int> matches(int index);
46   //version with int threshold 
47     std::list<int> thres_matches(int index, int thres);
48     int win_num();
49     void file_save(std::string save_file_path);
50     void file_load(std::string file_path);
51
52     std::vector<std::list<match> > all_matches;
53 };
54 #endif