{
  "slug": "bgzf",
  "term": "Blocked GNU Zip Format (BGZF)",
  "aliases": [
    "BGZF",
    "blocked gzip"
  ],
  "definition": "BGZF is a gzip-compatible blocked compression format that supports random access through independently decompressible blocks and virtual offsets.",
  "note": "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. [bgzf-spec]\n\nA 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. [bgzf-spec]\n\nA 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. [bgzip-manual]\n\nIn 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. [hesela-pair-evidence]",
  "status": "shipping",
  "advantages": [],
  "limitations": [],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-10-25",
  "related": [
    "gzip",
    "tabix-index"
  ],
  "citations": [
    {
      "id": "bgzf-spec",
      "title": "SAM/BAM specification: BGZF framing and virtual offsets, section 4.1",
      "url": "https://github.com/samtools/hts-specs/blob/510c107ba89aa13113818c9e4fa3071283cb7f7b/SAMv1.tex",
      "accessed": "2026-10-25"
    },
    {
      "id": "bgzip-manual",
      "title": "HTSlib 1.24 bgzip manual: GZI offset pairs, integrity testing and recompression",
      "url": "https://www.htslib.org/doc/bgzip.html",
      "accessed": "2026-10-25"
    },
    {
      "id": "hesela-pair-evidence",
      "title": "Hesela: BGZF/tabix generation mismatch, native captures and reproduction method",
      "url": "https://hesela.dev/research/bgzf-tabix-identity/PUBLICATION.md",
      "accessed": "2026-10-25"
    }
  ]
}
