1 #ifndef _MUSSA_CLASS_H_
2 #define _MUSSA_CLASS_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
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.
13 // ----------------------------------------
14 // ---------- mussa_class.hh -----------
15 // ----------------------------------------
21 #include "alg/nway_paths.hpp"
22 #include "alg/sequence.hpp"
24 std::string int_to_str(int an_int);
28 friend class ConnWindow;
30 enum analysis_modes { TransitiveNway, RadialNway, EntropyNway,
36 void save_muway(std::string save_path);
37 //! load a saved analysis directory
38 void load(std::string ana_path);
40 //! clear parameters and initialize data lists
43 // set parameters from a file - 'mupa' ~ mussa parameters
44 void load_mupa_file(std::string para_file_path);
46 // set parameters individually (eg from user input into gui classes)
48 void set_name(std::string a_name);
49 //! return name for this analysis
50 std::string get_name();
52 //! return number of sequences in this analyzis
53 /*! this returns either the_seqs.size() or seq_files.size()
54 * depending on which has data loaded in
55 * (silly delayed loading of sequence data)
58 //! set number of bases for this window size
59 void set_window(int a_window);
60 //! get number of bases for the sliding window
61 int get_window() const;
62 //! set number of bases that must match for a window to be saved
63 void set_threshold(int a_threshold);
64 //! get number of bases that must match for a window to be saved
65 int get_threshold() const;
66 void set_soft_thres(int sft_thres);
68 void set_analysis_mode(enum analysis_modes new_ana_mode);
69 enum analysis_modes get_analysis_mode() const;
70 //! return a string name for an analysis mode
71 std::string get_analysis_mode_name() const;
73 //! return the refined paths found by the nway analysis.
74 const NwayPaths& paths() const;
76 //! run seqcomp and the nway filtering algorithm.
77 /*!analyze will run seqcomp and then the nway algorithm
78 * on whatever sequences have been loaded into this mussa instance.
79 * w & t are for command line override functionality, set to 0 to ignore
80 * \throws mussa_analysis_error
82 void analyze(int w=0, int t=0,
83 enum analysis_modes ana_mode=TransitiveNway,
84 double ent_thres=0.0);
85 /*! Run the nway filtering algorithm,
86 * this might be used when changing the soft threshhold?
90 //! appends a string sequence to the list of the_seqs
91 void add_a_seq(std::string a_seq);
92 // sets info to load a seq and annotations from a fasta file
93 void set_seq_info(std::string seq_file, std::string annot_file,
94 int fa_i, int a_start, int the_end);
95 //! allow examining the sequences we have loaded
96 const std::vector<Sequence>& sequences() const;
98 // deprecated - support bridge for python version of mussa
99 // these save & load from the old file format
101 void load_old(char * load_file_path, int s_num);
105 // parameters needed for a mussa analysis
106 std::string analysis_name;
107 std::string file_path_base;
108 int window, threshold, soft_thres;
109 enum analysis_modes ana_mode;
111 std::list<std::string> seq_files, annot_files;
112 std::list<int> fasta_indices, sub_seq_starts, sub_seq_ends;
113 bool win_override, thres_override;
114 bool win_append, thres_append;
117 std::vector<Sequence> the_seqs;
119 std::vector<std::vector<FLPs> > all_comps;
120 //! N-way data, ie the mussa results
124 //! loads sequence and annotations from fasta and annotation file
125 void load_sequence_data();