len(mussa.paths()) should equal the number of found paths
[mussa.git] / alg / nway_paths.cpp
index df2cf2e0d9794e788341a7c3c6da10d2e7596d58..e7a8474b9ce062d7cafd47cdbe88855d81f3405b 100644 (file)
@@ -185,7 +185,7 @@ NwayPaths::save(fs::path save_file_path)
     //cout << a_path.size() << endl;
     //first entry is the window length of the windows in the path
     save_file << a_path.window_size << ":";
-    for(size_t i = 0; i != sequence_count(); ++i)
+    for(size_type i = 0; i != sequence_count(); ++i)
     {
       save_file << a_path[i];
       if (i != sequence_count())
@@ -200,8 +200,7 @@ NwayPaths::save(fs::path save_file_path)
 }
 
 
-size_t
-NwayPaths::sequence_count()
+NwayPaths::size_type NwayPaths::sequence_count() const
 {
   if (refined_pathz.begin() == refined_pathz.end() )
     return 0;
@@ -209,6 +208,10 @@ NwayPaths::sequence_count()
     return refined_pathz.begin()->size();
 }
 
+NwayPaths::size_type NwayPaths::size() const
+{
+  return pathz.size();
+}  
 
 void
 NwayPaths::load(fs::path load_file_path)
@@ -274,7 +277,7 @@ NwayPaths::load(fs::path load_file_path)
         // whats our window size?
         path_width = file_data_line.substr(0,colon_split_i); 
         file_data_line = file_data_line.substr(colon_split_i+1);
-        for(size_t i = 0; i < species_num; i++)
+        for(size_type i = 0; i < species_num; i++)
         {
           comma_split_i = file_data_line.find(",");
           path_node = file_data_line.substr(0, comma_split_i); 
@@ -295,7 +298,7 @@ NwayPaths::load(fs::path load_file_path)
 
 
 void
-NwayPaths::path_search(vector<vector<FLPs> > all_comparisons, ConservedPath path, size_t depth)
+NwayPaths::path_search(vector<vector<FLPs> > all_comparisons, ConservedPath path, size_type depth)
 {
   list<int> new_nodes, trans_check_nodes;
   list<int>::iterator new_nodes_i, new_nodes_end;
@@ -309,7 +312,7 @@ NwayPaths::path_search(vector<vector<FLPs> > all_comparisons, ConservedPath path
     //cout << "    * species " << depth << " node: " << *new_nodes_i << endl;
     // check transitivity with previous nodes in path
     trans_check_good = true;
-    for(size_t i = 0; i < depth - 1; i++)
+    for(size_type i = 0; i < depth - 1; i++)
     {
       trans_check_nodes = all_comparisons[i][depth].match_locations(path[i]);
       if ( (trans_check_nodes.end() == find(trans_check_nodes.begin(),
@@ -381,7 +384,7 @@ NwayPaths::save_old(fs::path save_file_path)
 {
   fs::fstream save_file;
   list<ConservedPath >::iterator path_i, paths_end;
-  size_t i;
+  size_type i;
 
   save_file.open(save_file_path, ios::app);