Module noodles_bam::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::read("sample.bam.bai")?;

Re-exports§

  • pub use self::async::Reader as AsyncReader;
  • pub use self::async::Writer as AsyncWriter;

Modules§

  • Async BAM index (BAI) and fields.

Structs§

  • A BAM index (BAI) reader.
  • A BAM index (BAI) writer.

Functions§

  • Reads the entire contents of a BAM index.
  • Writes a BAM index to a file.

Type Aliases§