a27de82b89c62824807bb0e410d5867706ac304d
[mussa.git] / mussa_class.hh
1 //                        ----------------------------------------
2 //                          ---------- mussa_class.hh -----------
3 //                        ----------------------------------------
4
5 #include "mussa_nway.hh"
6 #include "time.h"
7
8 string int_to_str(int an_int);
9
10
11 class Mussa
12 {
13   friend class MussaOverlord;
14   friend class ConnWindow;
15
16   private:
17     // Private variables
18     // parameters needed for a mussa analysis
19     string ana_name;
20     int seq_num, window, threshold, soft_thres;
21     char ana_mode;
22     double ent_thres;
23     list<string> seq_files, annot_files;
24     list<int> fasta_indices, sub_seq_starts, sub_seq_ends;
25     bool win_override, thres_override;
26     bool win_append, thres_append;
27
28     // sequence data
29     vector<Sequence> the_Seqs;
30     // the seqcomp data
31     vector<vector<FLPs> > all_comps;
32     // N-way data, ie the mussa results  
33     Nway_Paths the_paths;
34
35
36     // Private methods
37     string get_Seqs();
38     void seqcomp();
39     void nway();
40
41
42   public:
43     Mussa();  
44
45     // parameters need to be set before calling this
46     // w & t are for command line override functionality, set to 0 to ignore
47     string analyze(int w, int t, char ana_mode, double ent_thres);
48     void save();
49     void save_muway(string save_path);
50     string load(string ana_file);
51
52     // clear parameters and initialize data lists
53     void clear();
54
55     // set parameters from a file - 'mupa' ~ mussa parameters
56     string load_mupa_file(string para_file_path);
57
58     // set parameters individually (eg from user input into gui classes)
59     void set_name(string a_name);
60     void set_seq_num(int a_num);
61     void set_window(int a_window);
62     void set_threshold(int a_threshold);
63     void set_soft_thres(int sft_thres);
64     void set_ana_mode(char new_ana_mode);
65    // sets an individual sequence to a string (no ATCGN checking atm) 
66     void add_a_seq(string a_seq);
67     // sets info to load a seq and annotations from a fasta file 
68     void set_seq_info(string seq_file, string annot_file, int fa_i, int a_start,                      int the_end);
69
70     // deprecated - support bridge for python version of mussa
71     // these save & load from the old file format
72     void save_old();
73     void load_old(char * load_file_path, int s_num);
74 };
75