What is a bam.bai for?
2
0
Entering edit mode
7.6 years ago
aswartz85 ▴ 20

I had my mRNA seq reads aligned by my institutions core faciltiiy and I attempted it myself using Hisat2 and cufflinks. Throughout my process, I didn't seem to require a bam.bai file. However, my core facility sent me one with all of my data. What sorts of programs is the bam.bai used for?

I understand that the bai file is sort of a table of contents for the bam file, I just don't understand its utility.

RNA-Seq alignment • 17k views
ADD COMMENT
3
Entering edit mode
7.6 years ago
GenoMax 141k

.bai files are used by genome viewers (e.g. IGV/IGB etc). If you want to jump from displaying Chr 1 to Chr 13 in a sorted BAM file (which can be GB in size) you don't want to have to read that entire file to locate the place where the chromosome of your interest starts.

See: Bam And Indexed Bam Files

ADD COMMENT
2
Entering edit mode
7.6 years ago
chen ★ 2.5k

BAI is an index file for BAM.

For some applications, you need to seek to some genome position from a sorted bam file, you need an index file, which stores the BAM file offsets of genome positions.

Note that BAM is actually made of a list of small zip packs. Each pack has different sizes, that makes random access directly by calculating file offset not possible. That's why you need a BAI for random access.

ADD COMMENT

Login before adding your answer.

Traffic: 2616 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6