Skip to content

Commit

Permalink
Fix logic error
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelm committed Aug 23, 2023
1 parent 715fced commit 097807b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/aln.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,10 @@ static inline void align_SE(
best_alignment.score = -100000;
best_alignment.is_unaligned = true;
int min_mapq_diff = best_edit_distance;

for (auto &nam : nams) {
float score_dropoff = (float) nam.n_hits / n_max.n_hits;
if (tries >= max_tries || (max_tries > 1 && best_edit_distance == 0) || score_dropoff < dropoff_threshold) {
if (tries >= max_tries || (tries > 1 && best_edit_distance == 0) || score_dropoff < dropoff_threshold) {
break;
}
bool consistent_nam = reverse_nam_if_needed(nam, read, references, k);
Expand All @@ -125,7 +126,6 @@ static inline void align_SE(
}
tries++;
}

if (max_secondary == 0) {
best_alignment.mapq = std::min(min_mapq_diff, 60);
sam.add(best_alignment, record, read.rc, true, details);
Expand Down

0 comments on commit 097807b

Please sign in to comment.