4
4
import tqdm
5
5
import zarr
6
6
7
+ from bio2zarr .zarr_utils import first_dim_iter
8
+
7
9
from .. import constants
8
10
9
11
@@ -152,7 +154,7 @@ def verify(vcf_path, zarr_path, show_progress=False):
152
154
vid = root ["variant_id" ][:]
153
155
call_genotype = None
154
156
if "call_genotype" in root and root ["call_genotype" ].size > 0 :
155
- call_genotype = iter (root ["call_genotype" ])
157
+ call_genotype = first_dim_iter (root ["call_genotype" ])
156
158
157
159
vcf = cyvcf2 .VCF (vcf_path )
158
160
format_headers = {}
@@ -170,12 +172,16 @@ def verify(vcf_path, zarr_path, show_progress=False):
170
172
vcf_name = colname .split ("_" , 1 )[1 ]
171
173
vcf_type = format_headers [vcf_name ]["Type" ]
172
174
vcf_number = format_headers [vcf_name ]["Number" ]
173
- format_fields [vcf_name ] = vcf_type , vcf_number , iter (root [colname ])
175
+ format_fields [vcf_name ] = (
176
+ vcf_type ,
177
+ vcf_number ,
178
+ first_dim_iter (root [colname ]),
179
+ )
174
180
if colname .startswith ("variant" ):
175
181
name = colname .split ("_" , 1 )[1 ]
176
182
if name .isupper ():
177
183
vcf_type = info_headers [name ]["Type" ]
178
- info_fields [name ] = vcf_type , iter (root [colname ])
184
+ info_fields [name ] = vcf_type , first_dim_iter (root [colname ])
179
185
180
186
first_pos = next (vcf ).POS
181
187
start_index = np .searchsorted (pos , first_pos )
0 commit comments