diff --git a/src/subcommand/position_main.cpp b/src/subcommand/position_main.cpp index 1bfafa97..985c1cd7 100644 --- a/src/subcommand/position_main.cpp +++ b/src/subcommand/position_main.cpp @@ -52,6 +52,7 @@ int main_position(int argc, char** argv) { args::ValueFlag _search_radius(position_opts, "DISTANCE", "Limit coordinate conversion breadth-first search up to DISTANCE bp from each given position (default: 10000).", {'d',"search-radius"}); args::ValueFlag _walking_dist(position_opts, "N", "Maximum walking distance in nucleotides for one orientation when finding the best target (reference) range for each query path (default: 10000). Note: If we walked 9999 base pairs and **w, --jaccard-context** is **10000**, we will also include the next node, even if we overflow the actual limit.", {'w', "jaccard-context"}); + args::Flag all_positions_of_ref_path(position_opts, "all-positions", "Emit all positions for all nodes in the specified ref-paths.", {"all-positions"}); args::Group threading_opts(parser, "[ Threading ]"); args::ValueFlag threads(threading_opts, "N", "Number of threads to use for parallel operations.", {'t', "threads"}); args::Group processing_info_opts(parser, "[ Processing Information ]"); @@ -141,6 +142,24 @@ int main_position(int argc, char** argv) { target_graph.for_each_path_handle([&](const path_handle_t& path) { ref_paths.push_back(path); }); } + if (ref_paths.size() > 0 && args::get(all_positions_of_ref_path)){ + std::cout << "path\tnode_id\tposition" << std::endl; + for (auto &path_handle : ref_paths) { + uint64_t walked = 0; + const auto path_end = target_graph.path_end(path_handle); + auto path_name = target_graph.get_path_name(path_handle); + for (step_handle_t cur_step = target_graph.path_begin(path_handle); + cur_step != path_end; + cur_step = target_graph.get_next_step(cur_step)) { + const handle_t cur_handle = target_graph.get_handle_of_step(cur_step); + std::cout << path_name << "\t" + << target_graph.get_id(cur_handle) << "\t" + << walked << std::endl; + walked += target_graph.get_length(cur_handle); + } + } + } + std::unordered_map> path_start_end_pos_map; std::string gff_in_file; if (gff_input) { diff --git a/src/subcommand/viz_main.cpp b/src/subcommand/viz_main.cpp index 1cf2b3e2..3ff4f042 100644 --- a/src/subcommand/viz_main.cpp +++ b/src/subcommand/viz_main.cpp @@ -95,7 +95,7 @@ namespace odgi { args::Flag color_path_names_background(path_names_viz_opts, "bool", "Color path names background with the same color as paths.",{'C', "color-path-names-background"}); args::ValueFlag _max_num_of_characters(path_names_viz_opts, "N", "Maximum number of characters to display for each path name (max 128" " characters). The default value is *the length of the longest path" - " name* (up to 32 characters).",{'c', "max-num-of-characters"}); + " name* (up to 128 characters).",{'c', "max-num-of-characters"}); /// Binned mode args::Group bin_opts(parser, "[ Binned Mode Options ]"); @@ -395,7 +395,7 @@ namespace odgi { } } - const size_t max_num_of_characters = args::get(_max_num_of_characters) > 1 ? min(args::get(_max_num_of_characters), (size_t) PATH_NAMES_MAX_NUM_OF_CHARACTERS) : 32; + const size_t max_num_of_characters = args::get(_max_num_of_characters) > 1 ? min(args::get(_max_num_of_characters), (size_t) PATH_NAMES_MAX_NUM_OF_CHARACTERS) : PATH_NAMES_MAX_NUM_OF_CHARACTERS; uint64_t path_count = graph.get_path_count(); const uint64_t pix_per_path = args::get(path_height) ? args::get(path_height) : 10;