X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=samtools.git;a=blobdiff_plain;f=bam_index.c;fp=bam_index.c;h=9610a2656031657b796abc68bf32c1b6f1564745;hp=66d8eb8a896ab5a0a4decf612e65eac158e92cbf;hb=b990d9d3dd518a9cf7b7f4a165c584d8d8d1cfb0;hpb=5075acdfc387c56ca8411cde3e419e867da9804d diff --git a/bam_index.c b/bam_index.c index 66d8eb8..9610a26 100644 --- a/bam_index.c +++ b/bam_index.c @@ -188,7 +188,7 @@ bam_index_t *bam_index_core(bamFile fp) bam1_qname(b), last_coor, c->pos, c->tid+1); return NULL; } - if (c->tid >= 0) insert_offset2(&idx->index2[b->core.tid], b, last_off); + if (c->tid >= 0 && !(c->flag & BAM_FUNMAP)) 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);