Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/test_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import pytest
import zarr
from bio2zarr import vcf2zarr
from bio2zarr import vcf

from vcztools.stats import nrecords, stats

Expand Down Expand Up @@ -39,7 +39,7 @@ def test_stats__no_index(tmp_path):
original = pathlib.Path("tests/data/vcf") / "sample.vcf.gz"
# don't use cache here since we want to make sure vcz is not indexed
vcz = tmp_path.joinpath("intermediate.vcz")
vcf2zarr.convert([original], vcz, worker_processes=0, local_alleles=False)
vcf.convert([original], vcz, worker_processes=0, local_alleles=False)

# delete the index created by vcf2zarr
root = zarr.open(vcz, mode="a")
Expand Down
4 changes: 2 additions & 2 deletions tests/test_vcf_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import numpy as np
import pytest
import zarr
from bio2zarr import vcf2zarr
from bio2zarr import vcf
from cyvcf2 import VCF
from numpy.testing import assert_array_equal

Expand Down Expand Up @@ -305,7 +305,7 @@ def test_write_vcf__generate_header(tmp_path):
original = pathlib.Path("tests/data/vcf") / "sample.vcf.gz"
# don't use cache here since we mutate the vcz
vcz = tmp_path.joinpath("intermediate.vcz")
vcf2zarr.convert([original], vcz, worker_processes=0, local_alleles=False)
vcf.convert([original], vcz, worker_processes=0, local_alleles=False)

# remove vcf_header
root = zarr.open(vcz, mode="r+")
Expand Down
6 changes: 3 additions & 3 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import cyvcf2
import numpy as np
from bio2zarr import vcf2zarr
from bio2zarr import vcf


@contextmanager
Expand Down Expand Up @@ -145,15 +145,15 @@ def vcz_path_cache(vcf_path):
cached_vcz_path = (cache_path / vcf_path.name).with_suffix(".vcz")
if not cached_vcz_path.exists():
if vcf_path.name.startswith("chr22"):
vcf2zarr.convert(
vcf.convert(
[vcf_path],
cached_vcz_path,
worker_processes=0,
variants_chunk_size=10,
samples_chunk_size=10,
)
else:
vcf2zarr.convert(
vcf.convert(
[vcf_path], cached_vcz_path, worker_processes=0, local_alleles=False
)
return cached_vcz_path
Loading