@@ -572,7 +572,7 @@ def init(
572572 def encode_samples (self , root ):
573573 if self .schema .samples != self .icf .metadata .samples :
574574 raise ValueError ("Subsetting or reordering samples not supported currently" )
575- array = root .create_dataset (
575+ array = root .array (
576576 "sample_id" ,
577577 data = [sample .id for sample in self .schema .samples ],
578578 shape = len (self .schema .samples ),
@@ -584,7 +584,7 @@ def encode_samples(self, root):
584584 logger .debug ("Samples done" )
585585
586586 def encode_contig_id (self , root ):
587- array = root .create_dataset (
587+ array = root .array (
588588 "contig_id" ,
589589 data = [contig .id for contig in self .schema .contigs ],
590590 shape = len (self .schema .contigs ),
@@ -593,7 +593,7 @@ def encode_contig_id(self, root):
593593 )
594594 array .attrs ["_ARRAY_DIMENSIONS" ] = ["contigs" ]
595595 if all (contig .length is not None for contig in self .schema .contigs ):
596- array = root .create_dataset (
596+ array = root .array (
597597 "contig_length" ,
598598 data = [contig .length for contig in self .schema .contigs ],
599599 shape = len (self .schema .contigs ),
@@ -605,7 +605,7 @@ def encode_contig_id(self, root):
605605 def encode_filter_id (self , root ):
606606 # TODO need a way to store description also
607607 # https://github.com/sgkit-dev/vcf-zarr-spec/issues/19
608- array = root .create_dataset (
608+ array = root .array (
609609 "filter_id" ,
610610 data = [filt .id for filt in self .schema .filters ],
611611 shape = len (self .schema .filters ),
@@ -955,7 +955,7 @@ def create_index(self):
955955 kwargs = {}
956956 if not zarr_v3 ():
957957 kwargs ["dimension_separator" ] = self .metadata .dimension_separator
958- array = root .create_dataset (
958+ array = root .array (
959959 "region_index" ,
960960 data = index ,
961961 shape = index .shape ,
0 commit comments