make headers less interdependent
authorDiane Trout <diane@caltech.edu>
Fri, 3 Feb 2006 02:30:04 +0000 (02:30 +0000)
committerDiane Trout <diane@caltech.edu>
Fri, 3 Feb 2006 02:30:04 +0000 (02:30 +0000)
The mussa headers all depended on including each other to get
all of the right include files. This has been broken and files are more
explicit at including what they depend on.

Also based on Accellerated C++, I followed the convention that header files
should never do a using namespace std, on the off chance that someone
wants to redefine something in the std namespace.

30 files changed:
flp.cc
flp.hh
flp_seqcomp.cc
mussa.cc
mussa_class.cc
mussa_class.hh
mussa_gui_annot_window.cc
mussa_gui_annot_window.hh
mussa_gui_conn_view.cc
mussa_gui_conn_view.hh
mussa_gui_conn_window.cc
mussa_gui_conn_window.hh
mussa_gui_load_window.cc
mussa_gui_load_window.hh
mussa_gui_motif_window.cc
mussa_gui_motif_window.hh
mussa_gui_seq.cc
mussa_gui_seq.hh
mussa_gui_seq_text.cc
mussa_gui_seq_text.hh
mussa_gui_seq_view.cc
mussa_gui_seq_view.hh
mussa_gui_subana.cc
mussa_gui_subana.hh
mussa_nway.cc
mussa_nway.hh
mussa_nway_entropy.cc
mussa_nway_other.cc
sequence.cc
sequence.hh

diff --git a/flp.cc b/flp.cc
index 801060c2b928163456c53e4b0ee040298b848e6a..73527d2c37905c96c8c7e9615a2942453b18f194 100644 (file)
--- a/flp.cc
+++ b/flp.cc
 
 #include "flp.hh"
 
+#include <fstream>
+#include <iostream>
+
+using namespace std;
 
 FLPs::FLPs()
 {
diff --git a/flp.hh b/flp.hh
index 094cdbef0ea8b8a8c2f2889d1f86dcdf4346cde8..0929bd18b7d41b4f485e5493e0e1dc90c18f8487 100644 (file)
--- a/flp.hh
+++ b/flp.hh
@@ -1,3 +1,5 @@
+#ifndef _MUSSA_FLP_H_
+#define _MUSSA_FLP_H_
 //  This file is part of the Mussa source distribution.
 //  http://mussa.caltech.edu/
 //  Contact author: Tristan  De Buysscher, tristan@caltech.edu
@@ -12,7 +14,9 @@
 //                            ---------- flp.hh  -----------
 //                        ----------------------------------------
 
-#include "sequence.hh"
+#include <list>
+#include <string>
+#include <vector>
 
 
 // FLP = Fixed Length Pairs (Data)
@@ -23,8 +27,7 @@ class FLPs
     int window_size;
     int hard_threshold;
     int seq1_length, seq2_length, seq1_win_num, seq2_win_num;
-    string ana_type;
-
+    std::string ana_type;
 
     struct match
     {
@@ -32,22 +35,20 @@ class FLPs
       int score;
     };
 
-
-
-
   public:
     FLPs();
-    void setup(string type, int win_size, int hard_thres, int len1, int len2);
+    void setup(std::string type, int win_size, int hard_thres, int len1, int len2);
     inline void add(int seq1_i, int seq2_i, int a_score, int i2_offset);
-    void seqcomp(string seq1, string seq2, bool is_RC);
+    void seqcomp(std::string seq1, std::string seq2, bool is_RC);
   //bool FLPs::match_less(match *match1, match *match2);
   //void FLPs::sort();
-    list<int> matches(int index);
+    std::list<int> matches(int index);
   //version with int threshold 
-    list<int> thres_matches(int index, int thres);
+    std::list<int> thres_matches(int index, int thres);
     int win_num();
-    void file_save(string save_file_path);
-    void file_load(string file_path);
+    void file_save(std::string save_file_path);
+    void file_load(std::string file_path);
 
-    vector<list<match> > all_matches;
+    std::vector<std::list<match> > all_matches;
 };
+#endif
index e48a3b55372251b0afcb116c8b587f4b405a8d9a..43ba7c0e1c5738a543ebcf7f79c2aa327d73d390 100644 (file)
@@ -13,6 +13,7 @@
 //                        ----------------------------------------
 
 #include "flp.hh"
+using namespace std;
 
 // Note one recording RC matches.  This version of 'seqcomp' records RC matches
 // as index of the window start in its nonRC form.  However, past versions of
index 150d92f9e3043f658d4e76d7ab0ef1be524d2c62..d3d48f546d59b07b1df72da1af0d3e7636f2005e 100644 (file)
--- a/mussa.cc
+++ b/mussa.cc
@@ -9,7 +9,8 @@
 
 
 #include "mussa_gui_conn_window.hh"
