Update mussa to build on ubuntu 10.04 with qt 4.6.2 +boost 1.40.0.1
[mussa.git] / alg / nway_other.cpp
index 5e239366a2e3828f4411bd974835cea3e517fb5c..08a19fd620a91af6d779eb672402ba908e1cbcff 100644 (file)
@@ -163,7 +163,7 @@ NwayPaths::radiate_path_search(vector<vector<FLPs> > all_comparisons)
         // add path that each species iterator is pointing to
         set_path_to_cur_sp_itor_track(path, win_i, sp_itor_begin);
        
-        pathz.push_back(ConservedPath(soft_thres, path));
+        pathz.push_back(ConservedPath(win_size, soft_thres, path));
 
         // now advance the right iterator
         still_paths = advance_sp_itor_track(sp_itor_begin, 
@@ -216,7 +216,6 @@ NwayPaths::trans_path_search(vector<vector<FLPs> > all_comparisons)
   vector<list<int>::iterator> sp_itor_begin(all_comparisons.size()); 
   vector<list<int>::iterator> sp_itor_end(all_comparisons.size()); 
 
-
   //cout << "trans: softhres = " << soft_thres;
   //cout << ", window = " << win_size << ", ";
 
@@ -229,7 +228,7 @@ NwayPaths::trans_path_search(vector<vector<FLPs> > all_comparisons)
   {
     // if 1st seq has a match to all the others for this window,
     // then make all possible paths out of all these matches (in all_matches)
-    if(make_all_seq_win_matches(all_comparisons, all_matches, win_i, soft_thres))
+    if(make_all_seq_win_matches(all_comparisons, all_matches, win_i,soft_thres))
     {
       //debug? //dump_matches_win(win_i, all_matches);
       reset_species_iterators(all_matches, sp_itor_begin, sp_itor_end);
@@ -241,8 +240,10 @@ NwayPaths::trans_path_search(vector<vector<FLPs> > all_comparisons)
         set_path_to_cur_sp_itor_track(path, win_i, sp_itor_begin);
 
         // if the path is transitive, save the path
-        if (is_transitive_path(path, all_comparisons, soft_thres))
-          pathz.push_back(ConservedPath(soft_thres, path));
+        if (is_transitive_path(path, all_comparisons, soft_thres)) {
+          ConservedPath new_path(win_size, soft_thres, path);
+          pathz.push_back(new_path);
+        }
 
         // now advance the right iterator
         still_paths = advance_sp_itor_track(sp_itor_begin, 
@@ -250,8 +251,13 @@ NwayPaths::trans_path_search(vector<vector<FLPs> > all_comparisons)
                                             all_matches);
       }
     }
+    if ((win_i % 1000) == 0) {
+      emit progress("transitive refinement", win_i, window_num);
+    }
   }
-  //clog << "all_cmp=" << all_comparisons.size();
+  emit progress("transitive refinement", window_num, window_num);
+  //clog << "pathz=" << pathz.size()
+  //     << " all_cmp=" << all_comparisons.size();
   //if (pathz.begin() != pathz.end())
   //  clog << " path_size=" << pathz.begin()->size();
   //else