From bd524958de35283de49cae7e7851da4c9e5eb6de Mon Sep 17 00:00:00 2001 From: Heng Li Date: Mon, 4 May 2009 18:16:50 +0000 Subject: [PATCH] * samtools-0.1.3-9 (r256) * fixed a bug in bam_lpileup.c * I do not know if this also fixes the bug causing assertion failure in the tview --- bam_lpileup.c | 12 +++++++++++- bamtk.c | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/bam_lpileup.c b/bam_lpileup.c index 21b4772..1562170 100644 --- a/bam_lpileup.c +++ b/bam_lpileup.c @@ -102,7 +102,7 @@ static int tview_func(uint32_t tid, uint32_t pos, int n, const bam_pileup1_t *pl } else tv->cur_level[i] = ++tv->max_level; } else { tv->cur_level[i] = tv->pre_level[l++]; - if (p->qpos == p->b->core.l_qseq - 1) { // then return a free slot + if (p->is_tail) { // then return a free slot tv->tail->level = tv->cur_level[i]; tv->tail->next = mp_alloc(tv->mp); tv->tail = tv->tail->next; @@ -150,6 +150,16 @@ static int tview_func(uint32_t tid, uint32_t pos, int n, const bam_pileup1_t *pl tv->pre_level[l++] = tv->pre_level[i]; } tv->n_pre = l; +/* + fprintf(stderr, "%d\t", pos+1); + for (i = 0; i < n; ++i) { + const bam_pileup1_t *p = pl + i; + if (p->is_head) fprintf(stderr, "^"); + if (p->is_tail) fprintf(stderr, "$"); + fprintf(stderr, "%d,", p->level); + } + fprintf(stderr, "\n"); +*/ return 0; } diff --git a/bamtk.c b/bamtk.c index b0a21dd..ff82825 100644 --- a/bamtk.c +++ b/bamtk.c @@ -3,7 +3,7 @@ #include "bam.h" #ifndef PACKAGE_VERSION -#define PACKAGE_VERSION "0.1.3-8 (r251)" +#define PACKAGE_VERSION "0.1.3-9 (r256)" #endif int bam_taf2baf(int argc, char *argv[]); -- 2.39.2