-
+#include <iostream>
+using namespace std;
 
 char
 parse_args(int argc, char **argv, string *a_file_path, int *window, 
index dd9e7689addba8467da5d619e83c6262bed21be4..a6597ed8c7974a1109b1dbd36cadf65f03452bd2 100644 (file)
 //                        ----------------------------------------
 
 #include "mussa_class.hh"
+
+#include <fstream>
+#include <iostream>
 #include <sstream>
 
+using namespace std;
+
 Mussa::Mussa()
 {
 }
index c6b3ae80f3f94432c459c61425755a90e3f38e6f..efa6e91ab44f3d415bc5b7dac44707341bc3dbf4 100644 (file)
@@ -1,3 +1,5 @@
+#ifndef _MUSSA_CLASS_H_
+#define _MUSSA_CLASS_H_
 //  This file is part of the Mussa source distribution.
 //  http://mussa.caltech.edu/
 //  Contact author: Tristan  De Buysscher, tristan@caltech.edu
 //                          ---------- mussa_class.hh -----------
 //                        ----------------------------------------
 
+#include <list>
+#include <string>
+#include <vector>
+
 #include "mussa_nway.hh"
-#include "time.h"
+#include "sequence.hh"
 
-string int_to_str(int an_int);
+std::string int_to_str(int an_int);
 
 
 class Mussa
@@ -26,25 +32,25 @@ class Mussa
   private:
     // Private variables
     // parameters needed for a mussa analysis
-    string ana_name, file_path_base;
+    std::string ana_name, file_path_base;
     int seq_num, window, threshold, soft_thres;
     char ana_mode;
     double ent_thres;
-    list<string> seq_files, annot_files;
-    list<int> fasta_indices, sub_seq_starts, sub_seq_ends;
+    std::list<std::string> seq_files, annot_files;
+    std::list<int> fasta_indices, sub_seq_starts, sub_seq_ends;
     bool win_override, thres_override;
     bool win_append, thres_append;
 
     // sequence data
-    vector<Sequence> the_Seqs;
+    std::vector<Sequence> the_Seqs;
     // the seqcomp data
-    vector<vector<FLPs> > all_comps;
+    std::vector<std::vector<FLPs> > all_comps;
     // N-way data, ie the mussa results  
     Nway_Paths the_paths;
 
 
     // Private methods
-    string get_Seqs();
+    std::string get_Seqs();
     void seqcomp();
     void nway();
 
@@ -54,32 +60,33 @@ class Mussa
 
     // parameters need to be set before calling this
     // w & t are for command line override functionality, set to 0 to ignore
-    string analyze(int w, int t, char ana_mode, double ent_thres);
+    std::string analyze(int w, int t, char ana_mode, double ent_thres);
     void save();
-    void save_muway(string save_path);
-    string load(string ana_file);
+    void save_muway(std::string save_path);
+    std::string load(std::string ana_file);
 
     // clear parameters and initialize data lists
     void clear();
 
     // set parameters from a file - 'mupa' ~ mussa parameters
-    string load_mupa_file(string para_file_path);
+    std::string load_mupa_file(std::string para_file_path);
 
     // set parameters individually (eg from user input into gui classes)
-    void set_name(string a_name);
+    void set_name(std::string a_name);
     void set_seq_num(int a_num);
     void set_window(int a_window);
     void set_threshold(int a_threshold);
     void set_soft_thres(int sft_thres);
     void set_ana_mode(char new_ana_mode);
    // sets an individual sequence to a string (no ATCGN checking atm) 
-    void add_a_seq(string a_seq);
+    void add_a_seq(std::string a_seq);
     // sets info to load a seq and annotations from a fasta file 
-    void set_seq_info(string seq_file, string annot_file, int fa_i, int a_start,                      int the_end);
+    void set_seq_info(std::string seq_file, std::string annot_file, 
+                      int fa_i, int a_start, int the_end);
 
     // deprecated - support bridge for python version of mussa
     // these save & load from the old file format
     void save_old();
     void load_old(char * load_file_path, int s_num);
 };
-
+#endif
index 26f733d83c80c9040a098a6609e0fc7930aa13c1..daa6a0f8adfbe218023c9635c5b944568ad1daf6 100644 (file)
@@ -9,8 +9,10 @@
 
 
 #include "mussa_gui_annot_window.hh"
+#include <iostream>
+#include <FL/fl_show_colormap.H>
 
-
+using namespace std;
 
 annot_color
 new_blank_annot()
index 9229713fa0da14f6634e73c3617a953e82413949..bd1a60c1fc64a3003f2d459819213e3edfbebfa2 100644 (file)
@@ -1,3 +1,5 @@
+#ifndef _MUSSA_GUI_ANNOT_WINDOW_H_
+#define _MUSSA_GUI_ANNOT_WINDOW_H_
 //  This file is part of the Mussa source distribution.
 //  http://mussa.caltech.edu/
 //  Contact author: Tristan  De Buysscher, tristan@caltech.edu
@@ -7,21 +9,22 @@
 // under the GNU Public License; please see the included LICENSE.txt
 // file for more information, or contact Tristan directly.
 
+#include <list>
+#include <string>
+#include <vector>
 
-#include "mussa_gui_motif_window.hh"
-
-#include <FL/Fl.H>
 #include <FL/Fl_Window.H>
 #include <FL/Fl_Button.H>
 
 #include <FL/Fl_Input.H>
 #include <FL/Fl_Output.H>
 #include <FL/Fl_Pack.H>
