Skip to content

Commit

Permalink
Fix in parallel assignement of sequences to vertices and fix in primi…
Browse files Browse the repository at this point in the history
…tive bulge corrector.
  • Loading branch information
AntonBankevich committed Nov 25, 2024
1 parent 244df7f commit 192ba0e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/projects/assembly_graph/assembly_graph_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
10 changes: 7 additions & 3 deletions src/projects/error_correction/tournament_correction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>(edge, 0, edge.truncSize())) {
continue;
}
Expand All @@ -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 "";
Expand Down

0 comments on commit 192ba0e

Please sign in to comment.