rename some mussa_class members (ana_name to analysis_name)
authorDiane Trout <diane@caltech.edu>
Wed, 22 Feb 2006 02:16:42 +0000 (02:16 +0000)
committerDiane Trout <diane@caltech.edu>
Wed, 22 Feb 2006 02:16:42 +0000 (02:16 +0000)
also add some getters, reformat the parse_args if/else tree.
Change using character flags for analysis mode to using an enumeration.

14 files changed:
alg/mussa_class.cxx
alg/mussa_class.hh
gui/ConnView.cxx
gui/ConnView.hh
gui/ConnWindow.cxx
gui/SeqView.cxx
gui/SeqView.hh
gui/SeqWindow.cxx
gui/SeqWindow.hh
gui/SetupWindow.cxx
gui/SetupWindow.hh
gui/SubAnalysisWindow.cxx
gui/SubAnalysisWindow.hh
mussa.cxx

index b5715164ffc48466f7798ccc9c8e9610bdc2f0c6..fca2932cec595c22088cd5b49386a21f645ba98e 100644 (file)
@@ -28,7 +28,8 @@ Mussa::Mussa()
 void
 Mussa::clear()
 {
-  ana_name = "";
+  analysis_name = "";
+  ana_mode = TransitiveNway;
   seq_num = 0;
   window = 0;
   threshold = 0;
@@ -48,7 +49,12 @@ Mussa::clear()
 void
 Mussa::set_name(string a_name)
 {
-  ana_name = a_name;
+  analysis_name = a_name;
+}
+
+string Mussa::get_name()
+{
+  return analysis_name;
 }
 
 void
@@ -63,6 +69,11 @@ Mussa::set_window(int a_window)
   window = a_window;
 }
 
+int Mussa::get_window()
+{
+  return window;
+}
+
 void
 Mussa::set_threshold(int a_threshold)
 {
@@ -70,6 +81,11 @@ Mussa::set_threshold(int a_threshold)
   //soft_thres = a_threshold;
 }
 
+int Mussa::get_threshold()
+{
+  return threshold;
+}
+
 void
 Mussa::set_soft_thres(int sft_thres)
 {
@@ -77,11 +93,16 @@ Mussa::set_soft_thres(int sft_thres)
 }
 
 void
-Mussa::set_ana_mode(char new_ana_mode)
+Mussa::set_analysis_mode(enum analysis_modes new_ana_mode)
 {
   ana_mode = new_ana_mode;
 }
 
+enum Mussa::analysis_modes Mussa::get_analysis_mode()
+{
+  return ana_mode;
+}
+
 // takes a string and sets it as the next seq - no AGCTN checking atm
 void
 Mussa::add_a_seq(string a_seq)
