View sequence alignment at non default thresholds
authorDiane Trout <diane@caltech.edu>
Wed, 29 Mar 2006 06:54:27 +0000 (06:54 +0000)
committerDiane Trout <diane@caltech.edu>
Wed, 29 Mar 2006 06:54:27 +0000 (06:54 +0000)
ticket:63
The counter being used to track what segments went to what paths wasn't
being reset properly. One would be looking for a selectedid (from the
opengl objects) that was greather than any currently viewable path.

alg/glseqbrowser.cpp
alg/nway_paths.hpp
alg/test/test_nway.cpp
qui/MussaAlignedWindow.cpp
qui/MussaWindow.cpp

index fafe6907995572643feca82ac347c75f82f75184..1c9ea84dc48c202257d69f4b222e4a680e400f4b 100644 (file)
@@ -301,7 +301,6 @@ void GlSeqBrowser::push_sequence(const Sequence &s)
 void GlSeqBrowser::push_sequence(GlSequence &gs)
 {
   clear_links();
-  pathid = 0;
   track_container.push_back(gs);
   update_layout();
   if (track_container.size() > 1)
@@ -320,6 +319,7 @@ void GlSeqBrowser::clear_links()
   {
     path_segments.push_back(pair_segment_map());
   }
+  pathid = 0;
 }
 
 void 
index ccf7ea008a91ac8f036c12615f2e3f2409a5c6f8..1a2b002abd741a5009ae28a5f7319c6bbbd61c4a 100644 (file)
@@ -73,10 +73,12 @@ class NwayPaths
     std::list<ConservedPath>::iterator pend() { return pathz.end() ; }
     std::list<ConservedPath>::const_iterator pbegin() const { return pathz.begin() ; }
     std::list<ConservedPath>::const_iterator pend() const { return pathz.end() ; }
+    size_t path_size() const { return refined_pathz.size(); }
     std::list<ExtendedConservedPath>::iterator rpbegin() { return refined_pathz.begin() ; }
     std::list<ExtendedConservedPath>::const_iterator rpend() const { return refined_pathz.end() ; }
     std::list<ExtendedConservedPath>::const_iterator rpbegin() const { return refined_pathz.begin() ; }
     std::list<ExtendedConservedPath>::iterator rpend() { return refined_pathz.end() ; }
+    size_t refined_path_size() const { return refined_pathz.size(); }
     // these probably shouldn't be public, but lets start 
     // simple
     std::list<ConservedPath> pathz;
index d67753c0aeb3e01e40713d8426e5deb4d701306d..53508dfe1b121c3ea22d783fdb716d9ed2de0aa6 100644 (file)
@@ -55,4 +55,24 @@ BOOST_AUTO_TEST_CASE( nway_test )
   }
 }
 
+#include <unistd.h>
+BOOST_AUTO_TEST_CASE( nway_refine )
+{
+  Mussa m1;
+  m1.load_mupa_file( "examples/mck3test.mupa" );
+  m1.analyze(0, 0);
+  const NwayPaths& npath = m1.paths();
+  BOOST_CHECK_EQUAL (npath.path_size(), npath.refined_path_size());
+  size_t first_refined_size = npath.refined_path_size();
+  BOOST_CHECK( first_refined_size > 0 );
+
+  // we're using a window size 30 (threshold 20) example
+  m1.set_soft_thres(22);
+  m1.nway();
+  BOOST_CHECK( npath.refined_path_size() > 0);
+  BOOST_CHECK( npath.refined_path_size() < first_refined_size);
 
+  m1.set_soft_thres(20);
+  m1.nway();
+  BOOST_CHECK_EQUAL(npath.refined_path_size(), first_refined_size);
+}
index 3e67aba4f1ed830902a71a614d5c439572df90db..6f61949f4a2fe92a52d7a24819b21026725cd723 100644 (file)
@@ -9,6 +9,7 @@
 #include "qui/MussaAlignedWindow.hpp"
 #include "alg/sequence.hpp"
 
+#include <iostream>
 using namespace std;
 
 MussaAlignedWindow::MussaAlignedWindow(Mussa& m, 
index 5c160914ae700a64989f94c732353419768431a0..9e0678c57137ff53b7f859ee7a799bda6a32e676 100644 (file)
@@ -373,7 +373,6 @@ void MussaWindow::updateAnalysis()
   browser.setSequences(seqs, analysis->colorMapper());
   updateLinks();
   browser.zoomOut();
-  cout << "browser zoom " <<  browser.zoom() << endl;
   zoom.setValue(browser.zoom());
 }
 
@@ -419,7 +418,8 @@ void MussaWindow::updateLinks()
         reversed = false;
       } else {
         reversed = true;
-        x = -x; // make positive
+        // make positive 
+        x = -x;
       }
       normalized_path.push_back(x);
       rc_flags.push_back(reversed);