dev-r1080: fixed negative dp_max

This commit is contained in:
Heng Li 2021-07-18 21:07:14 -04:00
parent 161ae7ff73
commit 1a8373bb84
2 changed files with 5 additions and 2 deletions

View File

@ -953,6 +953,7 @@ static void mm_update_dp_max(int qlen, int n_regs, mm_reg1_t *regs, float frac,
mm_reg1_t *r = &regs[i];
if (r->p == 0) continue;
r->p->dp_max = mm_recal_max_dp(r, b2, a);
if (r->p->dp_max < 0) r->p->dp_max = 0;
}
}
@ -1010,8 +1011,10 @@ mm_reg1_t *mm_align_skeleton(void *km, const mm_mapopt_t *opt, const mm_idx_t *m
kfree(km, qseq0[0]);
kfree(km, ez.cigar);
mm_filter_regs(opt, qlen, n_regs_, regs);
if (!(opt->flag&MM_F_SR) && qlen >= opt->rank_min_len)
if (!(opt->flag&MM_F_SR) && qlen >= opt->rank_min_len) {
mm_update_dp_max(qlen, *n_regs_, regs, opt->rank_frac, opt->a, opt->b);
mm_filter_regs(opt, qlen, n_regs_, regs);
}
mm_hit_sort(km, n_regs_, regs, opt->alt_drop);
return regs;
}

2
main.c
View File

@ -7,7 +7,7 @@
#include "mmpriv.h"
#include "ketopt.h"
#define MM_VERSION "2.21-dev-r1079-dirty"
#define MM_VERSION "2.21-dev-r1080-dirty"
#ifdef __linux__
#include <sys/resource.h>