-#include <FL/fl_show_colormap.H>
+
+#include "mussa_gui_motif_window.hh"
 
 struct annot_color
 {
-  string type;
+  std::string type;
   Fl_Color color;
 };
 
@@ -32,12 +35,12 @@ class AnnotWindow : public Fl_Window
 { 
   public:
     AnnotWindow(int w, int h, const char* title, 
-               vector<annot_color> * some_annots);
+               std::vector<annot_color> * some_annots);
     ~AnnotWindow();
     Fl_Pack * annot_input_pack;
-    list<Fl_Output*> annot_ins;
-    vector<Fl_Button*> annot_color_buttons;
-    list<Fl_Input*> name_ins;
+    std::list<Fl_Output*> annot_ins;
+    std::vector<Fl_Button*> annot_color_buttons;
+    std::list<Fl_Input*> name_ins;
     Fl_Button* test;
     Fl_Button* add_annot;
 
@@ -45,7 +48,7 @@ class AnnotWindow : public Fl_Window
     void cb_annot_color_i(Fl_Button* o, int i);
 
   private:
-    vector<annot_color> * the_annots;
+    std::vector<annot_color> * the_annots;
     int annot_count;
 
     void add_annot_input(int index);
@@ -66,3 +69,4 @@ struct annot_instance
 };
 
 annot_color new_blank_annot();
+#endif
index a77afa87e6455b9cd36bc51b6ac38ec3ab128a1c..2c91da7410babc1d1f56742e77aace0590ca9d6e 100644 (file)
@@ -10,7 +10,9 @@
 
 #include "mussa_gui_conn_view.hh"
 
