Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug in nested deconstrution #4464

Merged
merged 1 commit into from
Dec 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions src/traversal_clusters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,10 @@ vector<vector<int>> assign_child_snarls_to_traversals(const PathHandleGraph* gra
const vector<pair<handle_t, handle_t>>& child_snarls) {

// index the child snarls
unordered_map<handle_t, int> handle_to_child;
unordered_map<handle_t, vector<int>> handle_to_child;
for (int64_t i = 0; i < child_snarls.size(); ++i) {
handle_to_child[child_snarls[i].first] = i;
handle_to_child[child_snarls[i].second] = i;
handle_to_child[child_snarls[i].first].push_back(i);
handle_to_child[child_snarls[i].second].push_back(i);
}

// use the index to find which snarls are fully contained in a given traversal
Expand All @@ -248,11 +248,15 @@ vector<vector<int>> assign_child_snarls_to_traversals(const PathHandleGraph* gra
map<int, int> rv_count;
for (const handle_t& handle : trav) {
if (handle_to_child.count(handle)) {
fw_count[handle_to_child[handle]] += 1;
for (int child : handle_to_child[handle]) {
fw_count[child] += 1;
}
}
handle_t rhandle = graph->flip(handle);
if (handle_to_child.count(rhandle)) {
rv_count[handle_to_child[rhandle]] += 1;
for (int child : handle_to_child[handle]) {
rv_count[child] += 1;
}
}
}
vector<int> contained_snarls;
Expand Down
Loading