X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=samtools.git;a=blobdiff_plain;f=bam_tview.c;h=bf01e15c3d79b1a55920bd4162c8e347b9f1f0d7;hp=e48afa7bd4add26404fecc04d6548e7b3989927b;hb=9f4bebab2e0917c676ae739b2d05cb22ad6c4ed5;hpb=8d2494d1fb7cd0fa7c63be5ffba8dd1a11457522 diff --git a/bam_tview.c b/bam_tview.c index e48afa7..bf01e15 100644 --- a/bam_tview.c +++ b/bam_tview.c @@ -183,12 +183,12 @@ tview_t *tv_init(const char *fn, const char *fn_fa) { tview_t *tv = (tview_t*)calloc(1, sizeof(tview_t)); tv->is_dot = 1; - tv->idx = bam_index_load(fn); - if (tv->idx == 0) exit(1); tv->fp = bam_open(fn, "r"); bgzf_set_cache_size(tv->fp, 8 * 1024 *1024); assert(tv->fp); tv->header = bam_header_read(tv->fp); + tv->idx = bam_index_load(fn); + if (tv->idx == 0) exit(1); tv->lplbuf = bam_lplbuf_init(tv_pl_func, tv); if (fn_fa) tv->fai = fai_load(fn_fa); tv->bmc = bam_maqcns_init();