Skip to content

Commit

Permalink
add tests for drop-genotypes option
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeHagen authored and jeromekelleher committed Aug 29, 2024
1 parent 9abb124 commit efa463c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/test_bcftools_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ def run_vcztools(args: str) -> str:
"view --no-version -e '(FMT/DP >= 8 | FMT/GQ>40) && POS > 100000'",
"sample.vcf.gz"
),
(
"view --no-version -G",
"sample.vcf.gz"
),
]
)
# fmt: on
Expand Down
12 changes: 12 additions & 0 deletions tests/test_vcf_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,18 @@ def test_write_vcf__samples(tmp_path, samples, expected_genotypes):
assert variant.genotypes == expected_genotypes


def test_write_vcf__no_samples(tmp_path):
original = pathlib.Path("tests/data/vcf") / "sample.vcf.gz"
vcz = vcz_path_cache(original)
output = tmp_path.joinpath("output.vcf")

write_vcf(vcz, output, drop_genotypes=True)

v = VCF(output)

assert v.samples == []


@pytest.mark.parametrize(
("regions", "targets", "samples", "include", "expected_chrom_pos"),
[
Expand Down

0 comments on commit efa463c

Please sign in to comment.