From f9ce2a6c73fdfcf420e39a2e53ee6403d907eaf7 Mon Sep 17 00:00:00 2001 From: Steven Leonard Date: Fri, 11 Dec 2015 09:29:27 +0000 Subject: [PATCH 1/2] fix a bug where bwa_sa2pos could return without setting strand --- bwase.c | 1 + 1 file changed, 1 insertion(+) diff --git a/bwase.c b/bwase.c index cb912ec..77c50db 100644 --- a/bwase.c +++ b/bwase.c @@ -113,6 +113,7 @@ bwtint_t bwa_sa2pos(const bntseq_t *bns, const bwt_t *bwt, bwtint_t sapos, int r { bwtint_t pos_f; int is_rev; + *strand = 0; // initialise strand to 0 otherwise we could return without setting it pos_f = bwt_sa(bwt, sapos); // position on the forward-reverse coordinate if (pos_f < bns->l_pac && bns->l_pac < pos_f + ref_len) return (bwtint_t)-1; pos_f = bns_depos(bns, pos_f, &is_rev); // position on the forward strand; this may be the first base or the last base From 099c24f5fcef8c22f3f2f60603da7963d56ca24a Mon Sep 17 00:00:00 2001 From: Steven Leonard Date: Thu, 11 Feb 2016 14:00:18 +0000 Subject: [PATCH 2/2] fix assertion failure report on bio-bwa-help mailing list bwase.c:180: bwa_refine_gapped_core: Assertion `re - rb == rlen' failed --- bwape.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bwape.c b/bwape.c index a5dc3ad..f2d3d8e 100644 --- a/bwape.c +++ b/bwape.c @@ -379,7 +379,7 @@ int bwa_cal_pac_pos_pe(const bntseq_t *bns, const char *prefix, bwt_t *const _bw bwt_multi1_t *q = p[j]->multi + k; q->pos = bwa_sa2pos(bns, bwt, q->pos, p[j]->len + q->ref_shift, &strand); q->strand = strand; - if (q->pos != p[j]->pos) + if (q->pos != p[j]->pos && q->pos != (bwtint_t)-1) p[j]->multi[n_multi++] = *q; } p[j]->n_multi = n_multi;