| name | bgzip |
| description | Use when you need to compress or decompress files using BGZF (Blocked GNU Zip Format), create BGZF indexes for random access, or prepare bioinformatics files for tabix indexing. |
| disable-model-invocation | true |
| user-invocable | true |
bgzip
Block compression utility from htslib that creates BGZF-compressed files suitable for random access and indexing.
Quick Start
- Command:
bgzip [OPTIONS] [FILE]
- Local executable:
/home/vimalinx/miniforge3/envs/bio/bin/bgzip
- Version: 1.22.1
- Full reference: See references/help.md for complete options and usage
When To Use This Tool
- Compress tabular genomics files into BGZF rather than ordinary gzip.
- Prepare files for random access and indexing in the HTS ecosystem.
- Reindex or integrity-check an existing BGZF file.
- Use it before
tabix or other tools that require BGZF-aware random access.
Common Patterns
bgzip -i variants.vcf
bgzip -c variants.vcf > variants.vcf.gz
bgzip -r variants.vcf.gz
bgzip -t variants.vcf.gz
Recommended Workflow
- Use BGZF, not generic gzip, for files that must support random access.
- Create or refresh
.gzi indexes when the compressed file changes.
- Test integrity before feeding compressed files into downstream indexing or querying steps.
- Keep compression and indexing steps explicit in pipelines.
Guardrails
- BGZF is gzip-compatible for decompression but not interchangeable with ordinary gzip for random-access workflows.
-i creates a .gzi during compression; -r rebuilds the index later.
-c writes to stdout and keeps the input file unchanged.
- Threading with
-@ is useful for bigger files, but remember that downstream tools still need the final .gzi or tabix index.