-
+#include <iomanip>
+#include <math.h>
+using namespace std;
 
 void
 ConnView::setup(string name, int sq_num, int win_len,
index 7f29004552b6c171951807733152c83f058ccfdc..75d5b5bb0804fad76435d4a0101edad353053cee 100644 (file)
@@ -1,3 +1,5 @@
+#ifndef _MUSSA_GUI_CONN_VIEW_H_
+#define _MUSSA_GUI_CONN_VIEW_H_
 //  This file is part of the Mussa source distribution.
 //  http://mussa.caltech.edu/
 //  Contact author: Tristan  De Buysscher, tristan@caltech.edu
@@ -7,10 +9,14 @@
 // under the GNU Public License; please see the included LICENSE.txt
 // file for more information, or contact Tristan directly.
 
+#include <list>
+#include <sstream>
+#include <string>
+#include <vector>
 
+#include "mussa_gui_annot_window.hh"
 #include "mussa_gui_subana.hh"
 
-#include <sstream>
 
 class ConnView : public Fl_Box
 {
@@ -19,8 +25,8 @@ class ConnView : public Fl_Box
       Fl_Box(x_top,y_top,x_bot,y_bot)
     {}
 
-    void setup(string name, int sq_num, int win_len,
-               vector<Sequence> *, Nway_Paths *);
+    void setup(std::string name, int sq_num, int win_len,
+               std::vector<Sequence> *, Nway_Paths *);
     void scale_paths();
 
     void spawnSeq();
@@ -34,12 +40,12 @@ class ConnView : public Fl_Box
 
 
   private:
-    string ana_name;
+    std::string ana_name;
     int seq_num, window, threshold;
     bool win_append, thres_append;
 
   //this data is passed as pointers to the instantiated classes
-    vector<Sequence> *S;
+    std::vector<Sequence> *S;
     Nway_Paths *P;
 
     int name_pad, y_pad;
@@ -49,21 +55,21 @@ class ConnView : public Fl_Box
     float y_drag_start;
     int ref_seq_num, max_seq_len;
     bool dragging, selected;
-    list<bool> highlight;
+    std::list<bool> highlight;
 
   //path data scaled for current view size
-    list<vector<int> > scaled_pathz;
-    vector<int> seq_lens;
-    vector<int> seq_scales;
+    std::list<std::vector<int> > scaled_pathz;
+    std::vector<int> seq_lens;
+    std::vector<int> seq_scales;
     int bar_interval, line_interval;
     bool show_bars, show_lines;
 
   //keeps track of all the motifs the user has inputed
-    vector<motif> some_motifs;
+    std::vector<motif> some_motifs;
     MotifWindow *motif_find_window;
 
   //keeps track of the colors assigned to each motif type
-    vector<annot_color> some_annots;
+    std::vector<annot_color> some_annots;
     AnnotWindow *annot_color_window;
 
     SeqWindow *a_seq_win;
@@ -77,6 +83,7 @@ class ConnView : public Fl_Box
     void check_new_motifs();
 
   //for drawing function debugging
-    void reporter(string var, int value);
-    void report_float(string var, float value);
+    void reporter(std::string var, int value);
+    void report_float(std::string var, float value);
 };
+#endif
index 0b3e3741aeae3be0e86366c20f23bfc8a8626661..45743721f9a0bbc9e7690fa69b349bbf497fbbcb 100644 (file)
@@ -10,6 +10,8 @@
 
 #include "mussa_gui_conn_window.hh"
 
+#include <iostream>
+using namespace std;
 
 void
 load_ana_cb(Fl_Button* o, void* v)
index 24e4248109057ce3009affaaa0738a8898b44b3e..5a1044f990e76f453521334ef9d23f2f221626d2 100644 (file)
@@ -1,3 +1,6 @@
+#ifndef _MUSSA_GUI_CONN_WINDOW_H_
+#define _MUSSA_GUI_CONN_WINDOW_H_
+
 //  This file is part of the Mussa source distribution.
 //  http://mussa.caltech.edu/
 //  Contact author: Tristan  De Buysscher, tristan@caltech.edu
 // under the GNU Public License; please see the included LICENSE.txt
 // file for more information, or contact Tristan directly.
 
+#include <string>
 
-#include "mussa_gui_conn_view.hh"
-#include <FL/fl_ask.H>
+#include <Fl/Fl_Double_Window.H>
+#include <Fl/Fl_Menu_Item.H>
 
+#include "mussa_gui_conn_view.hh"
+#include "mussa_gui_load_window.hh"
+#include "mussa_gui_subana.hh"
+#include "mussa_gui_seq_text.hh"
 
 class ConnWindow : public Fl_Double_Window
 {
@@ -28,7 +36,7 @@ class ConnWindow : public Fl_Double_Window
     SubanaWindow *subana_win;
     SeqTextWin *show_seq_win;
     int padding, name_pad;
-    string window_name;
+    std::string window_name;
 
   public:
     ConnWindow(int w, int h, const char* title);
@@ -51,7 +59,6 @@ class ConnWindow : public Fl_Double_Window
     void real_toggle_lines_cb();
     void real_set_line_len_cb(Fl_Input* o);
     void real_set_soft_thres_cb(Fl_Input* o);
-
-
-  // I goddamned hate gcc
 };
+
+#endif
index 6706d539fbf30b7bccff191225d17d066c329e47..9f93525ad239c3818334e5d6249efe1ebfac2dec 100644 (file)
 
 #include "mussa_gui_load_window.hh"
 
+#include <iostream>
+#include <FL/Fl_File_Chooser.H>
+
+using namespace std;
+
 bool
 SetupWindow::done()
 {
index 2c92a9ec37570e84c63a669800bc7aa8a644dc27..02e772713c6afd7ea6b1b71b2303e4da75b467a3 100644 (file)
@@ -1,3 +1,6 @@
+#ifndef _MUSSA_GUI_LOAD_WINDOW_H_
+#define _MUSSA_GUI_LOAD_WINDOW_H_
+
 //  This file is part of the Mussa source distribution.
 //  http://mussa.caltech.edu/
 //  Contact author: Tristan  De Buysscher, tristan@caltech.edu
 // under the GNU Public License; please see the included LICENSE.txt
 // file for more information, or contact Tristan directly.
 
-
-#include "mussa_gui_annot_window.hh"
-#include <FL/Fl_File_Chooser.H>
+#include <FL/Fl_Button.H>
+#include <FL/Fl_Input.H>
 #include <FL/Fl_Scroll.H>
+#include <FL/Fl_Window.H>
+
+#include "mussa_class.hh"
+#include "mussa_gui_load_window.hh"
 
 class SetupWindow : public Fl_Window
 { 
@@ -29,7 +35,7 @@ class SetupWindow : public Fl_Window
     Fl_Scroll *seq_scroll;
     // need to keep track of these so a browsed file search can set the input
     // fields to teh selected file
-    vector<Fl_Input*> seq_inputs, annot_inputs;
+    std::vector<Fl_Input*> seq_inputs, annot_inputs;
 
 
     // callback receiver functions
@@ -52,10 +58,10 @@ class SetupWindow : public Fl_Window
 
   private:
     Mussa *an_analysis;
-    string ana_name;
+    std::string ana_name;
     int window, threshold, seq_num;
-    vector<string> seq_files, annot_files;
-    vector<int> fasta_indices, sub_seq_starts, sub_seq_ends;
+    std::vector<std::string> seq_files, annot_files;
+    std::vector<int> fasta_indices, sub_seq_starts, sub_seq_ends;
     bool win_append, thres_append;
 
     bool all_done;
@@ -73,3 +79,5 @@ struct seq_data_instance
   SetupWindow * sw_ptr;
   int index;
 };
+
+#endif
index 9923ce50a58d76c0166a238fe85ca6c9dafccf02..302ab74ff8a149471366c0aeccd2ae287b344216 100644 (file)
 
 #include "mussa_gui_motif_window.hh"
 
+#include <iostream>
 
+#include <FL/fl_show_colormap.H>
+
+using namespace std;
 
 motif
 new_blank_motif()
index 77c44b3efb678b1b7e5b6b4c5d386655ad95d4cf..5c16594768f4deff1523f64b10e16aa1b4041e5b 100644 (file)
@@ -1,3 +1,5 @@
+#ifndef _MUSSA_GUI_MOTIF_WINDOW_H_
+#define _MUSSA_GUI_MOTIF_WINDOW_H_
 //  This file is part of the Mussa source distribution.
 //  http://mussa.caltech.edu/
 //  Contact author: Tristan  De Buysscher, tristan@caltech.edu
@@ -7,23 +9,23 @@
 // under the GNU Public License; please see the included LICENSE.txt
 // file for more information, or contact Tristan directly.
 
+#include <list>
+#include <string>
+#include <vector>
 
-#include "mussa_class.hh"
-
-#include <FL/Fl.H>
 #include <FL/Fl_Window.H>
 #include <FL/Fl_Button.H>
 
 #include <FL/Fl_Input.H>
-#include <FL/Fl_Output.H>
 #include <FL/Fl_Pack.H>
-#include <FL/fl_show_colormap.H>
+
+#include "mussa_class.hh"
 
 struct motif
 {
-  string name, seq;
+  std::string name, seq;
   Fl_Color color;
-  vector<vector<int> > locations;
+  std::vector<std::vector<int> > locations;
   bool dirty;
 };
 
@@ -33,12 +35,12 @@ struct motif
 class MotifWindow : public Fl_Window
 { 
   public:
-    MotifWindow(int w, int h, const char* title, vector<motif> * some_motifs);
+    MotifWindow(int w, int h, const char* title, std::vector<motif> * some_motifs);
     ~MotifWindow();
     Fl_Pack * motif_input_pack;
-    list<Fl_Input*> motif_ins;
-    vector<Fl_Button*> motif_color_buttons;
-    list<Fl_Input*> name_ins;
+    std::list<Fl_Input*> motif_ins;
+    std::vector<Fl_Button*> motif_color_buttons;
+    std::list<Fl_Input*> name_ins;
     Fl_Button* test;
     Fl_Button* add_motif;
 
@@ -46,7 +48,7 @@ class MotifWindow : public Fl_Window
     void cb_motif_color_i(Fl_Button* o, int i);
 
   private:
-    vector<motif> * the_motifs;
+    std::vector<motif> * the_motifs;
     int motif_count;
 
     void add_motif_input(int index);
@@ -67,3 +69,4 @@ struct motif_instance
 };
 
 motif new_blank_motif();
+#endif
index 0ab458932167cbc90ceda20b1b9bc3133207c6d9..a2cb19da2a3673e7541ea4af8defdf28bed1f44e 100644 (file)
@@ -9,8 +9,12 @@
 
 
 #include "mussa_gui_seq.hh"
+
 #include <sstream>
 
+#include <FL/Fl.H>
+
+using namespace std;
 
 void
 set_align_cb(Fl_Widget* widg, void* the_data)
index 0d44c3310ae2fcb86fbe539eab79b238cd177a67..eaf1cc04417d3f34441bdac1cd87ad9f655ef940 100644 (file)
@@ -1,3 +1,5 @@
+#ifndef _MUSSA_GUI_SEQ_H_
+#define _MUSSA_GUI_SEQ_H_
 //  This file is part of the Mussa source distribution.
 //  http://mussa.caltech.edu/
 //  Contact author: Tristan  De Buysscher, tristan@caltech.edu
@@ -7,6 +9,10 @@
 // under the GNU Public License; please see the included LICENSE.txt
 // file for more information, or contact Tristan directly.
 
+#include <iostream>
+#include <list>
+#include <string>
+#include <vector>
 
 #include "mussa_gui_seq_view.hh"
 
 #include <FL/Fl_Menu_Button.H>
 #include <FL/Fl_Double_Window.H>
 
-
 class SeqWindow : public Fl_Double_Window
 {
   private:
-    string ana_name;
+    std::string ana_name;
     int base_window_len;
 
     //this data is passed as pointers to the instantiated classes
-    vector<Sequence> *S;
+    std::vector<Sequence> *S;
     // list of paths in selection box
-    list<vector<int> > P;
-    vector<int> seq_lens;
+    std::list<std::vector<int> > P;
+    std::vector<int> seq_lens;
     //pointer to passed motif data
-    vector<motif> *the_motifs;
+    std::vector<motif> *the_motifs;
 
     int x_max, y_max;
     Fl_Menu_Button *choose_align_menu;
@@ -40,10 +45,11 @@ class SeqWindow : public Fl_Double_Window
     int seq_num;
 
     SeqWindow(int w, int h, const char* title, int sq_num,
-             vector<Sequence> *some_seqs, 
-             list<vector<int> > some_paths, vector<int> some_lens,
-             vector<motif> *some_motifs);
-    virtual ~SeqWindow(){ cout << "dying\n"; }
+              std::vector<Sequence> *some_seqs, 
+              std::list<std::vector<int> > some_paths, 
+              std::vector<int> some_lens,
+              std::vector<motif> *some_motifs);
+    virtual ~SeqWindow(){ std::cout << "dying\n"; }
 
     void make_choose_menu();
     void make_show_menu();
@@ -54,9 +60,9 @@ class SeqWindow : public Fl_Double_Window
 };
 
 
-
 struct menu_align_data_bundle
 {
   SeqWindow * swm_ptr;
   int which_align;
 };
+#endif
index 6cf9a5233a4db8bd4387cd1f0dd1a542fe94a62c..45554f6d7e8a5569b954ae6931b29574a29c271f 100644 (file)
@@ -10,7 +10,8 @@
 
 #include "mussa_gui_seq_text.hh"
 
-
+#include <iostream>
+using namespace std;
 void
 get_seq_cb(Fl_Button* o, void* v)
 {
index 84a460f1f912c17fe6c6dc4c51caa4fa8cc75f8a..48b84b657012808a24aa89ede85a089d69afdb59 100644 (file)
@@ -1,3 +1,5 @@
+#ifndef _MUSSA_GUI_SEQ_TEXT_H_
+#define _MUSSA_GUI_SEQ_TEXT_H_
 //  This file is part of the Mussa source distribution.
 //  http://mussa.caltech.edu/
 //  Contact author: Tristan  De Buysscher, tristan@caltech.edu
@@ -7,16 +9,21 @@
 // under the GNU Public License; please see the included LICENSE.txt
 // file for more information, or contact Tristan directly.
 
+#include <string>
+#include <vector>
 
-#include "mussa_gui_seq.hh"
+#include <FL/Fl_Button.H>
+#include <FL/Fl_Input.H>
 #include <FL/Fl_Text_Buffer.H>
 #include <FL/Fl_Text_Display.H>
 #include <FL/Fl_Multiline_Output.H>
 
+#include "mussa_gui_seq.hh"
+
 class SeqTextWin : public Fl_Window
 { 
   public:
-    SeqTextWin(int w, int h, const char* title, vector<Sequence> some_Seqs);
+    SeqTextWin(int w, int h, const char* title, std::vector<Sequence> some_Seqs);
     ~SeqTextWin();
 
     Fl_Button* get_seq_but;
@@ -36,8 +43,8 @@ class SeqTextWin : public Fl_Window
 
   private:
     // sequence data
-    vector<Sequence> the_Seqs;
-    string sub_sequence;
+    std::vector<Sequence> the_Seqs;
+    std::string sub_sequence;
     int seq_id, seq_start, seq_end;
 };
-
+#endif
index fc1408ab5de08a55caf0f0f42648664bde7410a6..f4c83f2695375998b183e8d3741af0b5a68e9fca 100644 (file)
 #include "mussa_gui_seq.hh"
 #include <sstream>
 
+#include <FL/Fl.H>
+#include <FL/fl_draw.H>
+
+using namespace std;
+
 void
 SeqView::setup(string name, int sq_num, 
                vector<Sequence> *some_seqs,
index 1e2e73c38aa4a14f310cade183d8565b7d54fd3e..c66d36881a84d20aad8d3c5bf008aa371cf1bc64 100644 (file)
@@ -1,3 +1,5 @@
+#ifndef _MUSSA_GUI_SEQ_VIEW_H_
+#define _MUSSA_GUI_SEQ_VIEW_H_
 //  This file is part of the Mussa source distribution.
 //  http://mussa.caltech.edu/
 //  Contact author: Tristan  De Buysscher, tristan@caltech.edu
@@ -7,12 +9,14 @@
 // under the GNU Public License; please see the included LICENSE.txt
 // file for more information, or contact Tristan directly.
 
+#include <list>
+#include <string>
+#include <vector>
 
-#include "mussa_gui_load_window.hh"
-
-#include <math.h>
 #include <FL/Fl_Box.H>
-#include <FL/fl_draw.H>
+
+#include "mussa_gui_motif_window.hh"
+#include "mussa_gui_load_window.hh"
 
 class SeqView : public Fl_Box
 {
@@ -28,36 +32,36 @@ class SeqView : public Fl_Box
       show_motifs = true;
     }
              
-    void setup(string name, int sq_num, vector<Sequence> *some_seqs, 
-               list<vector<int> > some_paths, vector<int> some_lens,
-               vector<motif> *some_motifs);
+    void setup(std::string name, int sq_num, std::vector<Sequence> *some_seqs, 
+               std::list<std::vector<int> > some_paths, 
+               std::vector<int> some_lens, std::vector<motif> *some_motifs);
     void align_offsets(int align_num);
     void toggle_align(int align_num);
     void toggle_bars();
     void toggle_motifs();
 
   private:
-    string ana_name;
+    std::string ana_name;
     int seq_num;
     int base_window_len;
 
   //this data is passed as pointers to the instantiated classes
-    vector<Sequence> *S;
+    std::vector<Sequence> *S;
   //list of paths in selection box
-    list<vector<int> > P;
-    vector<int> seq_lens;
+    std::list<std::vector<int> > P;
+    std::vector<int> seq_lens;
   //pointer to passed motif data
-    vector<motif> *the_motifs;
+    std::vector<motif> *the_motifs;
 
     int x_max, y_max, x_min, y_min;
     int y_seq_incre;
     int index_pad;
-    vector<int> seq_align_offsets;
-    vector<string> raw_sequence;
+    std::vector<int> seq_align_offsets;
+    std::vector<std::string> raw_sequence;
     bool dragging;
     int drag_change, scroll_offset;
     bool show_bars, show_motifs;
-    vector<bool> show_aligns;
+    std::vector<bool> show_aligns;
 
     void resize(int new_x, int new_y, int new_w, int new_h);
     void draw();
@@ -66,5 +70,6 @@ class SeqView : public Fl_Box
     void draw_match_lines(double ch_width);
     void draw_indices(double ch_width);
     int handle(int e);
-    void reporter(string id, int value);
+    void reporter(std::string id, int value);
 };
+#endif
index b877702f69ff70078ab6a06c715292d01912ea74..cd29299668058098d5f18ce36a4320c2a230cb5f 100644 (file)
@@ -10,6 +10,8 @@
 
 #include "mussa_gui_subana.hh"
 
+#include <iostream>
+using namespace std;
 
 void
 do_subana_cb(Fl_Button* o, void* v)
index 1ce587857ac36767a09c908923bd5e56264ee6ff..e86e7771fb88cc74b7eb0a53dda7a33384e930e4 100644 (file)
@@ -1,3 +1,5 @@
+#ifndef _MUSSA_GUI_SUBANA_H_
+#define _MUSSA_GUI_SUBANA_H_
 //  This file is part of the Mussa source distribution.
 //  http://mussa.caltech.edu/
 //  Contact author: Tristan  De Buysscher, tristan@caltech.edu
@@ -7,16 +9,23 @@
 // under the GNU Public License; please see the included LICENSE.txt
 // file for more information, or contact Tristan directly.
 
+#include <string>
+#include <vector>
 
-#include "mussa_gui_seq_text.hh"
+#include <FL/Fl_Button.H>
+#include <FL/Fl_Window.H>
+#include <FL/Fl_Input.H>
 #include <FL/Fl_File_Chooser.H>
 #include <FL/Fl_Scroll.H>
 
+#include "mussa_class.hh"
+#include "mussa_gui_seq_text.hh"
+
 class SubanaWindow : public Fl_Window
 { 
   public:
     SubanaWindow(int w, int h, const char* title, Mussa *an_analysis,
-                vector<Sequence> some_Seqs);
+                std::vector<Sequence> some_Seqs);
     ~SubanaWindow();
     bool done();
 
@@ -30,7 +39,7 @@ class SubanaWindow : public Fl_Window
     Fl_Scroll *seq_scroll;
     // need to keep track of these so a browsed file search can set the input
     // fields to the selected file
-    vector<Fl_Input*> seq_inputs, annot_inputs;
+    std::vector<Fl_Input*> seq_inputs, annot_inputs;
 
 
     // callback receiver functions
@@ -46,18 +55,18 @@ class SubanaWindow : public Fl_Window
 
   private:
     // sequence data
-    vector<Sequence> the_Seqs;
+    std::vector<Sequence> the_Seqs;
     Mussa *an_analysis;
-    string ana_name;
+    std::string ana_name;
     int window, threshold, seq_num;
-    vector<int> sub_seq_starts, sub_seq_ends;
+    std::vector<int> sub_seq_starts, sub_seq_ends;
     bool win_append, thres_append;
     bool all_done;
 
     static void print_cb(Fl_Button*, void*);
     inline void print_cb_real(Fl_Button*, void*);
 
-    void add_seq_input(int index, string a_name);
+    void add_seq_input(int index, std::string a_name);
 };
 
 // crazy whacked shite Titus taught me to do to get an index value associated
@@ -69,4 +78,4 @@ struct sub_seq_data_instance
   SubanaWindow * sw_ptr;
   int index;
 };
