r421: bw doubling in the final alignment

In some cases, the band width used in the final alignment needs to be larger
than the band width in extension.
This commit is contained in:
Heng Li 2013-11-20 10:04:16 -05:00
parent 6e3fa0515a
commit ff4762f3c7
2 changed files with 8 additions and 2 deletions

View File

@ -923,7 +923,13 @@ mem_aln_t mem_reg2aln(const mem_opt_t *opt, const bntseq_t *bns, const uint8_t *
if (bwa_verbose >= 4) fprintf(stderr, "Band width: infer=%d, opt=%d, alnreg=%d\n", w2, opt->w, ar->w);
if (w2 > opt->w) w2 = w2 < ar->w? w2 : ar->w;
else w2 = opt->w;
a.cigar = bwa_gen_cigar(opt->mat, opt->q, opt->r, w2, bns->l_pac, pac, qe - qb, (uint8_t*)&query[qb], rb, re, &score, &a.n_cigar, &NM);
i = 0; a.cigar = 0;
do {
free(a.cigar);
a.cigar = bwa_gen_cigar(opt->mat, opt->q, opt->r, w2, bns->l_pac, pac, qe - qb, (uint8_t*)&query[qb], rb, re, &score, &a.n_cigar, &NM);
if (bwa_verbose >= 4) fprintf(stderr, "Final alignment: w2=%d, global_sc=%d, local_sc=%d\n", w2, score, ar->truesc);
w2 <<= 1;
} while (++i < 3 && score < ar->truesc - opt->a);
a.NM = NM;
pos = bns_depos(bns, rb < bns->l_pac? rb : re - 1, &is_rev);
a.is_rev = is_rev;

2
main.c
View File

@ -4,7 +4,7 @@
#include "utils.h"
#ifndef PACKAGE_VERSION
#define PACKAGE_VERSION "0.7.5a-r420"
#define PACKAGE_VERSION "0.7.5a-r421"
#endif
int bwa_fa2pac(int argc, char *argv[]);