From bc1ea70b87f773f4f3c33a0d5f88c18fceab8e02 Mon Sep 17 00:00:00 2001 From: Heng Li Date: Mon, 14 Dec 2020 12:34:42 -0500 Subject: [PATCH] r413: dealing with another type of folded inv aln --- asm-call.c | 8 ++++++-- minigraph.h | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/asm-call.c b/asm-call.c index 01d597b..a81b7eb 100644 --- a/asm-call.c +++ b/asm-call.c @@ -88,7 +88,11 @@ void mg_call_asm(const gfa_t *g, int32_t n_seq, const mg_bseq1_t *seq, mg_gchain else if (ca[gt->lc[st-1].v>>1].bid > ca[gt->lc[en].v>>1].bid) strand = -1; else { - assert(ca[gt->lc[st-1].v>>1].is_src + ca[gt->lc[en].v>>1].is_src == 1); + if (ca[gt->lc[st-1].v>>1].is_src + ca[gt->lc[en].v>>1].is_src != 1) { + fprintf(stderr, "[W::%s] type-1 folded inversion alignment around %c%s <=> %s:%d-%d\n", + __func__, "><"[gt->lc[st].v&1], g->seg[gt->lc[st].v>>1].name, seq[t].name, qs, qe); + continue; + } if (ca[gt->lc[st-1].v>>1].is_src) strand = 1; else strand = -1; } @@ -99,7 +103,7 @@ void mg_call_asm(const gfa_t *g, int32_t n_seq, const mg_bseq1_t *seq, mg_gchain if (ca[gt->lc[k].v>>1].bid != bid) break; if (k != en) { // this may happen around an inversion towards the end of an alignment chain - fprintf(stderr, "[W::%s] folded inversion alignment around %c%s <=> %s:%d-%d\n", + fprintf(stderr, "[W::%s] type-2 folded inversion alignment around %c%s <=> %s:%d-%d\n", __func__, "><"[gt->lc[st].v&1], g->seg[gt->lc[st].v>>1].name, seq[t].name, qs, qe); continue; } diff --git a/minigraph.h b/minigraph.h index 78a9af5..4f05af6 100644 --- a/minigraph.h +++ b/minigraph.h @@ -4,7 +4,7 @@ #include #include "gfa.h" -#define MG_VERSION "0.13-r412-dirty" +#define MG_VERSION "0.13-r413-dirty" #define MG_M_SPLICE 0x10 #define MG_M_SR 0x20