r1241: error out on unintended --score-N

Resolve #1226
This commit is contained in:
Heng Li
2025-04-01 10:12:53 -04:00
parent a955b1f31d
commit e816fd071c
3 changed files with 7 additions and 2 deletions

View File

@@ -5,7 +5,7 @@
#include <stdio.h>
#include <sys/types.h>
#define MM_VERSION "2.28-r1240-dirty"
#define MM_VERSION "2.28-r1241-dirty"
#define MM_F_NO_DIAG (0x001LL) // no exact diagonal hit
#define MM_F_NO_DUAL (0x002LL) // skip pairs where query name is lexicographically larger than target name

View File

@@ -414,7 +414,7 @@ no attempt to match GT-AG [n]
Score bonus when alignment extends to the end of the query sequence [0].
.TP
.BI --score-N \ INT
Score of a mismatch involving ambiguous bases [1].
Penalty of a mismatch involving ambiguous bases [1].
.TP
.BI --pe-ind-chain
For paired-end short reads, perform chaining for each end independently.

View File

@@ -249,6 +249,11 @@ int mm_check_opt(const mm_idxopt_t *io, const mm_mapopt_t *mo)
fprintf(stderr, "[ERROR]\033[1;31m scoring system violating ({-O}+{-E})+({-O2}+{-E2}) <= 127\033[0m\n");
return -1;
}
if (mo->sc_ambi < 0 || mo->sc_ambi >= mo->b) {
if (mm_verbose >= 1)
fprintf(stderr, "[ERROR]\033[1;31m --score-N should be within [0,{-B})\033[0m\n");
return -1;
}
if (mo->zdrop < mo->zdrop_inv) {
if (mm_verbose >= 1)
fprintf(stderr, "[ERROR]\033[1;31m Z-drop should not be less than inversion-Z-drop\033[0m\n");