VariantStore
quantnado.dataset.store_variants.VariantStore
¶
VariantStore(
store_path: Path | str,
sample: str,
chromsizes: dict[str, int],
*,
chunk_len: int,
compressors: list,
overwrite: bool = True,
)
Per-sample Zarr store for VCF/SNP data.
Stores dense (1, chrom_len) arrays for GT, DP, AF, MQ.
VCF positions (1-based) are mapped to 0-based array indices.
Use :meth:from_vcf to create or :meth:open to read.
Source code in quantnado/dataset/store_variants.py
from_vcf
classmethod
¶
from_vcf(
vcf_path: str | Path,
store_path: Path | str,
sample: str,
chromsizes: str | Path | dict[str, int] | None = None,
*,
chunk_len: int | None = None,
construction_compression: str = DEFAULT_CONSTRUCTION_COMPRESSION,
overwrite: bool = True,
filter_chromosomes: bool = True,
test: bool = False,
test_chromosomes: list[str]
| tuple[str, ...]
| None = None,
log_file: Path | None = None,
) -> "VariantStore"
Create a per-sample VariantStore zarr from a single-sample VCF.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vcf_path
|
str | Path
|
Path to annotated VCF (.vcf or .vcf.gz). |
required |
store_path
|
Path | str
|
Output .zarr directory. |
required |
sample
|
str
|
Sample name. |
required |
chromsizes
|
str | Path | dict[str, int] | None
|
Path to .chrom.sizes, dict, or None to infer from VCF ##contig headers. |
None
|