From ffd953029f8fa6adf19775da4f61afa2e6ee48df Mon Sep 17 00:00:00 2001 From: Heng Li Date: Tue, 17 Oct 2017 15:52:36 -0400 Subject: [PATCH] r519: fixed a severe bug that misses long alns --- align.c | 5 +++-- main.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/align.c b/align.c index a105212..0d54e5e 100644 --- a/align.c +++ b/align.c @@ -499,14 +499,15 @@ static void mm_align1(void *km, const mm_mapopt_t *opt, const mm_idx_t *mi, int mm_append_cigar(r, ez->n_cigar, ez->cigar); if (ez->zdropped) { // truncated by Z-drop; TODO: sometimes Z-drop kicks in because the next seed placement is wrong. This can be fixed in principle. for (j = i - 1; j >= 0; --j) - if ((int32_t)a[as1 + j].x < rs + ez->max_t) + if ((int32_t)a[as1 + j].x <= rs + ez->max_t) break; dropped = 1; + if (j < 0) j = 0; r->p->dp_score += ez->max; re1 = rs + (ez->max_t + 1); qe1 = qs + (ez->max_q + 1); if (cnt1 - (j + 1) >= opt->min_cnt) - mm_split_reg(r, r2, j + 1, qlen, a); + mm_split_reg(r, r2, as1 + j + 1 - r->as, qlen, a); break; } else r->p->dp_score += ez->score; rs = re, qs = qe; diff --git a/main.c b/main.c index a7a9d82..4c93bfa 100644 --- a/main.c +++ b/main.c @@ -6,7 +6,7 @@ #include "mmpriv.h" #include "getopt.h" -#define MM_VERSION "2.2-r518-dirty" +#define MM_VERSION "2.2-r519-dirty" #ifdef __linux__ #include