From 66c9783dafccd0b202eef2c331c4a9dc8d44fcba Mon Sep 17 00:00:00 2001 From: Heng Li Date: Fri, 8 Mar 2013 13:15:43 -0500 Subject: [PATCH] r345: bugfix in mem - wrong mate strand for unmap Received a clean bill from Picard --- bwamem.c | 1 + main.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bwamem.c b/bwamem.c index 40b481a..224309f 100644 --- a/bwamem.c +++ b/bwamem.c @@ -628,6 +628,7 @@ void bwa_hit2sam(kstring_t *str, const int8_t mat[25], int q, int r, int w, cons } p->flag |= p->rb >= bns->l_pac? 0x10 : 0; // is reverse strand p->flag |= m && m->rb >= bns->l_pac? 0x20 : 0; // is mate on reverse strand + if (is_mapped(p) && m && !is_mapped(m) && (p->flag&0x10)) p->flag |= 0x20; // if mate is unmapped, it takes the strand of the current read kputs(s->name, str); kputc('\t', str); if (is_mapped(p)) { // has a coordinate, no matter whether it is mapped or copied from the mate int sam_flag = p->flag&0xff; // the flag that will be outputed to SAM; it is not always the same as p->flag diff --git a/main.c b/main.c index 1304a35..3ae3f28 100644 --- a/main.c +++ b/main.c @@ -3,7 +3,7 @@ #include "utils.h" #ifndef PACKAGE_VERSION -#define PACKAGE_VERSION "0.7.0-r343-beta" +#define PACKAGE_VERSION "0.7.0-r345-beta" #endif int bwa_fa2pac(int argc, char *argv[]);