@@ -153,7 +174,7 @@ Mussa::load_mupa_file(string para_file_path)
     {
       did_seq = false;
       if (param == "ANA_NAME")
-        ana_name = value;
+        analysis_name = value;
       else if (param == "APPEND_WIN")
         win_append = true;
       else if (param == "APPEND_THRES")
@@ -223,7 +244,7 @@ Mussa::load_mupa_file(string para_file_path)
     para_file.close();
 
     soft_thres = threshold;
-    cout << "nway mupa: ana_name = " << ana_name << " seq_num = " << seq_num;
+    cout << "nway mupa: analysis_name = " << analysis_name << " seq_num = " << seq_num;
     cout << " window = " << window << " threshold = " << threshold << endl;
 
     return "";
@@ -242,7 +263,7 @@ Mussa::load_mupa_file(string para_file_path)
 
 
 string
-Mussa::analyze(int w, int t, char the_ana_mode, double new_ent_thres)
+Mussa::analyze(int w, int t, enum Mussa::analysis_modes the_ana_mode, double new_ent_thres)
 {
   string err_msg;
   time_t t1, t2, begin, end;
@@ -417,19 +438,15 @@ Mussa::nway()
   vector<string> some_Seqs;
   int i;
 
-
-  cout << "nway: ana mode = " << ana_mode << endl;
-  cout << "nway: seq_num = " << seq_num << endl;
-
   the_paths.set_soft_thres(soft_thres);
 
-  if (ana_mode == 't')
+  if (ana_mode == TransitiveNway)
     the_paths.trans_path_search(all_comps);
 
-  else if (ana_mode == 'r')
+  else if (ana_mode == RadialNway)
     the_paths.radiate_path_search(all_comps);
 
-  else if (ana_mode == 'e')
+  else if (ana_mode == EntropyNway)
   {
     //unlike other methods, entropy needs to look at the sequence at this stage
     some_Seqs.clear();
@@ -441,7 +458,7 @@ Mussa::nway()
   }
 
   // old recursive transitive analysis function
-  else if (ana_mode == 'o')
+  else if (ana_mode == RecursiveNway)
     the_paths.find_paths_r(all_comps);
 
   the_paths.simple_refine();
@@ -458,7 +475,7 @@ Mussa::save()
 
   // not sure why, but gotta close file each time since can't pass file streams
 
-  save_name = ana_name;
+  save_name = analysis_name;
 
   // gotta do bit with adding win & thres if to be appended
   if (win_append)
@@ -555,8 +572,8 @@ Mussa::load(string ana_file)
       parsing_path = false;
   }
 
-  ana_name = ana_path.substr(dir_index);
-  cout << "mu class: ana_name = " << ana_name << endl;
+  analysis_name = ana_path.substr(dir_index);
+  cout << "mu class: analysis_name = " << analysis_name << endl;
   file_path_base = ana_path + "/" + ana_path.substr(dir_index);
   a_file_path = file_path_base + ".muway";
   err_msg = the_paths.load(a_file_path);
@@ -620,16 +637,16 @@ Mussa::save_old()
   fstream save_file;
   int i;
 
-  save_file.open(ana_name.c_str(), ios::out);
+  save_file.open(analysis_name.c_str(), ios::out);
 
   for(i = 0; i < seq_num; i++)
     save_file << the_Seqs[i].seq() << endl;
 
   save_file << window << endl;
   save_file.close();
-  //note more complex eventually since ana_name may need to have
+  //note more complex eventually since analysis_name may need to have
   //window size, threshold and other stuff to modify it...
-  the_paths.save_old(ana_name);
+  the_paths.save_old(analysis_name);
 }
 
 
