Skip to content

Commit

Permalink
Quick fix to process conjugate overlaps
Browse files Browse the repository at this point in the history
  • Loading branch information
asl committed Sep 26, 2024
1 parent 91e6772 commit 2468e6e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/common/assembly_graph/core/debruijn_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,20 +110,20 @@ class DeBruijnVertexData {
return overlap_.get<ExplicitOverlap>();
}

auto &links() {
[[nodiscard]] auto &links() {
return overlap_.get<ComplexOverlap>()->links();
}

auto links() const {
[[nodiscard]] auto links() const {
return overlap_.get<ComplexOverlap>()->links();
}

auto move_links() {
[[nodiscard]] auto move_links() {
return overlap_.get<ComplexOverlap>()->move();
}

auto clear_links() {
return overlap_.get<ComplexOverlap>()->clear();
void clear_links() {
overlap_.get<ComplexOverlap>()->clear();
}

void add_link(LinkId link) {
Expand Down
2 changes: 1 addition & 1 deletion src/common/assembly_graph/core/graph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class DeBruijnGraph: public omnigraph::ObservableGraph<DeBruijnDataMaster> {
}

auto move_links(VertexId v) {
data(v).move_links();
return data(v).move_links();
}

auto clear_links(VertexId v) {
Expand Down
5 changes: 5 additions & 0 deletions src/common/io/graph/gfa_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ static std::pair<unsigned, bool> ProcessLinks(DeBruijnGraph &g, const Links &lin
}
}

INFO("Overlaps: " << (simple ? "simple" : "complex"));

auto helper = g.GetConstructionHelper();
for (const auto &link: links) {
EdgeId e1 = std::get<0>(link), e2 = std::get<1>(link);
Expand All @@ -173,7 +175,10 @@ static std::pair<unsigned, bool> ProcessLinks(DeBruijnGraph &g, const Links &lin
if (simple) {
g.set_overlap(v1, ovl);
g.set_overlap(v2, ovl);
g.set_overlap(g.conjugate(v1), ovl);
g.set_overlap(g.conjugate(v2), ovl);
} else {
// FIXME: Correctly add conjugate links
LinkId link_idx = g.add_link(e1, e2, ovl);
g.add_link(v1, link_idx);
if (v1 != v2) {
Expand Down

0 comments on commit 2468e6e

Please sign in to comment.