hypothesis-vcf
A Hypothesis strategy for generating VCF (Variant Call Format) files.
Description
hypothesis-vcf is designed to generate VCF files that conform to the VCF specification
(version 4.3).
It generates VCFs that are syntactically valid, but which don't have meaningful semantics.
For that reason, the main use case is for testing software that parses VCF or converts VCF to another format, since Hypothesis will generate examples that exercise many edge cases of the VCF spec.
In general, the generated VCFs do not have well-known INFO or FORMAT fields, such as DP
or AD. There is one exception to this: GT (genotype) fields are generated, since they
are found in most VCF files. The ability to generate more well-known fields may be added
in the future.
API
The public API consists of just one function: hypothesis_vcf.vcf.
Usage
Generate an example interactively:
>>> from hypothesis_vcf import vcf
>>> print(vcf().example())
##fileformat=VCFv4.3
##FILTER=<ID=PASS,Description="All filters passed">
##source=hypothesis-vcf-0.1.dev2+g32cb4a6
##contig=<ID=C>
##INFO=<ID=Jw,Type=Float,Number=1,Description="INFO,Type=Float,Number=1">
##FORMAT=<ID=zS,Type=Integer,Number=3,Description="FORMAT,Type=Integer,Number=3">
##FORMAT=<ID=ky,Type=String,Number=A,Description="FORMAT,Type=String,Number=A">
#CHROM POS ID REF ALT QUAL FILTER INFO
C 87 . NCNN CCCTTTCTCNCAGGNA,ACGCCAGTAATCGCGCNNAAAATAAGT,GNTAT . . .
C 251 vRIinp GGAATGGNTNTNNTCCA AA,CCGTNATNAA,GAG . . Jw=0.0
Generate examples in unit tests:
from hypothesis import given
from hypothesis_vcf import vcf
@given(vcf_string=vcf())
def test_vcf(vcf_string):
assert vcf_string.startswith("##fileformat=VCF")
Metadata
Release files for hypothesis-vcf 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| hypothesis_vcf-0.1.0.tar.gz | 20.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hypothesis_vcf-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 36.0 kB
Release files / hypothesis_vcf-0.1.0.tar.gz
| Download URL | hypothesis_vcf-0.1.0.tar.gz |
|---|---|
| Size | 20.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9ed42c83c3fc2ed8749f867c9a337afc253c7ac9cd79d57b1fbf056d11ff758f
|
|
BLAKE2b-256 checksum How to use checksums |
0d333451b901ac0f7a477d9be4ec3b0219f9763f01476e94f4a1790086a9c20c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 29, 2025.
Transparency logRelease files / hypothesis_vcf-0.1.0-py3-none-any.whl
| Download URL | hypothesis_vcf-0.1.0-py3-none-any.whl |
|---|---|
| Size | 15.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0f54858607faa9f603034b49ab6fed6d8194138a5038c51e5249921c458b2b67
|
|
BLAKE2b-256 checksum How to use checksums |
32e3459ac938c69286eff8d50a3ddae70687ee370e1278d67207e1c0d3fcdd15
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 29, 2025.
Transparency log