From b58281621136a0ce2a66837ba509716c727b9387 Mon Sep 17 00:00:00 2001 From: Heng Li Date: Tue, 26 Sep 2017 09:35:19 -0400 Subject: [PATCH] r1187: a typo in command line help --- bwamem.c | 4 ++-- bwamem.h | 1 + fastmap.c | 8 +++++--- main.c | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/bwamem.c b/bwamem.c index a4e9068..eeaf4f4 100644 --- a/bwamem.c +++ b/bwamem.c @@ -1026,8 +1026,8 @@ void mem_reg2sam(const mem_opt_t *opt, const bntseq_t *bns, const uint8_t *pac, if (p->secondary >= 0) q->sub = -1; // don't output sub-optimal score if (l && p->secondary < 0) // if supplementary q->flag |= (opt->flag&MEM_F_NO_MULTI)? 0x10000 : 0x800; - if (!(opt->flag&MEM_F_PRIMARY5) && l && !p->is_alt && q->mapq > aa.a[0].mapq) - q->mapq = aa.a[0].mapq; // lower mapq for supplementary mappings, unless -5 is applied + if (!(opt->flag & MEM_F_KEEP_SUPP_MAPQ) && l && !p->is_alt && q->mapq > aa.a[0].mapq) + q->mapq = aa.a[0].mapq; // lower mapq for supplementary mappings, unless -5 or -q is applied ++l; } if (aa.n == 0) { // no alignments good enough; then write an unaligned record diff --git a/bwamem.h b/bwamem.h index 4e2b1d8..fb572b2 100644 --- a/bwamem.h +++ b/bwamem.h @@ -20,6 +20,7 @@ typedef struct __smem_i smem_i; #define MEM_F_SOFTCLIP 0x200 #define MEM_F_SMARTPE 0x400 #define MEM_F_PRIMARY5 0x800 +#define MEM_F_KEEP_SUPP_MAPQ 0x1000 typedef struct { int a, b; // match score and mismatch penalty diff --git a/fastmap.c b/fastmap.c index d89c495..41c29cb 100644 --- a/fastmap.c +++ b/fastmap.c @@ -130,7 +130,7 @@ int main_mem(int argc, char *argv[]) aux.opt = opt = mem_opt_init(); memset(&opt0, 0, sizeof(mem_opt_t)); - while ((c = getopt(argc, argv, "51paMCSPVYjk:c:v:s:r:t:R:A:B:O:E:U:w:L:d:T:Q:D:m:I:N:o:f:W:x:G:h:y:K:X:H:")) >= 0) { + while ((c = getopt(argc, argv, "51qpaMCSPVYjk:c:v:s:r:t:R:A:B:O:E:U:w:L:d:T:Q:D:m:I:N:o:f:W:x:G:h:y:K:X:H:")) >= 0) { if (c == 'k') opt->min_seed_len = atoi(optarg), opt0.min_seed_len = 1; else if (c == '1') no_mt_io = 1; else if (c == 'x') mode = optarg; @@ -147,7 +147,8 @@ int main_mem(int argc, char *argv[]) else if (c == 'S') opt->flag |= MEM_F_NO_RESCUE; else if (c == 'Y') opt->flag |= MEM_F_SOFTCLIP; else if (c == 'V') opt->flag |= MEM_F_REF_HDR; - else if (c == '5') opt->flag |= MEM_F_PRIMARY5; + else if (c == '5') opt->flag |= MEM_F_PRIMARY5 | MEM_F_KEEP_SUPP_MAPQ; // always apply MEM_F_KEEP_SUPP_MAPQ with -5 + else if (c == 'q') opt->flag |= MEM_F_KEEP_SUPP_MAPQ; else if (c == 'c') opt->max_occ = atoi(optarg), opt0.max_occ = 1; else if (c == 'd') opt->zdrop = atoi(optarg), opt0.zdrop = 1; else if (c == 'v') bwa_verbose = atoi(optarg); @@ -268,7 +269,8 @@ int main_mem(int argc, char *argv[]) fprintf(stderr, " -H STR/FILE insert STR to header if it starts with @; or insert lines in FILE [null]\n"); fprintf(stderr, " -o FILE sam file to output results to [stdout]\n"); fprintf(stderr, " -j treat ALT contigs as part of the primary assembly (i.e. ignore .alt file)\n"); - fprintf(stderr, " -5 for split alignment, take the alignment with the smallest coordiate as primary\n"); + fprintf(stderr, " -5 for split alignment, take the alignment with the smallest coordinate as primary\n"); + fprintf(stderr, " -q don't modify mapQ of supplementary alignments\n"); fprintf(stderr, " -K INT process INT input bases in each batch regardless of nThreads (for reproducibility) []\n"); fprintf(stderr, "\n"); fprintf(stderr, " -v INT verbosity level: 1=error, 2=warning, 3=message, 4+=debugging [%d]\n", bwa_verbose); diff --git a/main.c b/main.c index 189e723..063384e 100644 --- a/main.c +++ b/main.c @@ -4,7 +4,7 @@ #include "utils.h" #ifndef PACKAGE_VERSION -#define PACKAGE_VERSION "0.7.16a-r1185-dirty" +#define PACKAGE_VERSION "0.7.16a-r1187-dirty" #endif int bwa_fa2pac(int argc, char *argv[]);