Skip to content

Commit d6258a4

Browse files
committed
Don't store original VCF header in vcz
1 parent e3c31e5 commit d6258a4

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

bio2zarr/icf.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -891,8 +891,6 @@ def __init__(self, path):
891891
# directory is either a WIP or the wrong format.
892892
with open(self.path / "metadata.json") as f:
893893
self.metadata = IcfMetadata.fromdict(json.load(f))
894-
with open(self.path / "header.txt") as f:
895-
self.vcf_header = f.read()
896894
self.compressor = numcodecs.get_codec(self.metadata.compressor)
897895
self.fields = {}
898896
partition_num_records = [
@@ -970,9 +968,7 @@ def num_fields(self):
970968

971969
@property
972970
def root_attrs(self):
973-
return {
974-
"vcf_header": self.vcf_header,
975-
}
971+
return {}
976972

977973
def iter_id(self, start, stop):
978974
for value in self.fields["ID"].iter_values(start, stop):
@@ -1299,10 +1295,8 @@ def init(
12991295

13001296
self.mkdirs()
13011297

1302-
# Note: this is needed for the current version of the vcfzarr spec, but it's
1303-
# probably going to be dropped.
1298+
# Note: the header is no longer stored in vcz, but keep in icf.
13041299
# https://github.com/pystatgen/vcf-zarr-spec/issues/15
1305-
# May be useful to keep lying around still though?
13061300
logger.info("Writing VCF header")
13071301
with open(self.path / "header.txt", "w") as f:
13081302
f.write(header)

tests/test_vcf_examples.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import pathlib
33
import re
44

5-
import cyvcf2
65
import numpy as np
76
import numpy.testing as nt
87
import pytest
@@ -53,10 +52,6 @@ def test_filters(self, ds):
5352
],
5453
)
5554

56-
def test_header(self, ds):
57-
vcf = cyvcf2.VCF(self.data_path)
58-
assert ds.attrs["vcf_header"] == vcf.raw_header
59-
6055
def test_source(self, ds):
6156
assert ds.attrs["source"] == f"bio2zarr-{provenance.__version__}"
6257

0 commit comments

Comments
 (0)