From: peterjc
Date: Fri, 19 Apr 2013 15:55:10 +0000 (+0100)
Subject: Slightly more detailed error message for debugging.
X-Git-Url: https://git.donarmstrong.com/?p=samtools.git;a=commitdiff_plain;h=ba21caf366b360eae2a559f973b867efbdb1f131
Slightly more detailed error message for debugging.
It would be nice to include the RNAME, but currently the header
is being discarded before parsing.
---
diff --git a/bam_index.c b/bam_index.c
index 35fb5b6..2fac746 100644
--- a/bam_index.c
+++ b/bam_index.c
@@ -196,8 +196,8 @@ bam_index_t *bam_index_core(bamFile fp)
if (c->tid >= 0) {
recalculated_bin = bam_reg2bin(c->pos, bam_calend(c, bam1_cigar(b)));
if (c->bin != recalculated_bin) {
- fprintf(stderr, "[bam_index_core] read '%s' mapped at POS %d has BIN %d but should be %d\n",
- bam1_qname(b), c->pos + 1, c->bin, recalculated_bin);
+ fprintf(stderr, "[bam_index_core] read '%s' mapped at POS %d to %d has BIN %d but should be %d\n",
+ bam1_qname(b), c->pos + 1, bam_calend(c, bam1_cigar(b)), c->bin, recalculated_bin);
fprintf(stderr, "[bam_index_core] Fix it by using BAM->SAM->BAM to force a recalculation of the BIN field\n");
return NULL;
}