From 7a9b4db874f9f8adcc6c2e3946360a4d04c1c0d5 Mon Sep 17 00:00:00 2001 From: Heng Li Date: Wed, 20 Sep 2017 10:51:18 -0400 Subject: [PATCH] replaced --approx-ext with --sr --sr disables Z-drop and may come with other heurstics --- align.c | 10 ++++++---- main.c | 4 ++-- map.c | 2 +- minimap.h | 2 +- minimap2.1 | 4 ++-- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/align.c b/align.c index 1e97616..4abed92 100644 --- a/align.c +++ b/align.c @@ -136,6 +136,7 @@ static void mm_append_cigar(mm_reg1_t *r, uint32_t n_cigar, uint32_t *cigar) // static void mm_align_pair(void *km, const mm_mapopt_t *opt, int qlen, const uint8_t *qseq, int tlen, const uint8_t *tseq, const int8_t *mat, int w, int flag, ksw_extz_t *ez) { + int zdrop = opt->zdrop; if (mm_dbg_flag & MM_DBG_PRINT_ALN_SEQ) { int i; fprintf(stderr, "===> q=(%d,%d), e=(%d,%d), bw=%d, flag=%d, zdrop=%d <===\n", opt->q, opt->q2, opt->e, opt->e2, w, flag, opt->zdrop); @@ -144,16 +145,17 @@ static void mm_align_pair(void *km, const mm_mapopt_t *opt, int qlen, const uint for (i = 0; i < qlen; ++i) fputc("ACGTN"[qseq[i]], stderr); fputc('\n', stderr); } - if (opt->flag & MM_F_APPROX_EXT) { + if (opt->flag & MM_F_SR) { + zdrop = (qlen < tlen? qlen : tlen) * opt->a; // zdrop disabled flag |= KSW_EZ_APPROX_MAX; if (flag & KSW_EZ_EXTZ_ONLY) flag |= KSW_EZ_APPROX_DROP; } if (opt->flag & MM_F_SPLICE) - ksw_exts2_sse(km, qlen, qseq, tlen, tseq, 5, mat, opt->q, opt->e, opt->q2, opt->noncan, opt->zdrop, flag, ez); + ksw_exts2_sse(km, qlen, qseq, tlen, tseq, 5, mat, opt->q, opt->e, opt->q2, opt->noncan, zdrop, flag, ez); else if (opt->q == opt->q2 && opt->e == opt->e2) - ksw_extz2_sse(km, qlen, qseq, tlen, tseq, 5, mat, opt->q, opt->e, w, opt->zdrop, flag, ez); + ksw_extz2_sse(km, qlen, qseq, tlen, tseq, 5, mat, opt->q, opt->e, w, zdrop, flag, ez); else - ksw_extd2_sse(km, qlen, qseq, tlen, tseq, 5, mat, opt->q, opt->e, opt->q2, opt->e2, w, opt->zdrop, flag, ez); + ksw_extd2_sse(km, qlen, qseq, tlen, tseq, 5, mat, opt->q, opt->e, opt->q2, opt->e2, w, zdrop, flag, ez); } static inline int mm_get_hplen_back(const mm_idx_t *mi, uint32_t rid, uint32_t x) diff --git a/main.c b/main.c index a1f5c5f..4437625 100644 --- a/main.c +++ b/main.c @@ -36,7 +36,7 @@ static struct option long_options[] = { { "splice", no_argument, 0, 0 }, { "cost-non-gt-ag", required_argument, 0, 0 }, { "no-sam-sq", no_argument, 0, 0 }, - { "approx-ext", no_argument, 0, 0 }, + { "sr", no_argument, 0, 0 }, { "help", no_argument, 0, 'h' }, { "max-intron-len", required_argument, 0, 'G' }, { "version", no_argument, 0, 'V' }, @@ -114,7 +114,7 @@ int main(int argc, char *argv[]) else if (c == 0 && long_idx ==10) opt.flag |= MM_F_SPLICE; // --splice else if (c == 0 && long_idx ==11) opt.noncan = atoi(optarg); // --cost-non-gt-ag else if (c == 0 && long_idx ==12) opt.flag |= MM_F_NO_SAM_SQ; // --no-sam-sq - else if (c == 0 && long_idx ==13) opt.flag |= MM_F_APPROX_EXT; // --approx-ext + else if (c == 0 && long_idx ==13) opt.flag |= MM_F_SR; // --sr else if (c == 'V') { puts(MM_VERSION); return 0; diff --git a/map.c b/map.c index cc64c1b..09a7024 100644 --- a/map.c +++ b/map.c @@ -75,7 +75,7 @@ int mm_set_opt(const char *preset, mm_idxopt_t *io, mm_mapopt_t *mo) mo->min_dp_max = 200; } else if (strcmp(preset, "short") == 0 || strcmp(preset, "sr") == 0) { io->is_hpc = 0, io->k = 21, io->w = 11; - mo->flag |= MM_F_APPROX_EXT; + mo->flag |= MM_F_SR; mo->a = 2, mo->b = 8, mo->q = 12, mo->e = 2, mo->q2 = 32, mo->e2 = 1; mo->max_gap = 100; mo->pri_ratio = 0.5f; diff --git a/minimap.h b/minimap.h index b2a3f7c..ebe6715 100644 --- a/minimap.h +++ b/minimap.h @@ -17,7 +17,7 @@ #define MM_F_SPLICE_REV 0x200 #define MM_F_SPLICE_BOTH 0x400 #define MM_F_NO_SAM_SQ 0x800 -#define MM_F_APPROX_EXT 0x1000 +#define MM_F_SR 0x1000 #define MM_IDX_MAGIC "MMI\2" diff --git a/minimap2.1 b/minimap2.1 index dee97d1..3bd5191 100644 --- a/minimap2.1 +++ b/minimap2.1 @@ -1,4 +1,4 @@ -.TH minimap2 1 "17 September 2017" "minimap2-2.2 (r409)" "Bioinformatics tools" +.TH minimap2 1 "20 September 2017" "minimap2-2.2 (r420)" "Bioinformatics tools" .SH NAME .PP minimap2 - mapping and alignment between collections of DNA sequences @@ -338,7 +338,7 @@ tag ignores introns to demote hits to pseudogenes. Short single-end reads without splicing .RB ( -k21 .B -w11 -A2 -B8 -O12,32 -E2,1 -r50 -p.5 -N20 -f1000 -n2 -m20 -s40 -g100 -K50m -.BR --approx-ext ). +.BR --sr ). .RE .SS Miscellaneous options .TP 10