Skip to content

Commit

Permalink
r280: tolerate a freebayes weirdo; not assert fail
Browse files Browse the repository at this point in the history
  • Loading branch information
lh3 committed Mar 23, 2016
1 parent c7f8b56 commit 479f2fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions atomic.c
Expand Up @@ -163,8 +163,9 @@ void bcf_atomize(const bcf_hdr_t *h, bcf1_t *b, bcf_atom_v *a)
bcf_add_atom(a, b->rid, b->pos + x + j, 1, i, 1, &b->d.allele[0][x+j], 1, &b->d.allele[i][y+j]);
x += l, y += l;
} else if (*p == 'I') {
assert(x > 0 && y > 0);
bcf_add_atom(a, b->rid, b->pos + x - 1, 1, i, 1, &b->d.allele[0][x-1], l+1, &b->d.allele[i][y-1]);
if (x == 0 || y == 0)
fprintf(stderr, "[W::%s] invalid insertion (%d,%d) at %s:%d\n", __func__, x, y, h->id[BCF_DT_CTG][b->rid].key, b->pos + 1);
else bcf_add_atom(a, b->rid, b->pos + x - 1, 1, i, 1, &b->d.allele[0][x-1], l+1, &b->d.allele[i][y-1]);
y += l;
} else if (*p == 'D') {
assert(x > 0 && y > 0);
Expand Down
2 changes: 1 addition & 1 deletion main.c
Expand Up @@ -3,7 +3,7 @@
#include <string.h>
#include <ctype.h>

#define BGT_VERSION "1.0-r279-dirty"
#define BGT_VERSION "1.0-r280-dirty"

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

0 comments on commit 479f2fe

Please sign in to comment.