From: Heng Li Date: Sun, 13 Jun 2010 21:29:52 +0000 (+0000) Subject: fixed a bug for unmapped sequences in indexing X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=64b94f9ab3c03cc12206d6e2a2e219ec9e2e1b17;p=samtools.git fixed a bug for unmapped sequences in indexing --- diff --git a/bam_index.c b/bam_index.c index 6fffd75..7e026b3 100644 --- a/bam_index.c +++ b/bam_index.c @@ -178,7 +178,7 @@ bam_index_t *bam_index_core(bamFile fp) bam1_qname(b), last_coor, c->pos, c->tid+1); exit(1); } - insert_offset2(&idx->index2[b->core.tid], b, last_off); + if (c->tid >= 0) insert_offset2(&idx->index2[b->core.tid], b, last_off); if (c->bin != last_bin) { // then possibly write the binning index if (save_bin != 0xffffffffu) // save_bin==0xffffffffu only happens to the first record insert_offset(idx->index[save_tid], save_bin, save_off, last_off);