Skip to content

Commit

Permalink
r438: still an issue in MD
Browse files Browse the repository at this point in the history
It occurs when the global alignment disagrees with the local alignment.
  • Loading branch information
lh3 committed Feb 19, 2014
1 parent 52391a9 commit 17fb85a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions bwa.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ uint32_t *bwa_gen_cigar(const int8_t mat[25], int q, int r, int w_, int64_t l_pa
int op, len;
cigar = (uint32_t*)str.s;
op = cigar[k]&0xf, len = cigar[k]>>4;
if (op == 2 && (k == 0 || k == *n_cigar - 1)) continue; // skip the leading or trailing deletions
if (op == 0) { // match
for (i = 0; i < len; ++i) {
if (query[x + i] != rseq[y + i]) {
Expand All @@ -144,11 +143,13 @@ uint32_t *bwa_gen_cigar(const int8_t mat[25], int q, int r, int w_, int64_t l_pa
}
x += len; y += len;
} else if (op == 2) { // deletion
kputw(u, &str); kputc('^', &str);
for (i = 0; i < len; ++i)
kputc(int2base[rseq[y+i]], &str);
u = 0;
y += len, n_gap += len;
if (k > 0 && k < *n_cigar) { // don't do the following if D is the first or the last CIGAR
kputw(u, &str); kputc('^', &str);
for (i = 0; i < len; ++i)
kputc(int2base[rseq[y+i]], &str);
u = 0; n_gap += len;
}
y += len;
} else if (op == 1) x += len, n_gap += len; // insertion
}
kputw(u, &str); kputc(0, &str);
Expand Down
2 changes: 1 addition & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "utils.h"

#ifndef PACKAGE_VERSION
#define PACKAGE_VERSION "0.7.6a+dev-r437"
#define PACKAGE_VERSION "0.7.6a+dev-r438"
#endif

int bwa_fa2pac(int argc, char *argv[]);
Expand Down

0 comments on commit 17fb85a

Please sign in to comment.