From e3bfc39bd36fa3e00516a5c2e30e3d40d30e4e56 Mon Sep 17 00:00:00 2001 From: Diane Trout Date: Wed, 29 Mar 2006 06:54:27 +0000 Subject: [PATCH] View sequence alignment at non default thresholds 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 | 2 +- alg/nway_paths.hpp | 2 ++ alg/test/test_nway.cpp | 20 ++++++++++++++++++++ qui/MussaAlignedWindow.cpp | 1 + qui/MussaWindow.cpp | 4 ++-- 5 files changed, 26 insertions(+), 3 deletions(-) diff --git a/alg/glseqbrowser.cpp b/alg/glseqbrowser.cpp index fafe690..1c9ea84 100644 --- a/alg/glseqbrowser.cpp +++ b/alg/glseqbrowser.cpp @@ -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 diff --git a/alg/nway_paths.hpp b/alg/nway_paths.hpp index ccf7ea0..1a2b002 100644 --- a/alg/nway_paths.hpp +++ b/alg/nway_paths.hpp @@ -73,10 +73,12 @@ class NwayPaths std::list::iterator pend() { return pathz.end() ; } std::list::const_iterator pbegin() const { return pathz.begin() ; } std::list::const_iterator pend() const { return pathz.end() ; } + size_t path_size() const { return refined_pathz.size(); } std::list::iterator rpbegin() { return refined_pathz.begin() ; } std::list::const_iterator rpend() const { return refined_pathz.end() ; } std::list::const_iterator rpbegin() const { return refined_pathz.begin() ; } std::list::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 pathz; diff --git a/alg/test/test_nway.cpp b/alg/test/test_nway.cpp index d67753c..53508df 100644 --- a/alg/test/test_nway.cpp +++ b/alg/test/test_nway.cpp @@ -55,4 +55,24 @@ BOOST_AUTO_TEST_CASE( nway_test ) } } +#include +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); +} diff --git a/qui/MussaAlignedWindow.cpp b/qui/MussaAlignedWindow.cpp index 3e67aba..6f61949 100644 --- a/qui/MussaAlignedWindow.cpp +++ b/qui/MussaAlignedWindow.cpp @@ -9,6 +9,7 @@ #include "qui/MussaAlignedWindow.hpp" #include "alg/sequence.hpp" +#include using namespace std; MussaAlignedWindow::MussaAlignedWindow(Mussa& m, diff --git a/qui/MussaWindow.cpp b/qui/MussaWindow.cpp index 5c16091..9e0678c 100644 --- a/qui/MussaWindow.cpp +++ b/qui/MussaWindow.cpp @@ -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); -- 2.30.2