@@ -571,7 +571,7 @@ def init(
571571 def encode_samples (self , root ):
572572 if self .schema .samples != self .icf .metadata .samples :
573573 raise ValueError ("Subsetting or reordering samples not supported currently" )
574- array = root .create_dataset (
574+ array = root .array (
575575 "sample_id" ,
576576 data = [sample .id for sample in self .schema .samples ],
577577 shape = len (self .schema .samples ),
@@ -583,7 +583,7 @@ def encode_samples(self, root):
583583 logger .debug ("Samples done" )
584584
585585 def encode_contig_id (self , root ):
586- array = root .create_dataset (
586+ array = root .array (
587587 "contig_id" ,
588588 data = [contig .id for contig in self .schema .contigs ],
589589 shape = len (self .schema .contigs ),
@@ -592,7 +592,7 @@ def encode_contig_id(self, root):
592592 )
593593 array .attrs ["_ARRAY_DIMENSIONS" ] = ["contigs" ]
594594 if all (contig .length is not None for contig in self .schema .contigs ):
595- array = root .create_dataset (
595+ array = root .array (
596596 "contig_length" ,
597597 data = [contig .length for contig in self .schema .contigs ],
598598 shape = len (self .schema .contigs ),
@@ -604,7 +604,7 @@ def encode_contig_id(self, root):
604604 def encode_filter_id (self , root ):
605605 # TODO need a way to store description also
606606 # https://github.com/sgkit-dev/vcf-zarr-spec/issues/19
607- array = root .create_dataset (
607+ array = root .array (
608608 "filter_id" ,
609609 data = [filt .id for filt in self .schema .filters ],
610610 shape = len (self .schema .filters ),
@@ -954,7 +954,7 @@ def create_index(self):
954954 kwargs = {}
955955 if not zarr_v3 ():
956956 kwargs ["dimension_separator" ] = self .metadata .dimension_separator
957- array = root .create_dataset (
957+ array = root .array (
958958 "region_index" ,
959959 data = index ,
960960 shape = index .shape ,
0 commit comments