Skip to content

Commit

Permalink
Ensure we never report MAPQ=0 if best and 2nd best score differs
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelm committed Nov 15, 2023
1 parent d4faa1d commit acac70b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/aln.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ static inline void align_SE(
}
tries++;
}
uint8_t mapq = 60.0 * (best_score - second_best_score) / best_score;
uint8_t mapq = (60.0 * (best_score - second_best_score) + best_score - 1) / best_score;

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

0 comments on commit acac70b

Please sign in to comment.