Module bai

Source
Expand description

BAM index (BAI) and fields.

A BAM index (BAI) is used with an associated coordinate-sorted BAM file that allows random access to records, e.g., querying.

The index contains a list of reference sequences parallel to the one defined in the BAM file. Each indexed reference sequence has a calculated set of hierarchical bins at different granularities. The bins then define a list of physical file positions in the BAM to search for overlapping records.

When reading entire BAM files sequentially, a BAM index is not necessary.

§Examples

§Reading a BAM index

use noodles_bam::bai;
let index = bai::fs::read("sample.bam.bai")?;

Re-exports§

pub use self::fs::read;
pub use self::fs::write;
pub use self::io::Reader;
pub use self::io::Writer;
pub use self::async::Reader as AsyncReader;
pub use self::async::Writer as AsyncWriter;

Modules§

async
Async BAI.
fs
BAI filesystem operations.
io
BAI I/O.

Type Aliases§

Index
A BAM index.