Read-only views of VCF Zarr (VCZ) data in standard bioinformatics file formats via a FUSE filesystem. Currently supported views:
- PLINK 1.9 binary (
.bed/.bim/.fam) — viamount-plink. - Oxford BGEN (
.bgen/.sample/.bgen.bgi) — viamount-bgen.
Pre-release. The mount serves the streaming file (.bed / .bgen) on
demand via a worker subprocess running the matching
vcztools encoder
(BedEncoder / BgenEncoder); the static sidecars are computed once
at mount time and held in the worker's memory.
The mounted PLINK view supports the access patterns of plink1.9 and
plink2 for typical analysis commands (--freq, --missing,
--hardy, etc.) — see tests/test_plink_apps.py for the verified set.
The mounted BGEN view always uses zlib level 0 (stored, fixed-size
blocks) for O(1) random access; bgenix / qctool parity checks live
in tests/test_bgen_apps.py.
biofuse depends on libfuse 3 system headers when building from source:
sudo apt-get install -y fuse3 libfuse3-dev pkg-configThen with uv:
uv sync --group testvcztools is currently consumed as a sibling-directory path dependency
(../vcztools); see pyproject.toml.
biofuse mount-plink path/to/sample.vcz /mount/dirMounts a read-only directory at /mount/dir containing
sample.bed, sample.bim, sample.fam. The mount runs in the foreground;
press Ctrl-C to unmount.
Options:
--basename NAME— basename for the plink fileset (defaults to the VCZ stem).--access-log PATH— record every read as a JSONL row to PATH (useful for characterising consumer access patterns).- The bcftools-view-style filter / backend / log options
(
-r/-R/-s/-S/-t/-T/-i/-e/-v/-V/-m/-M,--backend-storage,--storage-option,--log-level,--log-file) are inherited fromvcztools view-plink. Runbiofuse mount-plink --helpor seevcztools view-plink --helpfor the full reference.
Example:
mkdir /tmp/plink-mnt
biofuse mount-plink ./sample.vcz /tmp/plink-mnt &
plink1.9 --bfile /tmp/plink-mnt/sample --freq --out ./out
fusermount3 -u /tmp/plink-mntbiofuse mount-bgen path/to/sample.vcz /mount/dirMounts a read-only directory at /mount/dir containing
sample.bgen, sample.sample, sample.bgen.bgi. The .bgen payload
uses zlib level 0 (stored, fixed-size variant blocks) so byte-range
random access is O(1); downstream tools (bgenix, qctool, REGENIE,
SAIGE, BOLT-LMM, plink2 --bgen) consume the mount unchanged. The
.bgen.bgi SQLite sidecar is generated once at mount time and held in
the worker's memory alongside .sample.
Options mirror mount-plink: --basename, --access-log, and the
shared bcftools-style filter / backend / log set inherited from
vcztools view-bgen. Run biofuse mount-bgen --help or see
vcztools view-bgen --help for the full reference.
Example:
mkdir /tmp/bgen-mnt
biofuse mount-bgen ./sample.vcz /tmp/bgen-mnt &
bgenix -g /tmp/bgen-mnt/sample.bgen -list
fusermount3 -u /tmp/bgen-mnt- Mixed ploidy is not supported by
mount-bgen. The fixed-size BGEN encoder used for random-access serving requires uniform ploidy across every sample and variant in the view. Mounts whose region includes mixed-ploidy chromosomes (typically X, Y, MT) open successfully and serve.sampleand.bgen.bgi, but the first.bgenread will fail withEIO. Workaround: restrict the view to autosomes at mount time (e.g. via the inherited-r/-R/-t/-Tregion filters), or use the one-shotvcztools view-bgenCLI for full-file conversions that include X / Y / MT —view-bgenuses the streaming variable-size encoder which handles mixed ploidy correctly. - Pure haploid VCZ is supported by
mount-bgen(the encoder emits a uniform-haploid BGEN payload). mount-plinkis diploid-only. Pure haploid VCZ inputs (e.g. mitochondrial-only stores) are rejected by the underlying encoder withEIOon the first.bedread. Mixed-ploidy VCZ inputs serve successfully, but haploid samples are encoded as homozygous for the called allele — this matches the PLINK 1 BED format, which has no haploid representation.
uv sync --group dev
uv run pytest # full suite
uv run pytest tests/test_encoder_ops.py # one module
uv run prek install # install git pre-commit hook (one-off)
uv run --only-group=lint prek -c prek.toml run --all-filesApache 2.0. See LICENSE.