@@ -572,7 +572,7 @@ def init(
572
572
def encode_samples (self , root ):
573
573
if self .schema .samples != self .icf .metadata .samples :
574
574
raise ValueError ("Subsetting or reordering samples not supported currently" )
575
- array = root .create_dataset (
575
+ array = root .array (
576
576
"sample_id" ,
577
577
data = [sample .id for sample in self .schema .samples ],
578
578
shape = len (self .schema .samples ),
@@ -584,7 +584,7 @@ def encode_samples(self, root):
584
584
logger .debug ("Samples done" )
585
585
586
586
def encode_contig_id (self , root ):
587
- array = root .create_dataset (
587
+ array = root .array (
588
588
"contig_id" ,
589
589
data = [contig .id for contig in self .schema .contigs ],
590
590
shape = len (self .schema .contigs ),
@@ -593,7 +593,7 @@ def encode_contig_id(self, root):
593
593
)
594
594
array .attrs ["_ARRAY_DIMENSIONS" ] = ["contigs" ]
595
595
if all (contig .length is not None for contig in self .schema .contigs ):
596
- array = root .create_dataset (
596
+ array = root .array (
597
597
"contig_length" ,
598
598
data = [contig .length for contig in self .schema .contigs ],
599
599
shape = len (self .schema .contigs ),
@@ -605,7 +605,7 @@ def encode_contig_id(self, root):
605
605
def encode_filter_id (self , root ):
606
606
# TODO need a way to store description also
607
607
# https://github.com/sgkit-dev/vcf-zarr-spec/issues/19
608
- array = root .create_dataset (
608
+ array = root .array (
609
609
"filter_id" ,
610
610
data = [filt .id for filt in self .schema .filters ],
611
611
shape = len (self .schema .filters ),
@@ -955,7 +955,7 @@ def create_index(self):
955
955
kwargs = {}
956
956
if not zarr_v3 ():
957
957
kwargs ["dimension_separator" ] = self .metadata .dimension_separator
958
- array = root .create_dataset (
958
+ array = root .array (
959
959
"region_index" ,
960
960
data = index ,
961
961
shape = index .shape ,
0 commit comments