Skip to content

Commit b457767

Browse files
Remove unneeded vcf open
1 parent 2db6304 commit b457767

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bio2zarr/vcf_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,8 @@ def __init__(self, vcf_path, index_path=None):
378378
index_path = vcf_path.with_suffix(vcf_path.suffix + ".csi")
379379
if not index_path.exists():
380380
raise FileNotFoundError(
381-
"Cannot find .tbi or .csi file for {vcf_path}")
381+
"Cannot find .tbi or .csi file for {vcf_path}"
382+
)
382383
else:
383384
index_path = pathlib.Path(index_path)
384385

@@ -405,8 +406,7 @@ def __init__(self, vcf_path, index_path=None):
405406
self.file_type = "vcf"
406407
self.sequence_names = self.index.parse_vcf_aux()
407408
else:
408-
with contextlib.closing(cyvcf2.VCF(vcf_path)) as vcf:
409-
self.sequence_names = vcf.seqnames
409+
self.sequence_names = self.vcf.seqnames
410410
else:
411411
self.index = read_tabix(self.index_path)
412412
self.sequence_names = self.index.sequence_names

0 commit comments

Comments
 (0)