1 #include <boost/test/auto_unit_test.hpp>
6 #include "alg/mussa.hpp"
7 #include "alg/nway_paths.hpp"
8 #include "alg/sequence.hpp"
12 //! there should be no matches
13 BOOST_AUTO_TEST_CASE( nway_null )
15 string s0("AAAANNNN");
16 string s1("GGGGNNNN");
17 string s2("TTTTNNNN");
20 analysis.add_a_seq(s0);
21 analysis.add_a_seq(s1);
22 analysis.add_a_seq(s2);
23 analysis.analyze(4,3);
24 NwayPaths npath = analysis.paths();
25 // there should be no paths for these sequences
26 for (std::list<ConservedPath >::iterator pathz_i = npath.pathz.begin();
27 pathz_i != npath.pathz.end();
30 BOOST_CHECK_EQUAL( pathz_i->size(), 0);
34 BOOST_AUTO_TEST_CASE( nway_test )
36 string s0("ATATGCGC");
37 string s1("GGGGGGGC");
41 analysis.add_a_seq(s0);
42 analysis.add_a_seq(s1);
43 analysis.analyze(4,3);
44 NwayPaths npath = analysis.paths();
45 for (std::list<ConservedPath >::iterator pathz_i = npath.pathz.begin();
46 pathz_i != npath.pathz.end();
49 for( ConservedPath::iterator path_i = pathz_i->begin();
50 path_i != pathz_i->end();
53 BOOST_CHECK( *path_i == 4 || *path_i == -4);
59 BOOST_AUTO_TEST_CASE( nway_refine )
62 m1.load_mupa_file( "examples/mck3test.mupa" );
64 const NwayPaths& npath = m1.paths();
65 BOOST_CHECK_EQUAL (npath.path_size(), npath.refined_path_size());
66 size_t first_refined_size = npath.refined_path_size();
67 BOOST_CHECK( first_refined_size > 0 );
69 // we're using a window size 30 (threshold 20) example
70 m1.set_soft_thres(22);
72 BOOST_CHECK( npath.refined_path_size() > 0);
73 BOOST_CHECK( npath.refined_path_size() < first_refined_size);
75 m1.set_soft_thres(20);
77 BOOST_CHECK_EQUAL(npath.refined_path_size(), first_refined_size);