From 81ee0e919368bdce4738493d0b02da453d8f65c0 Mon Sep 17 00:00:00 2001 From: AndreaGuarracino Date: Thu, 14 Mar 2024 13:45:09 -0500 Subject: [PATCH] emit last non-ref path range, if any --- src/subcommand/paths_main.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/subcommand/paths_main.cpp b/src/subcommand/paths_main.cpp index f531ea4c..03bc7efa 100644 --- a/src/subcommand/paths_main.cpp +++ b/src/subcommand/paths_main.cpp @@ -504,6 +504,22 @@ int main_paths(int argc, char** argv) { step_range.push_back(step); } }); + + // Emit last non reference range, if any + if (end > start && (end - start) >= min_size_in_bp) { + if (_show_step_ranges) { + std::string step_range_str = ""; + for (auto& step : step_range) { + const handle_t handle = graph.get_handle_of_step(step); + step_range_str += std::to_string(graph.get_id(handle)) + (graph.get_is_reverse(handle) ? "-" : "+") + ","; + } + #pragma omp critical (cout) + std::cout << graph.get_path_name(path) << "\t" << start << "\t" << end << "\t" << step_range_str.substr(0, step_range_str.size() - 1) << std::endl; // trim the trailing comma from step_range + } else { + #pragma omp critical (cout) + std::cout << graph.get_path_name(path) << "\t" << start << "\t" << end << std::endl; + } + } } } }