-
+#endif
index 3e233b03dd3f4cd803e12ce572b941201f7440ad..c9a2f093bb64a159aae27ce9883513187f84c553 100644 (file)
 //                        ----------------------------------------
 
 #include "mussa_nway.hh"
-/*
-      cout << "fee\n";
-      cout << "fie\n";
-      cout << "foe\n";
-      cout << "fum\n";
-*/
+#include <fstream>
+#include <iostream>
 
+using namespace std;
 
 Nway_Paths::Nway_Paths()
 {
index 2d64442c1f9f472c75b443c1b2cc43d34360fa9b..645a069b00791eb733e830947bda93db5d45d061 100644 (file)
@@ -1,3 +1,5 @@
+#ifndef _MUSSA_NWAY_H_
+#define _MUSSA_NWAY_H_
 //  This file is part of the Mussa source distribution.
 //  http://mussa.caltech.edu/
 //  Contact author: Tristan  De Buysscher, tristan@caltech.edu
 //                         ----------  mussa_nway.hh  -----------
 //                        ----------------------------------------
 
+#include <list>
+#include <string>
+#include <vector>
+
 #include "flp.hh"
 
 
@@ -26,37 +32,38 @@ class Nway_Paths
     int soft_thres;
 
     double ent_thres;
-    vector<char *> c_sequences;
+    std::vector<char *> c_sequences;
 
-    list<vector<int> > pathz;
-    list<vector<int> > refined_pathz;
+    std::list<std::vector<int> > pathz;
+    std::list<std::vector<int> > refined_pathz;
 
 
 
   public:
     Nway_Paths();
     void setup(int sp_num, int w, int t);
-    void setup_ent(double new_entropy_thres, vector<string> some_Seqs);
+    void setup_ent(double new_entropy_thres, std::vector<std::string> some_Seqs);
     void set_soft_thres(int soft_thres);
 
-    void radiate_path_search(vector<vector<FLPs> > all_comparisons);
-    void trans_path_search(vector<vector<FLPs> > all_comparisons);
-    void entropy_path_search(vector<vector<FLPs> > all_comparisons);
-    double path_entropy(vector<int> path);
+    void radiate_path_search(std::vector<std::vector<FLPs> > all_comparisons);
+    void trans_path_search(std::vector<std::vector<FLPs> > all_comparisons);
+    void entropy_path_search(std::vector<std::vector<FLPs> > all_comparisons);
+    double path_entropy(std::vector<int> path);
 
   // old recursive transitive nway ... has issues checking all links?
-    void find_paths_r(vector<vector<FLPs> > all_comparisons);
-    void path_search(vector<vector<FLPs> > all_comparisons, vector<int> path, int depth);
+    void find_paths_r(std::vector<std::vector<FLPs> > all_comparisons);
+    void path_search(std::vector<std::vector<FLPs> > all_comparisons, std::vector<int> path, int depth);
 
     void simple_refine();
-    void save(string save_file_path);
-    string load(string load_file_path);
-    void add_path(vector<int> loaded_path);
+    void save(std::string save_file_path);
+    std::string load(std::string load_file_path);
+    void add_path(std::vector<int> loaded_path);
     int seq_num();
 
-    void find_paths(vector<vector<FLPs> > all_comparisons);
+    void find_paths(std::vector<std::vector<FLPs> > all_comparisons);
     void refine();
 
-    void save_old(string save_file_path);
+    void save_old(std::string save_file_path);
     void print();
 };
