r626: function to check incorrect scoring system
This commit is contained in:
parent
d003a00d71
commit
ab345e600b
4
main.c
4
main.c
|
|
@ -6,7 +6,7 @@
|
|||
#include "mmpriv.h"
|
||||
#include "getopt.h"
|
||||
|
||||
#define MM_VERSION "2.6-r625-dirty"
|
||||
#define MM_VERSION "2.6-r626-dirty"
|
||||
|
||||
#ifdef __linux__
|
||||
#include <sys/resource.h>
|
||||
|
|
@ -202,6 +202,8 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
if (!fnw && !(opt.flag&MM_F_CIGAR))
|
||||
ipt.flag |= MM_I_NO_SEQ;
|
||||
if (mm_check_opt(&ipt, &opt) < 0)
|
||||
return 1;
|
||||
|
||||
if (argc == optind || fp_help == stdout) {
|
||||
fprintf(fp_help, "Usage: minimap2 [options] <target.fa>|<target.idx> [query.fa] [...]\n");
|
||||
|
|
|
|||
15
map.c
15
map.c
|
|
@ -115,6 +115,21 @@ int mm_set_opt(const char *preset, mm_idxopt_t *io, mm_mapopt_t *mo)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int mm_check_opt(const mm_idxopt_t *io, const mm_mapopt_t *mo)
|
||||
{
|
||||
if (mo->a + 2 * (mo->q + mo->e) > 127 || mo->a + 2 * (mo->q2 + mo->e2) > 127) {
|
||||
if (mm_verbose >= 1)
|
||||
fprintf(stderr, "[ERROR]\033[1;31m scoring system violating {-A}+2*({-O}+{-E}) <= 127\033[0m\n");
|
||||
return -1;
|
||||
}
|
||||
if ((mo->q != mo->q2 || mo->e != mo->e2) && !(mo->e > mo->e2 && mo->q + mo->e < mo->q2 + mo->e2)) {
|
||||
if (mm_verbose >= 1)
|
||||
fprintf(stderr, "[ERROR]\033[1;31m dual gap penalties violating E1>E2 and O1+E1<O2+E2\033[0m\n");
|
||||
return -2;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
uint32_t n;
|
||||
uint32_t qpos;
|
||||
|
|
|
|||
|
|
@ -155,6 +155,7 @@ extern double mm_realtime0; // wall-clock timer
|
|||
* @return 0 if success; -1 if _present_ unknown
|
||||
*/
|
||||
int mm_set_opt(const char *preset, mm_idxopt_t *io, mm_mapopt_t *mo);
|
||||
int mm_check_opt(const mm_idxopt_t *io, const mm_mapopt_t *mo);
|
||||
|
||||
/**
|
||||
* Update mm_mapopt_t::mid_occ via mm_mapopt_t::mid_occ_frac
|
||||
|
|
|
|||
Loading…
Reference in New Issue