From ec5db8370dc97a853d6fada24ec518756a35e070 Mon Sep 17 00:00:00 2001 From: Heng Li Date: Fri, 6 Nov 2009 14:17:09 +0000 Subject: [PATCH] * samtools-0.1.6-22 (r509) * forget to fix a similar problem in glfgen --- bam_plcmd.c | 8 +++++--- bamtk.c | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/bam_plcmd.c b/bam_plcmd.c index e2601ec..ba787a9 100644 --- a/bam_plcmd.c +++ b/bam_plcmd.c @@ -121,9 +121,11 @@ static int glt3_func(uint32_t tid, uint32_t pos, int n, const bam_pileup1_t *pu, g3->offset = pos - d->last_pos; d->last_pos = pos; glf3_write1(d->fp_glf, g3); - if (proposed_indels) - r = bam_maqindel(n, pos, d->ido, pu, d->ref, proposed_indels[0], proposed_indels+1); - else r = bam_maqindel(n, pos, d->ido, pu, d->ref, 0, 0); + if (pos < d->len) { + if (proposed_indels) + r = bam_maqindel(n, pos, d->ido, pu, d->ref, proposed_indels[0], proposed_indels+1); + else r = bam_maqindel(n, pos, d->ido, pu, d->ref, 0, 0); + } if (r) { // then write indel line int het = 3 * n, min; min = het; diff --git a/bamtk.c b/bamtk.c index b4af0ec..890db11 100644 --- a/bamtk.c +++ b/bamtk.c @@ -9,7 +9,7 @@ #endif #ifndef PACKAGE_VERSION -#define PACKAGE_VERSION "0.1.6-21 (r508)" +#define PACKAGE_VERSION "0.1.6-22 (r509)" #endif int bam_taf2baf(int argc, char *argv[]); -- 2.39.2