Skip to content

Commit

Permalink
Here
Browse files Browse the repository at this point in the history
  • Loading branch information
1dayac committed Sep 3, 2023
1 parent 3144399 commit 5ca8f62
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions assembler/src/projects/spades/molecule_extraction_stage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ namespace debruijn_graph {
std::set<EdgeId> used_edges_;
PathStorage<Graph> temp_set_;
std::vector<EdgeId> getForwardIntersect(EdgeId e, const std::unordered_set<EdgeId> &edge_set) const {
DEBUG("Here");
auto edges = gp_.g.IncidentEdges(gp_.g.EdgeEnd(e));
std::vector<EdgeId> filtered;
for (auto temp_e : edges) {
Expand All @@ -42,6 +43,7 @@ namespace debruijn_graph {
}

std::vector<EdgeId> getReverseIntersect(EdgeId e, const std::unordered_set<EdgeId> &edge_set) const {
DEBUG("Here");
auto edges = gp_.g.IncidentEdges(gp_.g.EdgeStart(e));
std::vector<EdgeId> filtered;
for (auto temp_e : edges) {
Expand Down Expand Up @@ -92,6 +94,7 @@ namespace debruijn_graph {

void extendBackward(const std::unordered_set<EdgeId> &edge_set,
std::deque<EdgeId> &linear_path, EdgeId e) {
DEBUG("Here");
auto extensions = getReverseIntersect(e, edge_set);
for (auto prev_edge : extensions) {
linear_path.push_front(prev_edge);
Expand All @@ -104,6 +107,7 @@ namespace debruijn_graph {

void extendForward(const GraphComponent<Graph> &comp,
std::deque<EdgeId> &linear_path, std::set<EdgeId> &used_edges) {
DEBUG("Here");
EdgeId e = linear_path.back();
if (comp.VertexInDegree(gp_.g.EdgeEnd(e)) != 1 ||
comp.VertexOutDegree(gp_.g.EdgeEnd(e)) != 1 ) {
Expand Down Expand Up @@ -292,14 +296,19 @@ namespace debruijn_graph {
edge_set = initial_component.edges();
for (auto e : edge_set) {
if (!used_edges_.count(e)) {
DEBUG("Here");

std::deque<EdgeId> linear_path;
linear_path.push_back(e);
used_edges_.insert(e);
used_edges_.insert(gp_.g.conjugate(e));
extendForward(edge_set, linear_path, e);
extendBackward(edge_set, linear_path, e);
auto component = GraphComponent<Graph>::FromEdges(gp_.g, linear_path, true);
DEBUG("Here");
component.ClipTips();
DEBUG("Here");

if (IsSimplePath(component)) {
DEBUG("Component is a simple path");
std::vector<EdgeId> path;
Expand All @@ -316,6 +325,7 @@ namespace debruijn_graph {
}
}
}
DEBUG("Here");
used_edges_.clear();
return temp_set_;
}
Expand Down

0 comments on commit 5ca8f62

Please sign in to comment.