+#endif
index c2d5904aada44da988492dcf2e573af6cf61bde1..013c31285a17502edf2747ca4aea9c855bf5cdf3 100644 (file)
@@ -8,19 +8,11 @@
 // file for more information, or contact Tristan directly.
 
 
-/*
-#include <list>
-#include <vector>
-#include <string>
-#include <stdlib.h>
-#include <algorithm>
-
-#include <iostream>
 
-using namespace std;
-*/
 #include "mussa_nway.hh"
 #include <math.h>
+#include <iostream>
+using namespace std;
 
 // vars that will be availble to entropy function when in its nway class
 //vector<char *> c_sequences;
index 1ddbd72b75c0c0521949c9efb5bf9a59b07c9a32..d0b5f2c5ff63e37a90f317acb033f1c445ccb443 100644 (file)
@@ -9,6 +9,9 @@
 
 
 #include "mussa_nway.hh"
+#include <iostream>
+
+using namespace std;
 
 void
 Nway_Paths::radiate_path_search(vector<vector<FLPs> > all_comparisons)
index aa8af11b90924d41ef87f40a5a000c34b4361309..62025aa899a628a1a16e05b7e990a5373ec72431 100644 (file)
@@ -23,7 +23,9 @@
 //                        ----------------------------------------
 
 #include "sequence.hh"
