Skip to content

Don't store original VCF header in vcz #367

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
10 changes: 2 additions & 8 deletions bio2zarr/icf.py
Original file line number Diff line number Diff line change
Expand Up @@ -891,8 +891,6 @@ def __init__(self, path):
# directory is either a WIP or the wrong format.
with open(self.path / "metadata.json") as f:
self.metadata = IcfMetadata.fromdict(json.load(f))
with open(self.path / "header.txt") as f:
self.vcf_header = f.read()
self.compressor = numcodecs.get_codec(self.metadata.compressor)
self.fields = {}
partition_num_records = [
Expand Down Expand Up @@ -970,9 +968,7 @@ def num_fields(self):

@property
def root_attrs(self):
return {
"vcf_header": self.vcf_header,
}
return {}

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

self.mkdirs()

# Note: this is needed for the current version of the vcfzarr spec, but it's
# probably going to be dropped.
# Note: the header is no longer stored in vcz, but keep in icf.
# https://github.com/pystatgen/vcf-zarr-spec/issues/15
# May be useful to keep lying around still though?
logger.info("Writing VCF header")
with open(self.path / "header.txt", "w") as f:
f.write(header)
Expand Down
5 changes: 0 additions & 5 deletions tests/test_vcf_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import pathlib
import re

import cyvcf2
import numpy as np
import numpy.testing as nt
import pytest
Expand Down Expand Up @@ -53,10 +52,6 @@ def test_filters(self, ds):
],
)

def test_header(self, ds):
vcf = cyvcf2.VCF(self.data_path)
assert ds.attrs["vcf_header"] == vcf.raw_header

def test_source(self, ds):
assert ds.attrs["source"] == f"bio2zarr-{provenance.__version__}"

Expand Down