Skip to content

Commit 4f532ee

Browse files
Added format_version to JSON config files
1 parent 56fbbab commit 4f532ee

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

bio2zarr/vcf.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ class VcfPartition:
135135

136136
@dataclasses.dataclass
137137
class VcfMetadata:
138+
format_version: str
138139
samples: list
139140
contig_names: list
140141
filters: list
@@ -179,6 +180,7 @@ def make_field_def(name, vcf_type, vcf_number):
179180
return fields
180181

181182

183+
# TODO refactor this to use the ProcessPoolExecutor, and the IndexedVCF class
182184
def scan_vcfs(paths, show_progress, target_num_partitions):
183185
partitions = []
184186
vcf_metadata = None
@@ -214,6 +216,8 @@ def scan_vcfs(paths, show_progress, target_num_partitions):
214216
contig_names=vcf.seqnames,
215217
filters=filters,
216218
fields=fields,
219+
# FIXME do something systematic with this
220+
format_version="0.1"
217221
)
218222
try:
219223
metadata.contig_lengths = vcf.seqlens
@@ -976,6 +980,7 @@ def __post_init__(self):
976980

977981
@dataclasses.dataclass
978982
class ZarrConversionSpec:
983+
format_version: str
979984
chunk_width: int
980985
chunk_length: int
981986
dimensions: list
@@ -1152,6 +1157,8 @@ def fixed_field_spec(
11521157
)
11531158

11541159
return ZarrConversionSpec(
1160+
# TODO do something systematic
1161+
format_version="0.1",
11551162
chunk_width=chunk_width,
11561163
chunk_length=chunk_length,
11571164
columns={col.name: col for col in colspecs},

0 commit comments

Comments
 (0)