diff --git a/main.c b/main.c index 7912dda..37da4e3 100644 --- a/main.c +++ b/main.c @@ -7,7 +7,7 @@ #include "mmpriv.h" #include "ketopt.h" -#define MM_VERSION "2.18-r1050-dirty" +#define MM_VERSION "2.18-r1051-dirty" #ifdef __linux__ #include diff --git a/map.c b/map.c index efcf933..513fe1f 100644 --- a/map.c +++ b/map.c @@ -300,9 +300,9 @@ void mm_map_frag(const mm_idx_t *mi, int n_segs, const int *qlens, const char ** a = mg_lchain_dp(max_chain_gap_ref, max_chain_gap_qry, opt->bw, opt->max_chain_skip, opt->max_chain_iter, opt->min_cnt, opt->min_chain_score, opt->chain_gap_scale * 0.01 * mi->k, 0.0f, is_splice, n_segs, n_a, a, &n_regs0, &u, b->km); } - } else if (opt->bw_long > opt->bw && !(opt->flag & (MM_F_RMQ|MM_F_NO_LJOIN)) && n_segs == 1 && n_regs0 > 1) { + } else if (opt->bw_long > opt->bw && (opt->flag & (MM_F_RMQ|MM_F_NO_LJOIN)) == 0 && n_segs == 1 && n_regs0 > 1) { int32_t st = (int32_t)a[0].y, en = (int32_t)a[(int32_t)u[0] - 1].y; - if (qlen_sum - (en - st) > 1000 || en - st > qlen_sum * .1) { + if (qlen_sum - (en - st) > opt->rmq_rescue_size || en - st > qlen_sum * opt->rmq_rescue_ratio) { int32_t i; for (i = 0, n_a = 0; i < n_regs0; ++i) n_a += (int32_t)u[i]; kfree(b->km, u); diff --git a/minimap.h b/minimap.h index 3deca6b..7386632 100644 --- a/minimap.h +++ b/minimap.h @@ -122,6 +122,8 @@ typedef struct { int min_chain_score; // min chaining score float chain_gap_scale; int rmq_size_cap, rmq_inner_dist; + int rmq_rescue_size; + float rmq_rescue_ratio; float mask_level; int mask_len; diff --git a/options.c b/options.c index 07f3f88..b5a2289 100644 --- a/options.c +++ b/options.c @@ -29,6 +29,8 @@ void mm_mapopt_init(mm_mapopt_t *opt) opt->max_chain_iter = 5000; opt->rmq_inner_dist = 1000; opt->rmq_size_cap = 100000; + opt->rmq_rescue_size = 1000; + opt->rmq_rescue_ratio = 0.1f; opt->chain_gap_scale = 0.8f; opt->max_max_occ = 4095; opt->occ_dist = 500; diff --git a/python/cmappy.pxd b/python/cmappy.pxd index bfa706d..abc3ef7 100644 --- a/python/cmappy.pxd +++ b/python/cmappy.pxd @@ -24,6 +24,8 @@ cdef extern from "minimap.h": int min_chain_score float chain_gap_scale int rmq_size_cap, rmq_inner_dist + int rmq_rescue_size + float rmq_rescue_ratio float mask_level int mask_len