cout << "path number is: " << pathz.size() << endl;
pathz_i = pathz.begin();
- ext_path = ExtendedConservedPath( win_size, *pathz_i);
- while(pathz_i != pathz.end())
+ // only try to extend when pathz isn't empty.
+ if (pathz_i != pathz.end())
{
- // keep track of current path and advance to next path
- cur_path = pathz_i;
- ++pathz_i;
- if (pathz_i == pathz.end())
- end = true;
- else
- next_path = pathz_i;
-
- if (not end)
- {
- // if node for each seq is equal to the next node+1 then for all
- // sequences then we are extending
- extending = cur_path->nextTo(*next_path);
- }
- else
- extending = false;
+ ext_path = ExtendedConservedPath( win_size, *pathz_i);
- if (extending)
- {
- //cout << "Raaaawwwrrr! I am extending\n";
- win_ext_len++;
- }
- else
+ while(pathz_i != pathz.end())
{
- // add the extend window length as first element and add as refined
- // now that we have the path to extend save it
- new_path = ext_path;
- new_path.extend(win_ext_len);
- refined_pathz.push_back(new_path);
- // reset stuff
- win_ext_len = 0;
- ext_path = ExtendedConservedPath( win_size, *next_path);
+ // keep track of current path and advance to next path
+ cur_path = pathz_i;
+ ++pathz_i;
+ if (pathz_i == pathz.end())
+ end = true;
+ else
+ next_path = pathz_i;
+
+ if (not end)
+ {
+ // if node for each seq is equal to the next node+1 then for all
+ // sequences then we are extending
+ extending = cur_path->nextTo(*next_path);
+ }
+ else
+ extending = false;
+
+ if (extending)
+ {
+ //cout << "Raaaawwwrrr! I am extending\n";
+ win_ext_len++;
+ }
+ else
+ {
+ // add the extend window length as first element and add as refined
+ // now that we have the path to extend save it
+ new_path = ext_path;
+ new_path.extend(win_ext_len);
+ refined_pathz.push_back(new_path);
+ // reset stuff
+ win_ext_len = 0;
+ ext_path = ExtendedConservedPath( win_size, *next_path);
+ }
}
}
cout << "r_path number is: " << refined_pathz.size() << endl;