From 7d80d6de4a6f32d09eb5f5c8700204e6e1a788de Mon Sep 17 00:00:00 2001 From: Heng Li Date: Fri, 14 Sep 2018 22:21:33 -0400 Subject: [PATCH] r832: fixed outdated -L. Resolved #231 and #233 --- format.c | 8 +++++--- main.c | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/format.c b/format.c index fdce73e0..5638b1af 100644 --- a/format.c +++ b/format.c @@ -419,9 +419,11 @@ void mm_write_sam2(kstring_t *s, const mm_idx_t *mi, const mm_bseq1_t *t, int se cigar_in_tag = 1; } if (cigar_in_tag) { - if (flag & 0x100) mm_sprintf_lite(s, "0S"); // secondary alignment - else if (flag & 0x800) mm_sprintf_lite(s, "%dS", r->re - r->rs); // supplementary alignment - else mm_sprintf_lite(s, "%dS", t->l_seq); + int slen; + if ((flag & 0x900) == 0 || (opt_flag & MM_F_SOFTCLIP)) slen = t->l_seq; + else if (flag & 0x100) slen = 0; + else slen = r->qe - r->qs; + mm_sprintf_lite(s, "%dS%dN", slen, r->re - r->rs); } else write_sam_cigar(s, flag, 0, t->l_seq, r, opt_flag); } diff --git a/main.c b/main.c index 680ea138..2d33aa79 100644 --- a/main.c +++ b/main.c @@ -6,7 +6,7 @@ #include "mmpriv.h" #include "ketopt.h" -#define MM_VERSION "2.12-r829-dirty" +#define MM_VERSION "2.12-r832-dirty" #ifdef __linux__ #include