BAM.Index.BAI (BAM v0.1.0)

Copy Markdown View Source

BAI index codec.

A BAI file is uncompressed little-endian data. It is not BGZF. The magic is BAI\1. Bin 37450, when present, stores the reference's offset range and its mapped and unmapped counts. Those values are not seek ranges. Linear-index slots that were never filled are the unsigned 64-bit sentinel 2^64 - 1.

Summary

Functions

Encodes an index as an uncompressed BAI file.

Functions

decode(binary, limits \\ BAM.Limits.default())

@spec decode(binary(), BAM.Limits.t()) ::
  {:ok, BAM.Index.t()} | {:error, BAM.Error.t()}

Decodes a BAI binary.

encode(index)

@spec encode(BAM.Index.t()) :: {:ok, binary()} | {:error, BAM.Error.t()}

Encodes an index as an uncompressed BAI file.