r788: segfault when the last ref is "weird"
mem_patch_reg() did not check if two hits are on the same strand, which may lead to an alignment bridging the forward-backward boundary.
This commit is contained in:
parent
cffff4338f
commit
7fd6a11569
1
bwamem.c
1
bwamem.c
|
|
@ -383,6 +383,7 @@ int mem_patch_reg(const mem_opt_t *opt, const bntseq_t *bns, const uint8_t *pac,
|
||||||
double r;
|
double r;
|
||||||
if (bns == 0 || pac == 0 || query == 0) return 0;
|
if (bns == 0 || pac == 0 || query == 0) return 0;
|
||||||
assert(a->rid == b->rid && a->rb <= b->rb);
|
assert(a->rid == b->rid && a->rb <= b->rb);
|
||||||
|
if (a->rb < bns->l_pac && b->rb >= bns->l_pac) return 0; // on different strands
|
||||||
if (a->qb >= b->qb || a->qe >= b->qe || a->re >= b->re) return 0; // not colinear
|
if (a->qb >= b->qb || a->qe >= b->qe || a->re >= b->re) return 0; // not colinear
|
||||||
w = (a->re - b->rb) - (a->qe - b->qb); // required bandwidth
|
w = (a->re - b->rb) - (a->qe - b->qb); // required bandwidth
|
||||||
w = w > 0? w : -w; // l = abs(l)
|
w = w > 0? w : -w; // l = abs(l)
|
||||||
|
|
|
||||||
2
main.c
2
main.c
|
|
@ -4,7 +4,7 @@
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
#ifndef PACKAGE_VERSION
|
#ifndef PACKAGE_VERSION
|
||||||
#define PACKAGE_VERSION "0.7.9a-r787-dirty"
|
#define PACKAGE_VERSION "0.7.9a-r788-dirty"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int bwa_fa2pac(int argc, char *argv[]);
|
int bwa_fa2pac(int argc, char *argv[]);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue