mirror of
https://github.com/lh3/minimap2.git
synced 2026-09-15 13:07:55 +08:00
added two more filters
This commit is contained in:
4
main.c
4
main.c
@@ -69,6 +69,8 @@ static ko_longopt_t long_options[] = {
|
||||
{ "sam-hit-only", ko_no_argument, 342 },
|
||||
{ "idx-min-occ", ko_required_argument, 343 },
|
||||
{ "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' },
|
||||
{ "max-intron-len", ko_required_argument, 'G' },
|
||||
{ "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 == 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 == 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
|
||||
yes_or_no(&opt, MM_F_FRAG_MODE, o.longidx, o.arg, 1);
|
||||
} else if (c == 315) { // --secondary
|
||||
|
||||
9
map.c
9
map.c
@@ -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);
|
||||
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
|
||||
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_chain_score; // min chaining score
|
||||
|
||||
float flt_max_dv;
|
||||
int flt_min_blen;
|
||||
|
||||
float mask_level;
|
||||
float pri_ratio;
|
||||
int best_n; // top best_n chains are subjected to DP alignment
|
||||
|
||||
Reference in New Issue
Block a user