From 192ba0e3257430af813d697f20a0e38dc1b80f06 Mon Sep 17 00:00:00 2001 From: Anton Bankevich Date: Mon, 25 Nov 2024 02:54:59 -0500 Subject: [PATCH] Fix in parallel assignement of sequences to vertices and fix in primitive bulge corrector. --- src/projects/assembly_graph/assembly_graph_base.hpp | 5 ++++- .../error_correction/tournament_correction.cpp | 10 +++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/projects/assembly_graph/assembly_graph_base.hpp b/src/projects/assembly_graph/assembly_graph_base.hpp index cdd7117..40684da 100644 --- a/src/projects/assembly_graph/assembly_graph_base.hpp +++ b/src/projects/assembly_graph/assembly_graph_base.hpp @@ -623,10 +623,13 @@ namespace ag { VERIFY(isCanonical() == _seq.isCanonical()); if (getSeq().empty()) { seq = std::move(_seq); + Sequence rc_seq = seq.rc(); unlock(); if(rc_ != nullptr) { rc_->lock(); - rc_->seq = !getSeq(); + if(rc_->getSeq().empty()) { + rc_->seq = std::move(rc_seq); + } rc_->unlock(); } } else { diff --git a/src/projects/error_correction/tournament_correction.cpp b/src/projects/error_correction/tournament_correction.cpp index d9642af..f529957 100644 --- a/src/projects/error_correction/tournament_correction.cpp +++ b/src/projects/error_correction/tournament_correction.cpp @@ -266,10 +266,11 @@ namespace dbg { } std::string PrimitiveBulgeCorrector::correctRead(dbg::GraphPath &path) { - std::stringstream ss; size_t corrected = 0; + GraphPath result; for (PathPosition pos = path.firstPosition(); pos != path.lastPosition(); ++pos) { Edge &edge = pos.nextEdge(); + result += edge; if (path.getSegment(pos) != Segment(edge, 0, edge.truncSize())) { continue; } @@ -286,14 +287,17 @@ namespace dbg { if (edge.getCoverage() > alt.getCoverage()) { continue; } - Edge &rcEdge = edge.rc(); if (edge.getCoverage() + alt.getCoverage() > threshold || edge.getCoverage() > alt.getCoverage()) { continue; } corrected++; - path.reroute(pos, pos + 1, dbg::GraphPath(alt)); + result.pop_back(); + result += alt; } if (corrected > 0) { + result.setCutLeft(path.leftCut()); + result.setCutRight(path.rightCut()); + path = std::move(result); return itos(corrected); } else { return "";