From d04ac068fdb75b5f084c58c122dd60cec7f37d6e Mon Sep 17 00:00:00 2001 From: Heng Li Date: Mon, 15 Oct 2018 21:28:27 -0400 Subject: [PATCH] r852: a minor when large --end-bonus is in use We may use a large --end-bonus to mimic end-to-end alignment. In the short-read mode, the candidate alignment region may be out of the band, which leads to truncated alignment. --- align.c | 2 ++ main.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/align.c b/align.c index cd28d6a..3dc4d4f 100644 --- a/align.c +++ b/align.c @@ -591,9 +591,11 @@ static void mm_align1(void *km, const mm_mapopt_t *opt, const mm_idx_t *mi, int qs0 = 0, qe0 = qlen; l = qs; l += l * opt->a + opt->end_bonus > opt->q? (l * opt->a + opt->end_bonus - opt->q) / opt->e : 0; + l = l < opt->bw? l : opt->bw; rs0 = rs - l > 0? rs - l : 0; l = qlen - qe; l += l * opt->a + opt->end_bonus > opt->q? (l * opt->a + opt->end_bonus - opt->q) / opt->e : 0; + l = l < opt->bw? l : opt->bw; re0 = re + l < (int32_t)mi->seq[rid].len? re + l : mi->seq[rid].len; } else { // compute rs0 and qs0 diff --git a/main.c b/main.c index c4e7b0e..59a0ede 100644 --- a/main.c +++ b/main.c @@ -6,7 +6,7 @@ #include "mmpriv.h" #include "ketopt.h" -#define MM_VERSION "2.13-r850" +#define MM_VERSION "2.13-r852-dirty" #ifdef __linux__ #include