From 3a119d606fc5d00b1e16962715c533b7a1e1161d Mon Sep 17 00:00:00 2001 From: Heng Li Date: Wed, 22 Aug 2018 10:47:45 -0400 Subject: [PATCH] r828: --MD to support spliced alignment --- format.c | 4 +++- main.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/format.c b/format.c index eabfd1ae..fdce73e0 100644 --- a/format.c +++ b/format.c @@ -187,7 +187,7 @@ static void write_MD_core(kstring_t *s, const uint8_t *tseq, const uint8_t *qseq if (write_tag) mm_sprintf_lite(s, "\tMD:Z:"); for (i = q_off = t_off = 0; i < (int)r->p->n_cigar; ++i) { int j, op = r->p->cigar[i]&0xf, len = r->p->cigar[i]>>4; - assert(op >= 0 && op <= 2); // introns (aka reference skips) are not supported + assert(op >= 0 && op <= 3); if (op == 0) { // match for (j = 0; j < len; ++j) { if (qseq[q_off + j] != tseq[t_off + j]) { @@ -204,6 +204,8 @@ static void write_MD_core(kstring_t *s, const uint8_t *tseq, const uint8_t *qseq mm_sprintf_lite(s, "%d^%s", l_MD, tmp); l_MD = 0; t_off += len; + } else if (op == 3) { // reference skip + t_off += len; } } if (l_MD > 0) mm_sprintf_lite(s, "%d", l_MD); diff --git a/main.c b/main.c index 3ca904bc..91cc9cc3 100644 --- a/main.c +++ b/main.c @@ -10,7 +10,7 @@ #include "getopt.h" #endif -#define MM_VERSION "2.12-r827" +#define MM_VERSION "2.12-r828-dirty" #ifdef __linux__ #include