UKB chr1 Dense Store — 1000 vs 128 Analysis Benchmark
chr1 UKB analyses · Dense Observed-Only store
format_version 0.1, not re-run for the z or eaf encodings
Every figure below was measured against stores whose z plane is
float16 and which carry no eaf at all. Two changes have
landed since, both of which move stored size and add a decode step to every read:
issue #114 (ADR 0037 §1) made z int16 fixed point with an
exact overflow table, and issue #116 (ADR 0037 §2, §4) made eaf a
per-variant baseline plus an int8 logit residual and moved
format_version to 2.0. The sizes and timings here describe neither.
They are re-measured against rebuilt stores in #117, before the version that ships
the encodings is cut (CONTRIBUTING.md, “Benchmarks are measurements,
not prose”).
Overview
This benchmark measures Dense Observed-Only Stores built from UK Biobank GWAS-VCF analyses covering chromosome 1. The main store has 1000 analyses; the scaling comparison uses a 128-analysis subset from the same source manifest to show how build time, storage, and query latency change as the analysis axis grows.
Dataset
| Field | Value |
|---|---|
| Variants (hg38) | 762,080 |
| Analyses | 1,000 |
| Store size | 1,773.7 MB |
| Build time | 80.3 min (4,821 s) |
| Source assembly | GRCh37 / hg19 (inline liftover to hg38) |
| Layout | Dense Observed-Only (z, se float16 zarr) |
| Store path | /home/gh13047/repo/opengwasdb/docs/benchmark-output/vcf_ukb_chr1_1000_dense.opengwasdb |
Storage
| Form | Size | vs raw |
|---|---|---|
| Raw source VCF (.vcf.gz) | 12,632.9 MB | 1.00× |
| OpenGWASDB Dense store | 1,773.7 MB | 7.12× smaller |
The Dense store is 7.1× smaller than the raw bgzipped source VCFs it was built from. The store holds two float16 statistic arrays (z, se) plus a tabix variant axis, an mmap’d ALID search index, and a pre-computed top-hit index.
Query timings
All timings are the median over 10 repetitions after one warm-up call. bulk and random_lookup deliberately stress the two worst-case access patterns (a full single-analysis scan and scattered random cell reads).
| Pattern | Median ms | p95 ms | Result cells | What it reads |
|---|---|---|---|---|
| regional | 129.8 | 163.1 | 1,488,379 | All finite associations in a 1 Mb genomic window, all analyses |
| phewas | 7.8 | 11.0 | 1,000 | One variant × all analyses |
| tophits | 8.9 | 11.6 | 182,843 | All GW-significant (p < 5×10⁻⁸) associations for one analysis |
| bulk | 5,546.6 | 6,936.7 | 762,080 | All finite associations for one analysis (~762 K variants) |
| random_lookup | 649.6 | 768.2 | 587 | 100 random variants × 10 random analyses |
Latency-sensitive point queries (phewas, tophits) stay in low-millisecond territory even at 1000 analyses, because the zarr read per row is amortised across more columns per chunk. The bulk pattern is O(n_variants) and reads all 762 K rows for one analysis, so it is the pattern to design around rather than optimise blindly.
Scaling: 128 → 1000 analyses
Same 762,080 variants and the same chr1 source manifest; 1000 analyses is 7.8× the 128-analysis subset.
128-analysis benchmark JSON not found — run uv run python benchmarks/benchmark_vcf_ukb_chr1_1000_dense.py --analysis-count 128 --rebuild --reps 10.
Storage and build time both scale sub-linearly with analysis count — the variant axis, tabix index, and ALID index are fixed overhead paid once and amortised across every additional analysis column. Query latency scales with the result-set size: regional and bulk read more cells so grow closer to linearly, while phewas and tophits scale better because each per-row zarr read serves more columns per chunk.
Provenance
- 1000-analysis timings:
opengwasdb_vcf_ukb_chr1_1000_benchmark.json(built in 4,821s, 762,080 variants × 1,000 analyses) - Raw VCF sizes: recorded by
benchmarks/benchmark_vcf_ukb_chr1_1000_dense.pyfrom the selected manifest rows - Benchmark script:
benchmarks/benchmark_vcf_ukb_chr1_1000_dense.py