index 341a3e4f061c9083f9f5ad54fe4029e3eff1ec48..c564e367d81d0ed0247997b630d0e2bf80af1eae 100644 (file)
@@ -25,63 +25,49 @@ std::string int_to_str(int an_int);
 
 class Mussa
 {
-  friend class MussaOverlord;
   friend class ConnWindow;
-
-  private:
-    // Private variables
-    // parameters needed for a mussa analysis
-    std::string ana_name, file_path_base;
-    int seq_num, window, threshold, soft_thres;
-    char ana_mode;
-    double ent_thres;
-    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
-    std::vector<Sequence> the_Seqs;
-    //! the seqcomp data
-    std::vector<std::vector<FLPs> > all_comps;
-    //! N-way data, ie the mussa results  
-    Nway_Paths the_paths;
-
-
-    // Private methods
-    std::string get_Seqs();
-    void seqcomp();
-    /*! actually run the nway comparison
-     *  it appears there are 4 modes, t (trans_path_search), 
-     *  r (radiate_path_search), e (entropy_path_search), and 
-     *  o, (find_paths_r (old recursive analysis))
-     */
-    void nway();
-
-
   public:
+    enum analysis_modes { TransitiveNway, RadialNway, EntropyNway, 
+                          RecursiveNway };
+
     Mussa();  
 
     // parameters need to be set before calling this
     // w & t are for command line override functionality, set to 0 to ignore
-    std::string analyze(int w, int t, char ana_mode, double ent_thres);
+    std::string analyze(int w=0, 
+                        int t=0, 
+                        enum analysis_modes ana_mode=TransitiveNway,
+                        double ent_thres=0.0);
     void save();
     void save_muway(std::string save_path);
     std::string load(std::string ana_file);
 
-    // clear parameters and initialize data lists
+    //! clear parameters and initialize data lists
     void clear();
 
     // set parameters from a file - 'mupa' ~ mussa parameters
     std::string load_mupa_file(std::string para_file_path);
 
     // set parameters individually (eg from user input into gui classes)
+    //! set analysis name
     void set_name(std::string a_name);
+    //! return name for this analysis
+    std::string get_name();
+    
     void set_seq_num(int a_num);
+    //! set number of bases for this window size
     void set_window(int a_window);
+    //! get number of bases for the sliding window
+    int get_window();
+    //! set number of bases that must match for a window to be saved
     void set_threshold(int a_threshold);
+    //! get number of bases that must match for a window to be saved
+    int get_threshold();
     void set_soft_thres(int sft_thres);
-    void set_ana_mode(char new_ana_mode);
+    
+    void set_analysis_mode(enum analysis_modes new_ana_mode);
+    enum analysis_modes get_analysis_mode();
+
    // sets an individual sequence to a string (no ATCGN checking atm) 
     void add_a_seq(std::string a_seq);
     // sets info to load a seq and annotations from a fasta file 
@@ -92,5 +78,36 @@ class Mussa
     // these save & load from the old file format
     void save_old();
     void load_old(char * load_file_path, int s_num);
+
+  private:
+    // Private variables
+    // parameters needed for a mussa analysis
+    std::string analysis_name;
+    std::string file_path_base;
+    int seq_num, window, threshold, soft_thres;
+    enum analysis_modes ana_mode;
+    double ent_thres;
+    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
+    std::vector<Sequence> the_Seqs;
+    //! the seqcomp data
+    std::vector<std::vector<FLPs> > all_comps;
+    //! N-way data, ie the mussa results  
+    Nway_Paths the_paths;
+
+    // Private methods
+    std::string get_Seqs();
+    void seqcomp();
+    /*! actually run the nway comparison
+     *  it appears there are 4 modes, t (trans_path_search), 
+     *  r (radiate_path_search), e (entropy_path_search), and 
+     *  o, (find_paths_r (old recursive analysis))
+     */
+    void nway();
+
 };
 #endif
