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