bgzf · shipping · also BGZF, blocked gzip

Blocked GNU Zip Format (BGZF)

BGZF is a gzip-compatible blocked compression format that supports random access through independently decompressible blocks and virtual offsets.

Related Observatory article: Blocked GNU Zip Format (BGZF) on hesela.com

Each block is a gzip member with a BC extra field describing its compressed size. Compressed block size, including framing, and uncompressed block size are each limited to 65,536 bytes. Ordinary gzip compatibility does not provide genomic-coordinate lookup. [1]

A 64-bit virtual offset packs a compressed-block byte position into the upper 48 bits and a decoded position within that block into the lower 16. It is not an ordinary decoded-byte offset; subtraction across blocks does not give a decoded length. [1]

A GZI sidecar maps compressed block starts to cumulative uncompressed byte positions. A tabix TBI or CSI index instead locates records by sequence and genomic interval. Recompression can change block positions even when decoded content is identical, so old virtual offsets must not be assumed reusable. [2]

In Hesela's synthetic three-record BED controls, HTSlib 1.22.1 and 1.24 accepted the data and index as individually valid BGZF files while a mismatched TBI or CSI index omitted two query matches with exit status zero. Full decompression and a broad query still passed. This is a version-scoped pair-identity counterexample, not a CRC failure rate or a benchmark. [3]

Relations

related
Gzip, Tabix index

Citations

  1. SAM/BAM specification: BGZF framing and virtual offsets, section 4.1 (accessed 2026-10-25)
  2. HTSlib 1.24 bgzip manual: GZI offset pairs, integrity testing and recompression (accessed 2026-10-25)
  3. Hesela: BGZF/tabix generation mismatch, native captures and reproduction method (accessed 2026-10-25)

JSON: /data/terms/bgzf.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. Blocked GNU Zip Format (BGZF). Hesela. 2026-10-25. https://hesela.dev/terms/bgzf/