diff --git a/bdsg/src/odgi.cpp b/bdsg/src/odgi.cpp index 030cbb51..fcd3dd5f 100644 --- a/bdsg/src/odgi.cpp +++ b/bdsg/src/odgi.cpp @@ -1131,6 +1131,22 @@ std::vector ODGI::divide_handle(const handle_t& handle, const std::vec for (auto& s : seqs) { handles.push_back(create_handle(s)); } + + // update the backwards references back onto this node + handle_t last_handle = handles.back(); + follow_edges(fwd_handle, false, [&](const handle_t& h) { + if (h == flip(fwd_handle)) { + // destroy_edge(last_handle, h); + create_edge(last_handle, flip(handles.back())); + } + }); + // update the forward references back onto this node + follow_edges(handle, left, [&](const handle_t& h) { + if (h == flip(handle)) { + create_edge(h, handles.front()); + } + }); + // and record their reverse, for use in path fixup std::vector rev_handles; for (auto& h : handles) { diff --git a/bdsg/src/test_libbdsg.cpp b/bdsg/src/test_libbdsg.cpp index b9173175..63b90243 100644 --- a/bdsg/src/test_libbdsg.cpp +++ b/bdsg/src/test_libbdsg.cpp @@ -1357,8 +1357,8 @@ void test_deletable_handle_graphs() { PackedGraph pg; implementations.push_back(&pg); - //ODGI og; - //implementations.push_back(&og); + ODGI og; + implementations.push_back(&og); for (DeletableHandleGraph* implementation : implementations) { DeletableHandleGraph& graph = *implementation;