diff --git a/hit.c b/hit.c index e1bb3b9..4d98847 100644 --- a/hit.c +++ b/hit.c @@ -203,7 +203,7 @@ void mm_filter_regs(void *km, const mm_mapopt_t *opt, int *n_regs, mm_reg1_t *re for (i = k = 0; i < *n_regs; ++i) { mm_reg1_t *r = ®s[i]; int flt = 0; - if (!r->inv && r->cnt < opt->min_cnt) flt = 1; + if (!r->inv && !r->seg_split && r->cnt < opt->min_cnt) flt = 1; if (r->p) { if (r->p->blen - r->p->n_ambi - r->p->n_diff < opt->min_chain_score) flt = 1; else if (r->p->dp_max < opt->min_dp_max) flt = 1; @@ -342,6 +342,8 @@ mm_seg_t *mm_seg_gen(void *km, int n_segs, const int *qlens, int n_regs0, const for (s = 0; s < n_segs; ++s) { regs[s] = mm_gen_regs(km, qlens[s], seg[s].n_u, seg[s].u, seg[s].a); n_regs[s] = seg[s].n_u; + for (i = 0; i < n_regs[s]; ++i) + regs[s][i].seg_split = 1; } return seg; } diff --git a/main.c b/main.c index 89b2c47..014c57b 100644 --- a/main.c +++ b/main.c @@ -6,7 +6,7 @@ #include "mmpriv.h" #include "getopt.h" -#define MM_VERSION "2.2-r442-dirty" +#define MM_VERSION "2.2-r443-dirty" #ifdef __linux__ #include diff --git a/map.c b/map.c index 1568675..10e5054 100644 --- a/map.c +++ b/map.c @@ -234,7 +234,7 @@ static void chain_post(const mm_mapopt_t *opt, const mm_idx_t *mi, void *km, int if (!(opt->flag & MM_F_AVA)) { // don't choose primary mapping(s) for read overlap mm_set_parent(km, opt->mask_level, *n_regs, regs, opt->a * 2 + opt->b); if (n_segs <= 1) mm_select_sub(km, opt->pri_ratio, mi->k*2, opt->best_n, n_regs, regs); - else mm_select_sub_multi(km, opt->pri_ratio, 0.2f, 0.7f, opt->max_gap_ref, mi->k*2, opt->best_n, n_segs, qlens, n_regs, regs); + else mm_select_sub_multi(km, opt->pri_ratio, 0.2f, 0.7f, opt->max_gap_ref, mi->k*2, opt->best_n * n_segs, n_segs, qlens, n_regs, regs); if (!(opt->flag & MM_F_SPLICE) && !(opt->flag & MM_F_SR)) mm_join_long(km, opt, qlen, n_regs, regs, a); // TODO: this can be applied to all-vs-all in principle } diff --git a/minimap.h b/minimap.h index 742a4a7..4d7f393 100644 --- a/minimap.h +++ b/minimap.h @@ -61,7 +61,7 @@ typedef struct { typedef struct { int32_t id; // ID for internal uses (see also parent below) - uint32_t cnt:31, rev:1; // number of minimizers; if on the reverse strand + uint32_t cnt:30, rev:1, seg_split:1; // number of minimizers; if on the reverse strand uint32_t rid:31, inv:1; // reference index; if this is an alignment from inversion rescue int32_t score; // DP alignment score int32_t qs, qe, rs, re; // query start and end; reference start and end