mirror of
https://github.com/lh3/minimap2.git
synced 2026-10-08 07:18:12 +08:00
added two more filters
This commit is contained in:
@@ -69,6 +69,8 @@ static ko_longopt_t long_options[] = {
|
|||||||
{ "sam-hit-only", ko_no_argument, 342 },
|
{ "sam-hit-only", ko_no_argument, 342 },
|
||||||
{ "idx-min-occ", ko_required_argument, 343 },
|
{ "idx-min-occ", ko_required_argument, 343 },
|
||||||
{ "idx-max-occ", ko_required_argument, 344 },
|
{ "idx-max-occ", ko_required_argument, 344 },
|
||||||
|
{ "flt-max-dv", ko_required_argument, 345 },
|
||||||
|
{ "flt-min-blen", ko_required_argument, 346 },
|
||||||
{ "help", ko_no_argument, 'h' },
|
{ "help", ko_no_argument, 'h' },
|
||||||
{ "max-intron-len", ko_required_argument, 'G' },
|
{ "max-intron-len", ko_required_argument, 'G' },
|
||||||
{ "version", ko_no_argument, 'V' },
|
{ "version", ko_no_argument, 'V' },
|
||||||
@@ -214,6 +216,8 @@ int main(int argc, char *argv[])
|
|||||||
else if (c == 342) opt.flag |= MM_F_SAM_HIT_ONLY; // --sam-hit-only
|
else if (c == 342) opt.flag |= MM_F_SAM_HIT_ONLY; // --sam-hit-only
|
||||||
else if (c == 343) ipt.min_occ = mm_parse_num(o.arg); // --idx-min-occ
|
else if (c == 343) ipt.min_occ = mm_parse_num(o.arg); // --idx-min-occ
|
||||||
else if (c == 344) ipt.max_occ = mm_parse_num(o.arg); // --idx-max-occ
|
else if (c == 344) ipt.max_occ = mm_parse_num(o.arg); // --idx-max-occ
|
||||||
|
else if (c == 345) opt.flt_max_dv = atof(o.arg); // --flt-max-dv
|
||||||
|
else if (c == 346) opt.flt_min_blen = mm_parse_num(o.arg); // --flt-min-blen
|
||||||
else if (c == 314) { // --frag
|
else if (c == 314) { // --frag
|
||||||
yes_or_no(&opt, MM_F_FRAG_MODE, o.longidx, o.arg, 1);
|
yes_or_no(&opt, MM_F_FRAG_MODE, o.longidx, o.arg, 1);
|
||||||
} else if (c == 315) { // --secondary
|
} else if (c == 315) { // --secondary
|
||||||
|
|||||||
@@ -351,6 +351,15 @@ void mm_map_frag(const mm_idx_t *mi, int n_segs, const int *qlens, const char **
|
|||||||
|
|
||||||
chain_post(opt, max_chain_gap_ref, mi, b->km, qlen_sum, n_segs, qlens, &n_regs0, regs0, a);
|
chain_post(opt, max_chain_gap_ref, mi, b->km, qlen_sum, n_segs, qlens, &n_regs0, regs0, a);
|
||||||
if (!is_sr) mm_est_err(mi, qlen_sum, n_regs0, regs0, a, n_mini_pos, mini_pos);
|
if (!is_sr) mm_est_err(mi, qlen_sum, n_regs0, regs0, a, n_mini_pos, mini_pos);
|
||||||
|
if (!is_sr && n_segs == 1) {
|
||||||
|
for (i = j = 0; i < n_regs0; ++i) {
|
||||||
|
mm_reg1_t *r = ®s0[i];
|
||||||
|
if (r->div > opt->flt_max_dv) continue;
|
||||||
|
if (r->blen < opt->flt_min_blen) continue;
|
||||||
|
regs0[j++] = regs0[i];
|
||||||
|
}
|
||||||
|
n_regs0 = j;
|
||||||
|
}
|
||||||
|
|
||||||
if (n_segs == 1) { // uni-segment
|
if (n_segs == 1) { // uni-segment
|
||||||
regs0 = align_regs(opt, mi, b->km, qlens[0], seqs[0], &n_regs0, regs0, a);
|
regs0 = align_regs(opt, mi, b->km, qlens[0], seqs[0], &n_regs0, regs0, a);
|
||||||
|
|||||||
@@ -119,6 +119,9 @@ typedef struct {
|
|||||||
int min_cnt; // min number of minimizers on each chain
|
int min_cnt; // min number of minimizers on each chain
|
||||||
int min_chain_score; // min chaining score
|
int min_chain_score; // min chaining score
|
||||||
|
|
||||||
|
float flt_max_dv;
|
||||||
|
int flt_min_blen;
|
||||||
|
|
||||||
float mask_level;
|
float mask_level;
|
||||||
float pri_ratio;
|
float pri_ratio;
|
||||||
int best_n; // top best_n chains are subjected to DP alignment
|
int best_n; // top best_n chains are subjected to DP alignment
|
||||||
|
|||||||
@@ -27,6 +27,9 @@ void mm_mapopt_init(mm_mapopt_t *opt)
|
|||||||
opt->max_chain_skip = 25;
|
opt->max_chain_skip = 25;
|
||||||
opt->max_chain_iter = 5000;
|
opt->max_chain_iter = 5000;
|
||||||
|
|
||||||
|
opt->flt_max_dv = 1.0f;
|
||||||
|
opt->flt_min_blen = 0;
|
||||||
|
|
||||||
opt->mask_level = 0.5f;
|
opt->mask_level = 0.5f;
|
||||||
opt->pri_ratio = 0.8f;
|
opt->pri_ratio = 0.8f;
|
||||||
opt->best_n = 5;
|
opt->best_n = 5;
|
||||||
|
|||||||
Reference in New Issue
Block a user