Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Roundtrip testing with hypothesis-vcf #31

Open
tomwhite opened this issue Jul 22, 2024 · 1 comment
Open

Roundtrip testing with hypothesis-vcf #31

tomwhite opened this issue Jul 22, 2024 · 1 comment

Comments

@tomwhite
Copy link
Contributor

We can use hypothesis-vcf to generate VCF files, convert to Zarr with vcf2zarr, then convert back using vcztools - and check that they are equivalent.

@tomwhite
Copy link
Contributor Author

I tried this in a branch here: https://github.com/tomwhite/vcztools/tree/roundtrip-hypothesis. It found a failing case immediately:

>       encoder = _vcztools.VcfEncoder(
            num_variants,
            num_samples if num_samples is not None else 0,
            chrom=chrom,
            pos=pos,
            id=id,
            alt=alt,
            ref=ref,
            qual=qual,
            filter_ids=filters,
            filter=filter_,
        )
E       ValueError: Error occured: -204: 
E       Falsifying example: test_vcf_to_zarr_to_vcf__hypothesis_generated_vcf(
E           tmp_path=PosixPath('/private/var/folders/9j/h1v35g4166z6zt816fq7wymc0000gn/T/pytest-of-tom/pytest-136/test_vcf_to_zarr_to_vcf__hypot0'),
E           vcf_string='##fileformat=VCFv4.3\n##FILTER=<ID=PASS,Description="All filters passed">\n##source=hypothesis-vcf-0.1.dev6+g401c202\n##contig=<ID=0>\n#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\n0\t1\t.\tA\t.\t.\t.\t.\n',
E       )
E       vcf:
E       ##fileformat=VCFv4.3
E       ##FILTER=<ID=PASS,Description="All filters passed">
E       ##source=hypothesis-vcf-0.1.dev6+g401c202
E       ##contig=<ID=0>
E       #CHROM	POS	ID	REF	ALT	QUAL	FILTER	INFO
E       0	1	.	A	.	.	.	.

vcztools/vcf_writer.py:257: ValueError

FWIW it found failures using numba too, but it's probably not worth trying to get both working.

@jeromekelleher jeromekelleher added this to the Initial release milestone Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants