BGZF

BGZF (Blocked GNU Zip Format)
Filename extension
.gz
Internet media type
application/gzip
Magic number`\x1f\x8b\x08\x04` (initial bytes, standard Gzip magic. BGZF adds specific extra fields in the header of each block.)
Developed bySAMtools project / HTSlib
Initial releasec. 2009 (along with SAM/BAM format specification)
Type of formatCompressed file format, Indexed file format
Container forCommonly used for bioinformatics data like SAM, BAM, VCF records
Extended fromGzip
Standardhttps://samtools.github.io/hts-specs/SAMv1.pdf#page=13.12
Websitewww.htslib.org/doc/bgzip.html

Blocked GNU Zip Format (BGZF) is a variant of gzip file format that uses block compression, a method that compresses data in independent blocks of content—each of which is a valid gzip file. This design is utilized widely in bioinformatics for genomic data compression. The block-based design provides efficient storage, random access with indexed queries, and parallel processing; allowing large-scale data processing.

The format was developed as part of SAM/BAM specification and SAMtools. It is a core component of the common BAM format (the binary version of the Sequence Alignment Map format) and is also used to compress and index Variant Call Format (VCF), FASTA, and BED files. Because each block is a standard gzip block, a BGZF file can be decompressed by any standard gzip-compatible tool, ensuring backward compatibility. A general purpose compression utility for producing BGZF files bgzip is distributed with HTSlib software library.