r519: fixed a severe bug that misses long alns

This commit is contained in:
Heng Li 2017-10-17 15:52:36 -04:00
parent 04cf4ebf5e
commit ffd953029f
2 changed files with 4 additions and 3 deletions

View File

@ -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); 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. 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) 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; break;
dropped = 1; dropped = 1;
if (j < 0) j = 0;
r->p->dp_score += ez->max; r->p->dp_score += ez->max;
re1 = rs + (ez->max_t + 1); re1 = rs + (ez->max_t + 1);
qe1 = qs + (ez->max_q + 1); qe1 = qs + (ez->max_q + 1);
if (cnt1 - (j + 1) >= opt->min_cnt) 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; break;
} else r->p->dp_score += ez->score; } else r->p->dp_score += ez->score;
rs = re, qs = qe; rs = re, qs = qe;

2
main.c
View File

@ -6,7 +6,7 @@
#include "mmpriv.h" #include "mmpriv.h"
#include "getopt.h" #include "getopt.h"
#define MM_VERSION "2.2-r518-dirty" #define MM_VERSION "2.2-r519-dirty"
#ifdef __linux__ #ifdef __linux__
#include <sys/resource.h> #include <sys/resource.h>