index 15cc25014eaf5f5a728e3e6d07f5339bdf63baec..e0390a31586f9befc258e8f56668e46605875630 100644 (file)
@@ -29,7 +29,7 @@ ConnView::setup(string name, int sq_num, int win_len,
   annot_color new_annot;
 
 
-  ana_name = name;
+  analysis_name = name;
   seq_num = sq_num;
   window = win_len;
   S = some_seqs;
@@ -634,7 +634,7 @@ ConnView::spawnSeq()
 
     // give 50 pixels of height per sequence
     y_max = seq_num * 50;
-    window_name = "Mussa Sequence: " + ana_name;
+    window_name = "Mussa Sequence: " + analysis_name;
 
     a_seq_win = new SeqWindow(800, y_max, (const char*) window_name.c_str(),
                              seq_num,
index 2efaba36c8b0b8f36d61334ca79badb95a333e2b..23f150dd571c273bc9305d39966a8d3962b91681 100644 (file)
@@ -46,7 +46,7 @@ class ConnView : public Fl_Box
 
 
   private:
-    std::string ana_name;
+    std::string analysis_name;
     int seq_num, window, threshold;
     bool win_append, thres_append;
 
index 6a99cdc757a207b7fa9e170e4b9fa7e255bbed2d..73d26b58c3f4527f64680afd855233c2bdf02149 100644 (file)
@@ -45,10 +45,10 @@ ConnWindow::real_load_ana_cb()
     if (err_msg == "")
     {
       // relabel window with the analysis name
-      window_name = "Mussa: " + an_analysis->ana_name;
+      window_name = "Mussa: " + an_analysis->analysis_name;
       label((const char*)window_name.c_str());
       // show the user the analysis
-      conn_box->setup(an_analysis->ana_name, an_analysis->seq_num, 
+      conn_box->setup(an_analysis->analysis_name, an_analysis->seq_num, 
                      an_analysis->window, &(an_analysis->the_Seqs), 
                      &(an_analysis->the_paths));
       conn_box->scale_paths();
@@ -87,16 +87,16 @@ ConnWindow::real_do_ana_cb()
 
     if (err_msg == "")
     {
-      err_msg = an_analysis->analyze(0, 0, 't', 0.0);
+      err_msg = an_analysis->analyze(0, 0, Mussa::TransitiveNway, 0.0);
     }
 
     if (err_msg == "")
     {
       // relabel window with the analysis name
-      window_name = "Mussa: " + an_analysis->ana_name;
+      window_name = "Mussa: " + an_analysis->analysis_name;
       label((const char*)window_name.c_str());
       // show the user the analysis
-      conn_box->setup(an_analysis->ana_name, an_analysis->seq_num, 
+      conn_box->setup(an_analysis->analysis_name, an_analysis->seq_num, 
                      an_analysis->window, &(an_analysis->the_Seqs), 
                      &(an_analysis->the_paths));
       conn_box->scale_paths();
@@ -130,10 +130,10 @@ ConnWindow::real_setup_ana_cb()
   if (setup_win->done())
   {
     // relabel window with the analysis name
-    window_name = "Mussa: " + an_analysis->ana_name;
+    window_name = "Mussa: " + an_analysis->analysis_name;
     label((const char*)window_name.c_str());
     // is it this easy?  what if setup window encounters an error...??
-    conn_box->setup(an_analysis->ana_name, an_analysis->seq_num, 
+    conn_box->setup(an_analysis->analysis_name, an_analysis->seq_num, 
                    an_analysis->window, &(an_analysis->the_Seqs), 
                    &(an_analysis->the_paths));
 
@@ -164,7 +164,7 @@ ConnWindow::real_subana_cb()
 
   if (subana_win->done())
   {
-    subana_name = "SubMussa: " + sub_analysis->ana_name; 
+    subana_name = "SubMussa: " + sub_analysis->analysis_name; 
     sub_conn_win = new ConnWindow(w(), h(), (const char*) subana_name.c_str());
     cout << "Like a warm day in may\n";
     sub_conn_win->add_ana(sub_analysis);
@@ -312,7 +312,7 @@ ConnWindow::real_set_soft_thres_cb(Fl_Input* o)
   cout << "new soft thres = " << new_soft_thres << endl;
 
   an_analysis->set_soft_thres(new_soft_thres);
-  an_analysis->set_ana_mode('t');
+  an_analysis->set_analysis_mode(Mussa::TransitiveNway);
   an_analysis->nway();
   conn_box->scale_paths();
   conn_box->redraw();
@@ -321,8 +321,8 @@ ConnWindow::real_set_soft_thres_cb(Fl_Input* o)
   string save_path;
   ostringstream append_info;
 
-  save_path = an_analysis->ana_name + "/"
-    + an_analysis->ana_name.substr(0,an_analysis->ana_name.find("_t"));
+  save_path = an_analysis->analysis_name + "/"
+    + an_analysis->analysis_name.substr(0,an_analysis->analysis_name.find("_t"));
   append_info.str("");
   append_info << "_t" << new_soft_thres << ".muway";
   //<<  "_w" << an_analysis->window
@@ -410,10 +410,10 @@ ConnWindow::add_ana(Mussa *the_ana)
   an_analysis = the_ana;
 
   // relabel window with the analysis name
-  window_name = "Mussa: " + an_analysis->ana_name;
+  window_name = "Mussa: " + an_analysis->analysis_name;
   label((const char*)window_name.c_str());
 
-  conn_box->setup(an_analysis->ana_name, an_analysis->seq_num, 
+  conn_box->setup(an_analysis->analysis_name, an_analysis->seq_num, 
                   an_analysis->window, &(an_analysis->the_Seqs), 
                   &(an_analysis->the_paths));
   conn_box->scale_paths();
index 1d1b547a39e6981e71a59d35ab7e7090cf926725..6f43b8b8544677774fd42985eef205d7a4f23e45 100644 (file)
@@ -27,7 +27,7 @@ SeqView::setup(string name, int sq_num,
   list<vector<int> >::iterator pathz_i;
 
 
-  ana_name = name;
+  analysis_name = name;
   seq_num = sq_num;
   S = some_seqs;
   P = some_paths;
index a728d82e38a38f9451c2d39ff3d7672502a93723..4032351bfa4d8aa586454169fa8f69937352a83e 100644 (file)
@@ -41,7 +41,7 @@ class SeqView : public Fl_Box
     void toggle_motifs();
 
   private:
-    std::string ana_name;
+    std::string analysis_name;
     int seq_num;
     int base_window_len;
 
index 3e2c5bdec3a2689f4e2853cc46f86c928f351ab3..ff7c407222a3e84028297183391cb16eeb93d737 100644 (file)
@@ -183,7 +183,7 @@ SeqWindow::SeqWindow(int w, int h, const char* title, int sq_num,
 
   // make the view of the sequence
   seq_box = new SeqView(0, 34, w, h-34);
-  seq_box->setup(ana_name, seq_num, S, P, seq_lens, the_motifs);
+  seq_box->setup(analysis_name, seq_num, S, P, seq_lens, the_motifs);
   //real_set_align_cb(2);
 
   end();
index 9ae346a2f38d07393afe63b1a59f6a1c850b2e84..584bfaef48c0565bc690d6487eaadd15c951a501 100644 (file)
@@ -24,7 +24,7 @@
 class SeqWindow : public Fl_Double_Window
 {
   private:
-    std::string ana_name;
+    std::string analysis_name;
     int base_window_len;
 
     //this data is passed as pointers to the instantiated classes
index 0cd90ee47628d3a0ecdc516a210a0d038b68a161..aac5948e286c9582c249d78b91aee75f338fa551 100644 (file)
@@ -40,7 +40,7 @@ SetupWindow::real_do_analysis()
   // <-- need a check here to make sure all vars have a valid value
 
   an_analysis->clear();
-  an_analysis->set_name(ana_name);
+  an_analysis->set_name(analysis_name);
   an_analysis->set_seq_num(seq_num);
   an_analysis->set_window(window);
   an_analysis->set_threshold(threshold);
@@ -49,7 +49,7 @@ SetupWindow::real_do_analysis()
     an_analysis->set_seq_info(seq_files[i], annot_files[i], fasta_indices[i],
                              sub_seq_starts[i], sub_seq_ends[i]);
 
-  err_msg = an_analysis->analyze(0,0, 't', 0.0);
+  err_msg = an_analysis->analyze();
   //cout << "Feel the tribal beat\n";
   if (!(err_msg == ""))
   {
@@ -206,7 +206,7 @@ set_ana_name_cb(Fl_Input* o, void* v)
 void
 SetupWindow::real_set_ana_name_cb(Fl_Input* o)
 {
-  ana_name = o->value();
+  analysis_name = o->value();
 }
 
 // *** input window size
@@ -399,7 +399,7 @@ void SetupWindow::print_cb(Fl_Button* o, void* v)
 
 void SetupWindow::print_cb_real(Fl_Button* , void*)
 {
-  cout << "ana_name: " << ana_name << endl;
+  cout << "analysis_name: " << analysis_name << endl;
   cout << "win: " << window << endl;
   cout << "thres: " << threshold << endl;
   cout << "seq_num: " << seq_num << endl;
index 42eccb72537f87b43b43512312a26bf5cf3d3911..c7764493c1e5124d423338f4866f9a4d919643c3 100644 (file)
@@ -61,7 +61,7 @@ class SetupWindow : public Fl_Window
 
   private:
     Mussa *an_analysis;
-    std::string ana_name;
+    std::string analysis_name;
     int window, threshold, seq_num;
     std::vector<std::string> seq_files, annot_files;
     std::vector<int> fasta_indices, sub_seq_starts, sub_seq_ends;
index 4831f938cb5a032b4e30bc13c0cfaefb704a075d..9c8c1216432397faa5174a64aeda3a45e0a6ae62 100644 (file)
@@ -31,7 +31,7 @@ SubAnalysisWindow::real_do_subana()
   // <-- need a check here to make sure all vars have a valid value
 
   an_analysis->clear();
-  an_analysis->set_name(ana_name);
+  an_analysis->set_name(analysis_name);
   an_analysis->set_seq_num(seq_num);
   an_analysis->set_window(window);
   an_analysis->set_threshold(threshold);
@@ -46,7 +46,7 @@ SubAnalysisWindow::real_do_subana()
     an_analysis->add_a_seq(a_sequence);
   }
 
-  err_msg = an_analysis->analyze(0,0, 't', 0.0);
+  err_msg = an_analysis->analyze();
 
   cout << "Feel the tribal beat\n";
   if (!(err_msg == ""))
@@ -107,7 +107,7 @@ set_ana_name_cb1(Fl_Input* o, void* v)
 void
 SubAnalysisWindow::real_set_ana_name_cb(Fl_Input* o)
 {
-  ana_name = o->value();
+  analysis_name = o->value();
 }
 
 // *** input window size
@@ -160,7 +160,7 @@ SubAnalysisWindow::SubAnalysisWindow(int w, int h, const char* title,Mussa *the_
   all_done = false;
 
   // initialize parameters
-  ana_name = "";
+  analysis_name = "";
   window = -1;
   threshold = -1; 
 
@@ -264,7 +264,7 @@ void SubAnalysisWindow::print_cb(Fl_Button* o, void* v)
 
 void SubAnalysisWindow::print_cb_real(Fl_Button* , void*)
 {
-  cout << "ana_name: " << ana_name << endl;
+  cout << "analysis_name: " << analysis_name << endl;
   cout << "win: " << window << endl;
   cout << "thres: " << threshold << endl;
   cout << "seq_num: " << seq_num << endl;
index e4a9e2d4277942a40f238c09f105c892eb705fe1..f60a5e1e2e7f0d412553fb0112fc488990218016 100644 (file)
@@ -57,7 +57,7 @@ class SubAnalysisWindow : public Fl_Window
     // sequence data
     std::vector<Sequence> the_Seqs;
     Mussa *an_analysis;
-    std::string ana_name;
+    std::string analysis_name;
     int window, threshold, seq_num;
     std::vector<int> sub_seq_starts, sub_seq_ends;
     bool win_append, thres_append;
index 9b7b393bd34f79939177c80293712745ea3c998f..bf20220d4513474dbc4ce808ebdd7c49a07a9233 100644 (file)
--- a/mussa.cxx
+++ b/mussa.cxx
@@ -9,12 +9,13 @@
 
 
 #include "gui/ConnWindow.hh"
+#include "alg/mussa_class.hh"
 #include <iostream>
 using namespace std;
 
 char
 parse_args(int argc, char **argv, string *a_file_path, int *window, 
-           int *threshold, char *ana_mode, float *ent_thres);
+           int *threshold, enum Mussa::analysis_modes *ana_mode, float *ent_thres);
 
 
 int main(int argc, char **argv) 
@@ -24,7 +25,8 @@ int main(int argc, char **argv)
   char * picked_file;
   int window, threshold;
   float ent_thres;
-  char run_mode, ana_mode;
+  char run_mode;
+  enum Mussa::analysis_modes ana_mode;
   int x_max=1000;
   int y_max=500;
   string err_msg;
@@ -91,7 +93,7 @@ struct ParseError
 // minimal arg reading function, not very robust to errors
 char
 parse_args(int argc, char **argv, string *a_file_path, int *window, 
-           int *threshold, char *ana_mode, float *ent_thres)
+           int *threshold, enum Mussa::analysis_modes *ana_mode, float *ent_thres)
 {
   int i, else_i;
   string an_arg;
@@ -102,18 +104,11 @@ parse_args(int argc, char **argv, string *a_file_path, int *window,
   *threshold = 0;
   *ent_thres = 0.0;
   run_mode = 'e'; //error default if no run mode set implicitly or explicitly
-  *ana_mode = 't'; // default to transitivie analyses mode
-
+  *ana_mode = Mussa::TransitiveNway; // default to transitivie analyses mode
 
   // no args means gui only mode
   if (argc == 1)
     run_mode = 'g';
-  // 1 arg means its a mupa file and run in full mode
-  /*
-  else if (argc == 2)
-  {
-  }
-  */
   else
   {
     else_i = 0;
@@ -126,64 +121,64 @@ parse_args(int argc, char **argv, string *a_file_path, int *window,
       // see what alternate mode the user wants to run in
       if (an_arg == "-m")
       {
-       an_arg = * ++argv;
-       i++;
-       if ( (an_arg == "v") || (an_arg == "n") ) //only 2 valid modes so far
-         run_mode = an_arg[0];
-       else
-       {
-         cout << "Error: \'" << an_arg;
-         cout << "\' is not a valid analysis mode for -a argument" << endl; 
+        an_arg = * ++argv;
+        i++;
+        if ( (an_arg == "v") || (an_arg == "n") ) //only 2 valid modes so far
+          run_mode = an_arg[0];
+        else
+        {
+          cout << "Error: \'" << an_arg;
+          cout << "\' is not a valid analysis mode for -a argument" << endl; 
           throw ParseError("not valid -a argument");
-       }
-       *a_file_path = * ++argv;
-       i++;
+        }
+        *a_file_path = * ++argv;
+        i++;
       }
       // alternate analyses modes
       else if (an_arg == "-a")
       {
-       an_arg = * ++argv;
-       i++;
-       // t = transitive, r = radial, e = entropy
-       if ( (an_arg == "t") || (an_arg == "r") || (an_arg == "e") )
-         *ana_mode = an_arg[0];
-       else
-       {
-         cout << "Error: \'" << an_arg;
-         cout << "\' is not a valid run mode for -m argument" << endl; 
-         throw ParseError("bad argument -m");
-       }
-
+        an_arg = * ++argv;
+        i++;
+        // t = transitive, r = radial, e = entropy
+        if (an_arg == "t") *ana_mode = Mussa::TransitiveNway;
+        else if (an_arg == "r") *ana_mode = Mussa::RadialNway;
+        else if (an_arg == "e") *ana_mode = Mussa::EntropyNway;
+        else
+        {
+          cout << "Error: \'" << an_arg;
+          cout << "\' is not a valid run mode for -m argument" << endl; 
+          throw ParseError("bad argument -m");
+        }
       }
       else if (an_arg == "-w") // alternate window size arg
       {
-       *window = atoi(* ++argv);
-       i++;
+        *window = atoi(* ++argv);
+        i++;
       }
       else if (an_arg == "-t") // alternate threshold arg
       {
-       *threshold = atoi(* ++argv);
-       i++;
+        *threshold = atoi(* ++argv);
+        i++;
       }
       else if (an_arg == "-et") // alternate entropy threshold arg
       {
-       *ent_thres = atof(* ++argv);
-       i++;
+        *ent_thres = atof(* ++argv);
+        i++;
       }
       else
       {
-       if (else_i == 0)
-       {
-         *a_file_path = an_arg;
-         run_mode = 'f';
-         else_i++;
-       }
-       else
-       {
-         //cout << "Error, unknown arg: \'" << an_arg << "\'" << endl;
-         cout << "Error, too many filenames: \'" << an_arg << "\'" << endl;
-         run_mode == 'e';
-       }
+        if (else_i == 0)
+        {
+          *a_file_path = an_arg;
+          run_mode = 'f';
+          else_i++;
+        }
+        else
+        {
+          //cout << "Error, unknown arg: \'" << an_arg << "\'" << endl;
+          cout << "Error, too many filenames: \'" << an_arg << "\'" << endl;
+          run_mode == 'e';
+        }
       }
     }
   }