From 98c139eb52ff3082e174837b58f9a94a38fdabd0 Mon Sep 17 00:00:00 2001 From: AndreaGuarracino Date: Fri, 21 Oct 2022 09:28:37 -0500 Subject: [PATCH] typos and tweak in odgi flip --- src/subcommand/flip_main.cpp | 66 ++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/src/subcommand/flip_main.cpp b/src/subcommand/flip_main.cpp index 86c3f0cd..f3fe4a38 100644 --- a/src/subcommand/flip_main.cpp +++ b/src/subcommand/flip_main.cpp @@ -79,43 +79,43 @@ int main_flip(int argc, char **argv) { graph.set_number_of_threads(num_threads); - // path loading - auto load_paths = [&](const std::string& path_names_file) { - std::ifstream path_names_in(path_names_file); - uint64_t num_of_paths_in_file = 0; - std::vector path_already_seen; - path_already_seen.resize(graph.get_path_count(), false); - std::string line; - std::vector paths; - while (std::getline(path_names_in, line)) { - if (!line.empty()) { - if (graph.has_path(line)) { - const path_handle_t path = graph.get_path_handle(line); - const uint64_t path_rank = as_integer(path) - 1; - if (!path_already_seen[path_rank]) { - path_already_seen[path_rank] = true; - paths.push_back(path); - } else { - std::cerr << "[odgi::untangle] error: in the path list there are duplicated path names." - << std::endl; - exit(1); + std::vector no_flips; + if (_no_flips) { + // path loading + auto load_paths = [&](const std::string& path_names_file) { + std::ifstream path_names_in(path_names_file); + uint64_t num_of_paths_in_file = 0; + std::vector path_already_seen; + path_already_seen.resize(graph.get_path_count(), false); + std::string line; + std::vector paths; + while (std::getline(path_names_in, line)) { + if (!line.empty()) { + if (graph.has_path(line)) { + const path_handle_t path = graph.get_path_handle(line); + const uint64_t path_rank = as_integer(path) - 1; + if (!path_already_seen[path_rank]) { + path_already_seen[path_rank] = true; + paths.push_back(path); + } else { + std::cerr << "[odgi::flip] error: in the path list there are duplicated path names." + << std::endl; + exit(1); + } } + ++num_of_paths_in_file; } - ++num_of_paths_in_file; } - } - path_names_in.close(); - std::cerr << "[odgi::untangle] found " << paths.size() << "/" << num_of_paths_in_file - << " paths to consider." << std::endl; - if (paths.empty()) { - std::cerr << "[odgi::untangle] error: no path to consider." << std::endl; - exit(1); - } - return paths; - }; + path_names_in.close(); + std::cerr << "[odgi::flip] found " << paths.size() << "/" << num_of_paths_in_file + << " paths to consider." << std::endl; + if (paths.empty()) { + std::cerr << "[odgi::flip] error: no path to consider." << std::endl; + exit(1); + } + return paths; + }; - std::vector no_flips; - if (_no_flips) { no_flips = load_paths(args::get(_no_flips)); }