645a069b00791eb733e830947bda93db5d45d061
[mussa.git] / mussa_nway.hh
1 #ifndef _MUSSA_NWAY_H_
2 #define _MUSSA_NWAY_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 //                         ----------  mussa_nway.hh  -----------
15 //                        ----------------------------------------
16
17 #include <list>
18 #include <string>
19 #include <vector>
20
21 #include "flp.hh"
22
23
24 class Nway_Paths
25 {
26   friend class ConnView;
27   friend class SeqView;
28   private:
29     int species_num;
30     int threshold;
31     int win_size;
32     int soft_thres;
33
34     double ent_thres;
35     std::vector<char *> c_sequences;
36
37     std::list<std::vector<int> > pathz;
38     std::list<std::vector<int> > refined_pathz;
39
40
41
42   public:
43     Nway_Paths();
44     void setup(int sp_num, int w, int t);
45     void setup_ent(double new_entropy_thres, std::vector<std::string> some_Seqs);
46     void set_soft_thres(int soft_thres);
47
48     void radiate_path_search(std::vector<std::vector<FLPs> > all_comparisons);
49     void trans_path_search(std::vector<std::vector<FLPs> > all_comparisons);
50     void entropy_path_search(std::vector<std::vector<FLPs> > all_comparisons);
51     double path_entropy(std::vector<int> path);
52
53   // old recursive transitive nway ... has issues checking all links?
54     void find_paths_r(std::vector<std::vector<FLPs> > all_comparisons);
55     void path_search(std::vector<std::vector<FLPs> > all_comparisons, std::vector<int> path, int depth);
56
57     void simple_refine();
58     void save(std::string save_file_path);
59     std::string load(std::string load_file_path);
60     void add_path(std::vector<int> loaded_path);
61     int seq_num();
62
63     void find_paths(std::vector<std::vector<FLPs> > all_comparisons);
64     void refine();
65
66     void save_old(std::string save_file_path);
67     void print();
68 };
69 #endif