r445: unnecessarily large bandwidth in global

This commit is contained in:
Heng Li 2014-03-17 00:01:00 -04:00
parent 7d63e76245
commit e6931bec03
2 changed files with 3 additions and 3 deletions

View File

@ -687,7 +687,7 @@ static inline int infer_bw(int l1, int l2, int score, int a, int q, int r)
{
int w;
if (l1 == l2 && l1 * a - score < (q + r - a)<<1) return 0; // to get equal alignment length, we need at least two gaps
w = ((double)((l1 < l2? l1 : l2) * a - score - q) / r + 1.);
w = ((double)((l1 < l2? l1 : l2) * a - score - q) / r + 2.);
if (w < abs(l1 - l2)) w = abs(l1 - l2);
return w;
}
@ -950,7 +950,7 @@ mem_aln_t mem_reg2aln(const mem_opt_t *opt, const bntseq_t *bns, const uint8_t *
w2 = infer_bw(qe - qb, re - rb, ar->truesc, opt->a, opt->q, opt->r);
if (bwa_verbose >= 4) printf("* Band width: inferred=%d, cmd_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; // TODO: check if we need this line. Need to test on many reads.
// else w2 = opt->w; // TODO: check if we need this line on long reads. On 1-800bp reads, it does not matter and it should be.
i = 0; a.cigar = 0;
do {
free(a.cigar);

2
main.c
View File

@ -4,7 +4,7 @@
#include "utils.h"
#ifndef PACKAGE_VERSION
#define PACKAGE_VERSION "0.7.7-r444"
#define PACKAGE_VERSION "0.7.7-master-r445"
#endif
int bwa_fa2pac(int argc, char *argv[]);