r1264: added --jump-min-match, default to 3

To match STAR
This commit is contained in:
Heng Li
2025-04-06 23:18:55 -04:00
parent af094640e5
commit fbb9c0fcba
5 changed files with 13 additions and 6 deletions
+2 -2
View File
@@ -89,7 +89,7 @@ static void mm_jump_split_left(void *km, const mm_idx_t *mi, const mm_mapopt_t *
kfree(km, tseq); kfree(km, tseq);
l = m > 0? a[i0].off - r->rs : 0; // may be negative l = m > 0? a[i0].off - r->rs : 0; // may be negative
if (m == 1 && clip + l >= opt->jump_min_alen) { // add one more exon if (m == 1 && clip + l >= opt->jump_min_match) { // add one more exon
mm_enlarge_cigar(r, 2); mm_enlarge_cigar(r, 2);
memmove(r->p->cigar + 2, r->p->cigar, r->p->n_cigar * 4); memmove(r->p->cigar + 2, r->p->cigar, r->p->n_cigar * 4);
r->p->cigar[0] = (clip + l) << 4 | MM_CIGAR_MATCH; r->p->cigar[0] = (clip + l) << 4 | MM_CIGAR_MATCH;
@@ -153,7 +153,7 @@ static void mm_jump_split_right(void *km, const mm_idx_t *mi, const mm_mapopt_t
kfree(km, tseq); kfree(km, tseq);
l = m > 0? r->re - a[i0].off : 0; // may be negative l = m > 0? r->re - a[i0].off : 0; // may be negative
if (m == 1 && clip + l >= opt->jump_min_alen) { // add one more exon if (m == 1 && clip + l >= opt->jump_min_match) { // add one more exon
mm_enlarge_cigar(r, 2); mm_enlarge_cigar(r, 2);
r->p->cigar[r->p->n_cigar - 1] = ((r->p->cigar[r->p->n_cigar - 1]>>4) - l) << 4 | MM_CIGAR_MATCH; r->p->cigar[r->p->n_cigar - 1] = ((r->p->cigar[r->p->n_cigar - 1]>>4) - l) << 4 | MM_CIGAR_MATCH;
r->p->cigar[r->p->n_cigar] = (a[i0].off2 - a[i0].off) << 4 | MM_CIGAR_N_SKIP; r->p->cigar[r->p->n_cigar] = (a[i0].off2 - a[i0].off) << 4 | MM_CIGAR_N_SKIP;
+2
View File
@@ -82,6 +82,7 @@ static ko_longopt_t long_options[] = {
{ "spsc", ko_required_argument, 357 }, { "spsc", ko_required_argument, 357 },
{ "junc-pen", ko_required_argument, 358 }, { "junc-pen", ko_required_argument, 358 },
{ "pairing", ko_required_argument, 359 }, { "pairing", ko_required_argument, 359 },
{ "jump-min-match", ko_required_argument, 360 },
{ "dbg-seed-occ", ko_no_argument, 501 }, { "dbg-seed-occ", ko_no_argument, 501 },
{ "help", ko_no_argument, 'h' }, { "help", ko_no_argument, 'h' },
{ "max-intron-len", ko_required_argument, 'G' }, { "max-intron-len", ko_required_argument, 'G' },
@@ -253,6 +254,7 @@ int main(int argc, char *argv[])
else if (c == 355) opt.flag |= MM_F_OUT_DS; // --ds else if (c == 355) opt.flag |= MM_F_OUT_DS; // --ds
else if (c == 356) opt.rmq_inner_dist = mm_parse_num(o.arg); // --rmq-inner else if (c == 356) opt.rmq_inner_dist = mm_parse_num(o.arg); // --rmq-inner
else if (c == 357) fn_spsc = o.arg; // --spsc else if (c == 357) fn_spsc = o.arg; // --spsc
else if (c == 360) opt.jump_min_match = mm_parse_num(o.arg); // --jump-min-match
else if (c == 501) mm_dbg_flag |= MM_DBG_SEED_FREQ; // --dbg-seed-occ else if (c == 501) mm_dbg_flag |= MM_DBG_SEED_FREQ; // --dbg-seed-occ
else if (c == 330) { else if (c == 330) {
fprintf(stderr, "[WARNING] \033[1;31m --lj-min-ratio has been deprecated.\033[0m\n"); fprintf(stderr, "[WARNING] \033[1;31m --lj-min-ratio has been deprecated.\033[0m\n");
+2 -2
View File
@@ -5,7 +5,7 @@
#include <stdio.h> #include <stdio.h>
#include <sys/types.h> #include <sys/types.h>
#define MM_VERSION "2.28-r1263-dirty" #define MM_VERSION "2.28-r1264-dirty"
#define MM_F_NO_DIAG (0x001LL) // no exact diagonal hit #define MM_F_NO_DIAG (0x001LL) // no exact diagonal hit
#define MM_F_NO_DUAL (0x002LL) // skip pairs where query name is lexicographically larger than target name #define MM_F_NO_DUAL (0x002LL) // skip pairs where query name is lexicographically larger than target name
@@ -175,7 +175,7 @@ typedef struct {
int pe_ori, pe_bonus; int pe_ori, pe_bonus;
int32_t jump_min_alen; int32_t jump_min_match;
float mid_occ_frac; // only used by mm_mapopt_update(); see below float mid_occ_frac; // only used by mm_mapopt_update(); see below
float q_occ_frac; float q_occ_frac;
+6 -1
View File
@@ -1,4 +1,4 @@
.TH minimap2 1 "6 April 2025" "minimap2-2.28-dirty (r1259)" "Bioinformatics tools" .TH minimap2 1 "6 April 2025" "minimap2-2.28-dirty (r1264)" "Bioinformatics tools"
.SH NAME .SH NAME
.PP .PP
minimap2 - mapping and alignment between collections of DNA sequences minimap2 - mapping and alignment between collections of DNA sequences
@@ -466,6 +466,11 @@ Score bonus for a splice donor or acceptor found in annotation [9]. Effective wi
but not but not
.BR --spsc . .BR --spsc .
.TP .TP
.BR --jump-min-match \ INT
Minimum matching length to create a jump [3]. Equivalent to
.B STAR
.BR --alignSJDBoverhangMin .
.TP
.BI --end-seed-pen \ INT .BI --end-seed-pen \ INT
Drop a terminal anchor if Drop a terminal anchor if
.IR s <log( g )+ INT , .IR s <log( g )+ INT ,
+1 -1
View File
@@ -63,7 +63,7 @@ void mm_mapopt_init(mm_mapopt_t *opt)
opt->pe_ori = 0; // FF opt->pe_ori = 0; // FF
opt->pe_bonus = 33; opt->pe_bonus = 33;
opt->jump_min_alen = 5; opt->jump_min_match = 3;
} }
void mm_mapopt_update(mm_mapopt_t *opt, const mm_idx_t *mi) void mm_mapopt_update(mm_mapopt_t *opt, const mm_idx_t *mi)