From 6c78a980b6de732c49887d737b6c76c1768c4fca Mon Sep 17 00:00:00 2001 From: Heng Li Date: Tue, 10 Oct 2017 17:32:28 -0400 Subject: [PATCH] r497: the previous change not working at the ends --- align.c | 8 ++++---- main.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/align.c b/align.c index b1cf55e..6046131 100644 --- a/align.c +++ b/align.c @@ -373,12 +373,12 @@ static void mm_align1(void *km, const mm_mapopt_t *opt, const mm_idx_t *mi, int } // compute rs0 and qs0 - rs1 = rs0 = (int32_t)a[r->as].x + 1 - (int32_t)(a[r->as].y>>32&0xff); - qs1 = qs0 = (int32_t)a[r->as].y + 1 - (int32_t)(a[r->as].y>>32&0xff); + rs0 = (int32_t)a[r->as].x + 1 - (int32_t)(a[r->as].y>>32&0xff); + qs0 = (int32_t)a[r->as].y + 1 - (int32_t)(a[r->as].y>>32&0xff); if (r->as > 0 && a[r->as - 1].x>>32 == a[r->as].x>>32) { rs1 = (int32_t)a[r->as - 1].x + 1; qs1 = (int32_t)a[r->as - 1].y + 1; - } + } else rs1 = qs1 = 0; // no adjacent previous chain on the same chr if (qs > 0 && rs > 0) { // actually this is always true l = qs < max_end_ext? qs : max_end_ext; qs1 = qs1 > qs - l? qs1 : qs - l; // choose between the max_end_ext bound and the previous seed bound @@ -396,7 +396,7 @@ static void mm_align1(void *km, const mm_mapopt_t *opt, const mm_idx_t *mi, int if (r->as + r->cnt < n_a && a[r->as + r->cnt].x>>32 == a[r->as + r->cnt - 1].x>>32) { re1 = (int32_t)a[r->as + r->cnt].x + 1 - (int32_t)(a[r->as + r->cnt].y>>32&0xff); qe1 = (int32_t)a[r->as + r->cnt].y + 1 - (int32_t)(a[r->as + r->cnt].y>>32&0xff); - } + } else re1 = mi->seq[rid].len, qe1 = qlen; // no adjacent next chain on the same chr if (qe < qlen && re < mi->seq[rid].len) { l = qlen - qe < max_end_ext? qlen - qe : max_end_ext; qe1 = qe1 < qe + l? qe1 : qe + l; // choose between the max_end_ext bound and the next seed bound diff --git a/main.c b/main.c index 321e544..d59545e 100644 --- a/main.c +++ b/main.c @@ -6,7 +6,7 @@ #include "mmpriv.h" #include "getopt.h" -#define MM_VERSION "2.2-r496-dirty" +#define MM_VERSION "2.2-r497-dirty" #ifdef __linux__ #include