@@ -292,17 +292,17 @@ def c_chunk_to_vcf(
292
292
drop_genotypes ,
293
293
no_update ,
294
294
):
295
- chrom = contigs [get_vchunk_array (root . variant_contig , v_chunk , v_mask_chunk )]
295
+ chrom = contigs [get_vchunk_array (root [ " variant_contig" ] , v_chunk , v_mask_chunk )]
296
296
# TODO check we don't truncate silently by doing this
297
- pos = get_vchunk_array (root . variant_position , v_chunk , v_mask_chunk ).astype (
297
+ pos = get_vchunk_array (root [ " variant_position" ] , v_chunk , v_mask_chunk ).astype (
298
298
np .int32
299
299
)
300
- id = get_vchunk_array (root . variant_id , v_chunk , v_mask_chunk ).astype ("S" )
301
- alleles = get_vchunk_array (root . variant_allele , v_chunk , v_mask_chunk )
300
+ id = get_vchunk_array (root [ " variant_id" ] , v_chunk , v_mask_chunk ).astype ("S" )
301
+ alleles = get_vchunk_array (root [ " variant_allele" ] , v_chunk , v_mask_chunk )
302
302
ref = alleles [:, 0 ].astype ("S" )
303
303
alt = alleles [:, 1 :].astype ("S" )
304
- qual = get_vchunk_array (root . variant_quality , v_chunk , v_mask_chunk )
305
- filter_ = get_vchunk_array (root . variant_filter , v_chunk , v_mask_chunk )
304
+ qual = get_vchunk_array (root [ " variant_quality" ] , v_chunk , v_mask_chunk )
305
+ filter_ = get_vchunk_array (root [ " variant_filter" ] , v_chunk , v_mask_chunk )
306
306
307
307
num_variants = len (pos )
308
308
if len (id .shape ) == 1 :
@@ -313,7 +313,7 @@ def c_chunk_to_vcf(
313
313
format_fields = {}
314
314
info_fields = {}
315
315
num_samples = len (samples_selection ) if samples_selection is not None else None
316
- for name , array in root .items ():
316
+ for name , array in root .arrays ():
317
317
if (
318
318
name .startswith ("call_" )
319
319
and not name .startswith ("call_genotype" )
@@ -417,7 +417,8 @@ def _generate_header(ds, original_header, sample_ids, *, no_version: bool = Fals
417
417
# GT must be the first field if present, per the spec (section 1.6.2)
418
418
format_fields .append ("GT" )
419
419
420
- for var , arr in ds .items ():
420
+ for var in sorted (ds .keys ()):
421
+ arr = ds [var ]
421
422
if (
422
423
var .startswith ("variant_" )
423
424
and not var .endswith ("_fill" )
0 commit comments