Skip to content

Commit

Permalink
Merge pull request #538 from kdm9/depth-windows-unique
Browse files Browse the repository at this point in the history
depth: option to use unique window depths
  • Loading branch information
subwaystation authored Nov 20, 2023
2 parents 5204cff + fdfc073 commit aa9a116
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/subcommand/depth_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ namespace odgi {
"merging regions not separated by more than LEN bp."
" When TIPS=1, retain only tips.",
{'W', "windows-out"});
args::Flag window_unique_depth(depth_opts, "window-unique-depth",
"For --window-in and --window-out, count UNIQUE depth, not total node depth",
{'U', "window-unique-depth"});


args::Group threading_opts(parser, "[ Threading ] ");
args::ValueFlag<uint64_t> _num_threads(threading_opts, "N", "Number of threads to use in parallel operations.", {'t', "threads"});
Expand Down Expand Up @@ -437,7 +441,11 @@ namespace odgi {
graph.for_each_handle(
[&](const handle_t& h) {
auto id = graph.get_id(h);
depths[id - shift] = get_graph_node_depth(graph, id, paths_to_consider).first;
if (window_unique_depth) {
depths[id - shift] = get_graph_node_depth(graph, id, paths_to_consider).second; // Unique depth
} else {
depths[id - shift] = get_graph_node_depth(graph, id, paths_to_consider).first; // Total depth
}
}, true);

auto in_bounds =
Expand Down

0 comments on commit aa9a116

Please sign in to comment.