Hypothesis strategy for generating VCF
Project description
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")
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 hypothesis_vcf-0.1.0.tar.gz.
File metadata
- Download URL: hypothesis_vcf-0.1.0.tar.gz
- Upload date:
- Size: 20.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ed42c83c3fc2ed8749f867c9a337afc253c7ac9cd79d57b1fbf056d11ff758f
|
|
| MD5 |
8fe3896317b172f40742490bcac17d8d
|
|
| BLAKE2b-256 |
0d333451b901ac0f7a477d9be4ec3b0219f9763f01476e94f4a1790086a9c20c
|
Provenance
The following attestation bundles were made for hypothesis_vcf-0.1.0.tar.gz:
Publisher:
cd.yml on sgkit-dev/hypothesis-vcf
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hypothesis_vcf-0.1.0.tar.gz -
Subject digest:
9ed42c83c3fc2ed8749f867c9a337afc253c7ac9cd79d57b1fbf056d11ff758f - Sigstore transparency entry: 166657485
- Sigstore integration time:
-
Permalink:
sgkit-dev/hypothesis-vcf@638ec40ca41f249a7b46729c5ace5e7f88c859e4 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/sgkit-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@638ec40ca41f249a7b46729c5ace5e7f88c859e4 -
Trigger Event:
release
-
Statement type:
File details
Details for the file hypothesis_vcf-0.1.0-py3-none-any.whl.
File metadata
- Download URL: hypothesis_vcf-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f54858607faa9f603034b49ab6fed6d8194138a5038c51e5249921c458b2b67
|
|
| MD5 |
289edecceb714f2e93e34e4ce60286d6
|
|
| BLAKE2b-256 |
32e3459ac938c69286eff8d50a3ddae70687ee370e1278d67207e1c0d3fcdd15
|
Provenance
The following attestation bundles were made for hypothesis_vcf-0.1.0-py3-none-any.whl:
Publisher:
cd.yml on sgkit-dev/hypothesis-vcf
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hypothesis_vcf-0.1.0-py3-none-any.whl -
Subject digest:
0f54858607faa9f603034b49ab6fed6d8194138a5038c51e5249921c458b2b67 - Sigstore transparency entry: 166657490
- Sigstore integration time:
-
Permalink:
sgkit-dev/hypothesis-vcf@638ec40ca41f249a7b46729c5ace5e7f88c859e4 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/sgkit-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@638ec40ca41f249a7b46729c5ace5e7f88c859e4 -
Trigger Event:
release
-
Statement type: