diff --git a/bwamem.c b/bwamem.c index d7c00fe..a4e9068 100644 --- a/bwamem.c +++ b/bwamem.c @@ -1026,7 +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 (l && !p->is_alt && q->mapq > aa.a[0].mapq) q->mapq = aa.a[0].mapq; + 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 ++l; } if (aa.n == 0) { // no alignments good enough; then write an unaligned record diff --git a/main.c b/main.c index e2b7cf1..189e723 100644 --- a/main.c +++ b/main.c @@ -4,7 +4,7 @@ #include "utils.h" #ifndef PACKAGE_VERSION -#define PACKAGE_VERSION "0.7.16a-r1181" +#define PACKAGE_VERSION "0.7.16a-r1185-dirty" #endif int bwa_fa2pac(int argc, char *argv[]);