Skip to content

Commit

Permalink
bugfix: bwa-sw PE segfault in rare case
Browse files Browse the repository at this point in the history
  • Loading branch information
Heng Li committed Nov 28, 2011
1 parent bf65b64 commit 64e353c
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 3 deletions.
33 changes: 33 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,36 @@
Release 0.6.1 (25 November, 2011)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Notable changes to BWA-short:

* Bugfix: duplicated alternative hits in the XA tag.

* Bugfix: when trimming enabled, bwa-aln trims 1bp less.

* Disabled the color-space alignment. 0.6.x is not working with SOLiD reads at
present.

Notable changes to BWA-SW:

* Bugfix: segfault due to excessive ambiguous bases.

* Bugfix: incorrect mate position in the SE mode.

* When macro _NO_SSE2 is in use, fall back to the standard Smith-Waterman
instead of SSE2-SW.

* Optionally mark split hits with lower alignment scores as secondary.

Changes to fastmap:

* Bugfix: infinite loop caused by ambiguous bases.

* Optionally output the query sequence.

(0.6.1: 25 November 2011, r103)



Release 0.5.10 and 0.6.0 (12 November, 2011)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
6 changes: 3 additions & 3 deletions bwape.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ bwa_cigar_t *bwa_sw_core(bwtint_t l_pac, const ubyte_t *pacseq, int len, const u
bwa_cigar_t *cigar = 0;
ubyte_t *ref_seq;
bwtint_t k, x, y, l;
int path_len, ret;
int path_len, ret, subo;
AlnParam ap = aln_param_bwa;
path_t *path, *p;

Expand All @@ -454,8 +454,8 @@ bwa_cigar_t *bwa_sw_core(bwtint_t l_pac, const ubyte_t *pacseq, int len, const u
path = (path_t*)calloc(l+len, sizeof(path_t));

// do alignment
ret = aln_local_core(ref_seq, l, (ubyte_t*)seq, len, &ap, path, &path_len, 1, 0);
if (ret < 0) {
ret = aln_local_core(ref_seq, l, (ubyte_t*)seq, len, &ap, path, &path_len, 1, &subo);
if (ret < 0 || subo == ret) { // no hit or tandem hits
free(path); free(cigar); free(ref_seq); *n_cigar = 0;
return 0;
}
Expand Down
1 change: 1 addition & 0 deletions bwtsw2_pair.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ void bsw2_pair1(const bsw2opt_t *opt, int64_t l_pac, const uint8_t *pac, const b
}
if (beg < 1) beg = 1;
if (end > l_pac) end = l_pac;
if (end - beg < l_mseq) return;
// generate the sequence
seq = malloc(l_mseq + (end - beg));
ref = seq + l_mseq;
Expand Down

0 comments on commit 64e353c

Please sign in to comment.