+#include <iostream>
 
+using namespace std;
 
 Sequence::Sequence()
 {
index 9a08ad0b62157f0bb45ff23ede77c0829769438f..11a50cc69052ba86db2c5aabb6743e35362dc018 100644 (file)
@@ -1,3 +1,5 @@
+#ifndef _MUSSA_SEQUENCE_H_
+#define _MUSSA_SEQUENCE_H_
 //  This file is part of the Mussa source distribution.
 //  http://mussa.caltech.edu/
 //  Contact author: Tristan  De Buysscher, tristan@caltech.edu
 //                        ----------------------------------------
 
 
-#include <iostream>
-#include <iomanip>
+#include <fstream>
 #include <list>
-#include <vector>
 #include <string>
-#include <fstream>
-#include <stdlib.h>
-#include <algorithm>
+#include <vector>
 
 // Sequence data class
 
@@ -29,7 +27,7 @@ using namespace std;
 struct annot
 {
   int start, end;
-  string name, type;
+  std::string name, type;
 };
 
 class Sequence
@@ -37,32 +35,33 @@ class Sequence
   friend class ConnView;
   friend class SeqView;
   private:
-    string sequence;
-    string header;
-    string species;
+    std::string sequence;
+    std::string header;
+    std::string species;
     int species_num; 
 
-    list<annot> annots;
+    std::list<annot> annots;
 
-    void motif_scan(string a_motif, vector<int> * motif_match_starts);
-    string rc_motif(string a_motif);
-    string motif_validate(string a_motif);
+    void motif_scan(std::string a_motif, std::vector<int> * motif_match_starts);
+    std::string rc_motif(std::string a_motif);
+    std::string motif_validate(std::string a_motif);
 
   public:
     Sequence();
-    string load_fasta(string file_path, int seq_num, 
+    std::string load_fasta(std::string file_path, int seq_num, 
                     int start_index, int end_index);
-    string load_annot(string file_path, int start_index, int end_index);
-    string seq();
-    string subseq(int start, int end);
+    std::string load_annot(std::string file_path, int start_index, int end_index);
+    std::string seq();
+    std::string subseq(int start, int end);
     const char * c_seq();
-    string rev_comp();
+    std::string rev_comp();
     int len();
-    string hdr();
-    void set_seq(string a_seq);
-    vector<int> find_motif(string a_motif);
-    string sp_name();
+    std::string hdr();
+    void set_seq(std::string a_seq);
+    std::vector<int> find_motif(std::string a_motif);
+    std::string sp_name();
     void clear();
-    void save(fstream &save_file);
-    void load_museq(string load_file_path, int seq_num); 
+    void save(std::fstream &save_file);
+    void load_museq(std::string load_file_path, int seq_num); 
 };
+#endif