Skip to content

Commit b3026b5

Browse files
Delete some unused methods, test top-level methods
1 parent 4dfc75e commit b3026b5

File tree

2 files changed

+15
-20
lines changed

2 files changed

+15
-20
lines changed

bio2zarr/vcf.py

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,6 @@ def update(self, other):
118118
self.min_value = min(self.min_value, other.min_value)
119119
self.max_value = max(self.max_value, other.max_value)
120120

121-
def asdict(self):
122-
return dataclasses.asdict(self)
123-
124121

125122
@dataclasses.dataclass
126123
class VcfField:
@@ -206,18 +203,6 @@ class VcfMetadata:
206203
contig_lengths: list = None
207204
partitions: list = None
208205

209-
@property
210-
def fixed_fields(self):
211-
return [field for field in self.fields if field.category == "fixed"]
212-
213-
@property
214-
def info_fields(self):
215-
return [field for field in self.fields if field.category == "INFO"]
216-
217-
@property
218-
def format_fields(self):
219-
return [field for field in self.fields if field.category == "FORMAT"]
220-
221206
@staticmethod
222207
def fromdict(d):
223208
fields = [VcfField.fromdict(fd) for fd in d["fields"]]
@@ -445,10 +430,6 @@ def num_chunks(self, partition_index):
445430
self.partition_num_chunks[partition_index] = n
446431
return self.partition_num_chunks[partition_index]
447432

448-
def __repr__(self):
449-
# TODO add class name
450-
return repr({"path": str(self.path), **self.vcf_field.summary.asdict()})
451-
452433
def chunk_path(self, partition_index, chunk_index):
453434
return self.path / f"p{partition_index}" / f"c{chunk_index}"
454435

@@ -1299,7 +1280,7 @@ def to_zarr(
12991280
zarr_path,
13001281
conversion_spec=spec,
13011282
worker_processes=worker_processes,
1302-
show_progress=True,
1283+
show_progress=show_progress,
13031284
)
13041285

13051286

tests/test_vcf.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,20 @@ def test_worker_processes(self, ds, tmp_path, worker_processes):
284284
ds2 = sg.load_dataset(out)
285285
xt.assert_equal(ds, ds2)
286286

287+
@pytest.mark.parametrize("worker_processes", [0, 1, 2])
288+
def test_full_pipeline(self, ds, tmp_path, worker_processes):
289+
exploded = tmp_path / "example.exploded"
290+
vcf.explode(
291+
[self.data_path], exploded, worker_processes=worker_processes,
292+
)
293+
schema = tmp_path / "schema.json"
294+
with open(schema, "w") as f:
295+
vcf.generate_spec(exploded, f)
296+
out = tmp_path / "example.zarr"
297+
vcf.to_zarr(exploded, out, schema, worker_processes=worker_processes)
298+
ds2 = sg.load_dataset(out)
299+
xt.assert_equal(ds, ds2)
300+
287301

288302
@pytest.mark.parametrize(
289303
"name",

0 commit comments

Comments
 (0)