@@ -79,43 +79,43 @@ int main_flip(int argc, char **argv) {
7979
8080 graph.set_number_of_threads (num_threads);
8181
82- // path loading
83- auto load_paths = [&](const std::string& path_names_file) {
84- std::ifstream path_names_in (path_names_file);
85- uint64_t num_of_paths_in_file = 0 ;
86- std::vector<bool > path_already_seen;
87- path_already_seen.resize (graph.get_path_count (), false );
88- std::string line;
89- std::vector<path_handle_t > paths;
90- while (std::getline (path_names_in, line)) {
91- if (!line.empty ()) {
92- if (graph.has_path (line)) {
93- const path_handle_t path = graph.get_path_handle (line);
94- const uint64_t path_rank = as_integer (path) - 1 ;
95- if (!path_already_seen[path_rank]) {
96- path_already_seen[path_rank] = true ;
97- paths.push_back (path);
98- } else {
99- std::cerr << " [odgi::untangle] error: in the path list there are duplicated path names."
100- << std::endl;
101- exit (1 );
82+ std::vector<path_handle_t > no_flips;
83+ if (_no_flips) {
84+ // path loading
85+ auto load_paths = [&](const std::string& path_names_file) {
86+ std::ifstream path_names_in (path_names_file);
87+ uint64_t num_of_paths_in_file = 0 ;
88+ std::vector<bool > path_already_seen;
89+ path_already_seen.resize (graph.get_path_count (), false );
90+ std::string line;
91+ std::vector<path_handle_t > paths;
92+ while (std::getline (path_names_in, line)) {
93+ if (!line.empty ()) {
94+ if (graph.has_path (line)) {
95+ const path_handle_t path = graph.get_path_handle (line);
96+ const uint64_t path_rank = as_integer (path) - 1 ;
97+ if (!path_already_seen[path_rank]) {
98+ path_already_seen[path_rank] = true ;
99+ paths.push_back (path);
100+ } else {
101+ std::cerr << " [odgi::flip] error: in the path list there are duplicated path names."
102+ << std::endl;
103+ exit (1 );
104+ }
102105 }
106+ ++num_of_paths_in_file;
103107 }
104- ++num_of_paths_in_file;
105108 }
106- }
107- path_names_in.close ();
108- std::cerr << " [odgi::untangle] found " << paths.size () << " /" << num_of_paths_in_file
109- << " paths to consider." << std::endl;
110- if (paths.empty ()) {
111- std::cerr << " [odgi::untangle] error: no path to consider." << std::endl;
112- exit (1 );
113- }
114- return paths;
115- };
109+ path_names_in.close ();
110+ std::cerr << " [odgi::flip] found " << paths.size () << " /" << num_of_paths_in_file
111+ << " paths to consider." << std::endl;
112+ if (paths.empty ()) {
113+ std::cerr << " [odgi::flip] error: no path to consider." << std::endl;
114+ exit (1 );
115+ }
116+ return paths;
117+ };
116118
117- std::vector<path_handle_t > no_flips;
118- if (_no_flips) {
119119 no_flips = load_paths (args::get (_no_flips));
120120 }
121121
0 commit comments