r828: --MD to support spliced alignment

This commit is contained in:
Heng Li 2018-08-22 10:47:45 -04:00
parent a5eafb75f9
commit 3a119d606f
2 changed files with 4 additions and 2 deletions

View File

@ -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);

2
main.c
View File

@ -10,7 +10,7 @@
#include "getopt.h"
#endif
#define MM_VERSION "2.12-r827"
#define MM_VERSION "2.12-r828-dirty"
#ifdef __linux__
#include <sys/resource.h>