allow running without using the gui
authorDiane Trout <diane@caltech.edu>
Thu, 30 Mar 2006 06:59:09 +0000 (06:59 +0000)
committerDiane Trout <diane@caltech.edu>
Thu, 30 Mar 2006 06:59:09 +0000 (06:59 +0000)
Also I moved some of the reverse compliment code onto single lines to
see if that made it make any more sense.

alg/parse_options.cpp
py/mussa.cpp
py/sequence.cpp
qui/MussaAlignedWindow.cpp

index 3282dc7abafbe79e4692790d21b4c39724a3a5fa..116a16dcaa5d881dcf39e47c559c6d2df48c06df 100644 (file)
@@ -19,6 +19,7 @@ Mussa *initialize_mussa(int argc, char **argv)
      "run an analysis defined by the mussa parameter file")
     ("view-analysis", po::value<std::string>(),
      "load a previously run analysis")
+    ("no-gui", "terminate without running an analysis")
   ;
 
   po::variables_map vm;
@@ -42,6 +43,10 @@ Mussa *initialize_mussa(int argc, char **argv)
   else if (vm.count("view-analysis")) {
     m->load( vm["view-analysis"].as< std::string >() );
   }
-  return m;
+  if (vm.count("no-gui")) {
+    return 0;
+  } else {
+    return m;
+  }
 }
 
index cf34041d685d63ece1d37a834314ebe368ca4544..55e5a2fd2c17a409f0ed1d451e87fd4120e2a152 100644 (file)
@@ -25,7 +25,7 @@ void export_mussa()
     .add_property("analysisMode", &Mussa::get_analysis_mode, 
                                    &Mussa::set_analysis_mode)
     .add_property("analysisModeName", &Mussa::get_analysis_mode_name)
-    .def("analyze", &Mussa::analyze)
+    .def("analyze", &Mussa::analyze, "Run the analysis")
     .def("paths", &Mussa::paths, return_internal_reference<>())
     //.def("sequences", &Mussa::sequences)
     .def("addSequence", &Mussa::add_a_seq)  ;
index 68fc0ba18c14b19269947bfb3808440b3394af4d..be7a73cad652ac4d13a8243ea7ff75fa70ea467f 100644 (file)
@@ -8,7 +8,7 @@ void export_sequence()
 {
   class_<Sequence>("Sequence")
     .def(init<std::string>())
-    //.add_property("seq", &Sequence::get_seq, &Sequence::set_seq)
+    .def("__str__", &Sequence::get_seq)
     .def("size", &Sequence::size)
     .def("__len__", &Sequence::size)
     //.add_property("header", &Sequence::get_header)
index 6f61949f4a2fe92a52d7a24819b21026725cd723..16505671a8cb83123008aad158a6f4bea306a617 100644 (file)
@@ -135,7 +135,7 @@ void MussaAlignedWindow::update()
 
 void MussaAlignedWindow::computeMatchLines()
 {
-  const vector<Sequence>& raw_sequence = analysis.sequences();
+  const vector<Sequence>& raw_seq = analysis.sequences();
   vector<int> aligned_path;
   size_t i2, i3;
   int x_start, x_end;
@@ -183,24 +183,19 @@ void MussaAlignedWindow::computeMatchLines()
           // RC case handling
           // ugh, and xor...only want rc coloring if just one of the nodes is rc
           // if both nodes are rc, then they are 'normal' relative to each other
-          if ( ( rc_list[i2] || rc_list[i2+1] ) &&
-              !(rc_list[i2] && rc_list[i2+1] ) )
+          if((rc_list[i2] || rc_list[i2+1] )&&!(rc_list[i2] && rc_list[i2+1]))
           { //the hideous rc matching logic - not complex, but annoying
-            if ( !( ( (raw_sequence[i2][x_start] == 'A') &&
-                    (raw_sequence[i2+1][x_end] == 'T') ) ||
-                  ( (raw_sequence[i2][x_start] == 'T') &&
-                    (raw_sequence[i2+1][x_end] == 'A') ) ||
-                  ( (raw_sequence[i2][x_start] == 'G') &&
-                    (raw_sequence[i2+1][x_end] == 'C') ) ||
-                  ( (raw_sequence[i2][x_start] == 'C') &&
-                    (raw_sequence[i2+1][x_end] == 'G') ) ) )
+            if(!(( (raw_seq[i2][x_start]=='A')&&(raw_seq[i2+1][x_end]=='T')) ||
+                  ((raw_seq[i2][x_start]=='T')&&(raw_seq[i2+1][x_end]=='A')) ||
+                  ((raw_seq[i2][x_start]=='G')&&(raw_seq[i2+1][x_end]=='C')) ||
+                  ((raw_seq[i2][x_start]=='C')&&(raw_seq[i2+1][x_end]=='G'))) )
               full_match = false;
           }
           else
           {
-            if (!( (raw_sequence[i2][x_start] == raw_sequence[i2+1][x_end]) &&
-                  (raw_sequence[i2][x_start] != 'N') &&
-                  (raw_sequence[i2+1][x_end] != 'N') ) )
+            if (!( (raw_seq[i2][x_start] == raw_seq[i2+1][x_end]) &&
+                  (raw_seq[i2][x_start] != 'N') &&
+                  (raw_seq[i2+1][x_end] != 'N') ) )
               full_match = false;
           }
         }