Skip to content

Commit

Permalink
Merge pull request #384 from pangenome/heaps-tweaks
Browse files Browse the repository at this point in the history
tweaks to odgi heaps
  • Loading branch information
ekg authored Apr 13, 2022
2 parents 6be13b5 + 111eb3c commit d66d947
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/subcommand/heaps_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,22 @@ int main_heaps(int argc, char **argv) {
uint64_t start = std::stoul(vals[1]);
uint64_t end = std::stoul(vals[2]);
if (!graph.has_path(path_name)) {
std::cerr << "[odgi::heaps] no path '" << path_name << "' in graph" << std::endl;
return 1;
//std::cerr << "[odgi::heaps] warning: no path '" << path_name << "' in graph" << std::endl;
} else {
auto path = graph.get_path_handle(path_name);
intervals[path].push_back(algorithms::interval_t(start, end));
}
auto path = graph.get_path_handle(path_name);
intervals[path].push_back(algorithms::interval_t(start, end));
}
}
// ensure sorted input
std::vector<std::vector<algorithms::interval_t>*> v;
for (auto& i : intervals) {
v.push_back(&i.second);
}
#pragma omp parallel for
for (auto& ivals : v) {
std::sort(ivals->begin(), ivals->end());
}
}

graph.set_number_of_threads(num_threads);
Expand Down

0 comments on commit d66d947

Please sign in to comment.