Cache-based VCF annotation accelerator
Project description
VCFcache – Cache once, annotate fast
Cache common variants once, reuse them for every sample. VCFcache builds a normalized blueprint, annotates it once, and reuses those results so only rare/novel variants are annotated at runtime.
Performance: With 60-90% cache hit rates on typical samples, VCFcache achieves 2-10× speed-ups compared to standard annotation pipelines. Cache lookups are constant-time operations regardless of cache size, making the tool highly scalable. See WIKI.md for the detailed runtime efficiency model.
Contig naming: VCFcache requires matching contig naming between cache and samples (e.g., both use chr1 or both use 1). At runtime, vcfcache reports the contig overlap and fails fast if there is no overlap.
Works with any genome/build (human, mouse, plants, model organisms) as long as your inputs and annotation pipeline use compatible reference builds and contig naming. The genome build must be explicitly set in both params.yaml and annotation.yaml.
Quick Start - pip install
Requires: Python >= 3.11 (earlier versions untested), bcftools >= 1.20
pip install vcfcache
vcfcache demo --smoke-test # Run comprehensive demo
vcfcache --help
Install bcftools separately:
- Ubuntu/Debian:
sudo apt-get install bcftools - macOS:
brew install bcftools - Conda:
conda install -c bioconda bcftools
Quick Start - Docker
Docker includes bcftools - no separate installation needed.
docker pull ghcr.io/julius-muller/vcfcache:latest
# List available public caches
docker run --rm ghcr.io/julius-muller/vcfcache:latest list caches
# Use a public cache from Zenodo
docker run --rm -v $(pwd):/work ghcr.io/julius-muller/vcfcache:latest \
annotate \
-a cache-hg38-gnomad-4.1joint-AF0100-vep-115.2-basic \
--vcf /work/sample.vcf.gz \
--output /work/sample_vc.bcf \
--stats-dir /work
Quick Start - from source
git clone https://github.com/julius-muller/vcfcache.git
cd vcfcache
uv venv .venv && source .venv/bin/activate
uv pip install -e ".[dev]"
vcfcache --help
Build Your Own Cache
- Create blueprint (normalize/deduplicate variants):
vcfcache blueprint-init --vcf gnomad.bcf --output ./cache -y params.yaml
- Annotate blueprint (create cache):
vcfcache cache-build --name vep_cache --db ./cache -a annotation.yaml -y params.yaml
- Use cache on samples:
vcfcache annotate -a ./cache/cache/vep_cache --vcf sample.vcf.gz --output ./sample_vc.bcf --stats-dir ./results
If --stats-dir is provided, stats are written to <stats_dir>/<input_basename>_vcstats. Otherwise, they default to <cwd>/<input_basename>_vcstats.
Use --no-stats to skip writing stats/logs (disables vcfcache compare).
Configuration
Override system bcftools (if needed):
export VCFCACHE_BCFTOOLS=/path/to/bcftools-1.22
Change where downloaded caches/blueprints are stored (default: ~/.cache/vcfcache):
export VCFCACHE_DIR=/path/to/vcfcache_cache_dir
Or in params.yaml:
bcftools_cmd: "/path/to/bcftools"
See WIKI.md for detailed configuration, cache distribution via Zenodo, and troubleshooting.
Links
- Documentation: WIKI.md
- Source: https://github.com/julius-muller/vcfcache
- Issues: https://github.com/julius-muller/vcfcache/issues
- Docker: ghcr.io/julius-muller/vcfcache
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vcfcache-0.5.0.tar.gz.
File metadata
- Download URL: vcfcache-0.5.0.tar.gz
- Upload date:
- Size: 156.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c908a3ef79b6457b7570c3106de92f0e6b021c44c8737d7a242ad03f45223e1
|
|
| MD5 |
57b3969618905367fedaaa8645f6fa36
|
|
| BLAKE2b-256 |
a4856997d461bb69322111f8b9dbbc581d55fe9d7671bd11d0d2c2ab51531078
|
File details
Details for the file vcfcache-0.5.0-py3-none-any.whl.
File metadata
- Download URL: vcfcache-0.5.0-py3-none-any.whl
- Upload date:
- Size: 106.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2f254c01443a07b4fb6a40d8e7d77bfeb343c563771c72cdf436680341daf53
|
|
| MD5 |
59dc6abec8e4818952259ba3a3ed93fc
|
|
| BLAKE2b-256 |
2f999140cc584f3a2fdc915f6cb18aca9b7e25c529d642cc9d2fb9adcb538058
|