BAM Index Chunks
2
0
Entering edit mode
6.6 years ago

Hi, can someone explain to me about chunk in bam index file (*.bai) especially about the value from chunk-beg and chunk-end? What is that value? I still cannot figure it out about that. For example:

<bin first-locus="65537" last-locus="81920" level="5" first-offset="30386741294" n_chunk="3">
        <chunk chunk_beg="30386741294" chunk_end="32098156792"/>
        <chunk chunk_beg="64139705603" chunk_end="64139714239"/>
        <chunk chunk_beg="94576794025" chunk_end="94576800921"/>
</bin>

I still don't get it about the value of the beginning/end chunk and how it relates to the bam file?

Thanks!

BAM • 2.0k views
ADD COMMENT
0
Entering edit mode
6.6 years ago

"A chunk is an interval in BAM. Given a chunk with bin $b, most reads in this interval have the same bin $b. None of reads outside the interval have bin $b. By going through the chunks in the bin $b, you will get all the reads with bin $b."

from: http://seqanswers.com/forums/archive/index.php/t-33039.html

ADD COMMENT
0
Entering edit mode
6.6 years ago

chunk_beg..chunk_end is the range of file offsets within the BAM file telling you where in the file the records are. There can be several chunks because the read records within a bin are not necessarily all contiguous in the BAM file — there can be reads from other bins interspersed with them.

But they are virtual file offsets, as described in §4.1.1 (“Random access”) of the SAM specification. If you haven't already, you should read the discussion of indexing (§5 and §5.2) BGZF-based files (§4.1) in the SAM specification.

ADD COMMENT
0
Entering edit mode

Is that represent byte? Thanks for your explanation

ADD REPLY

Login before adding your answer.

Traffic: 2340 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