Skip to content

Commit

Permalink
Merge pull request #327 from ksahlin/mapqse
Browse files Browse the repository at this point in the history
Avoid MAPQ=60 for single-end multimappers
  • Loading branch information
marcelm authored Aug 23, 2023
2 parents 14e3c7e + 097807b commit 678654c
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 || 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 678654c

Please sign in to comment.