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