@@ -17,8 +17,7 @@ def encode_genotypes_slice(bed_path, zarr_path, start, stop):
17
17
# the correct approach is, but it is important to note that the
18
18
# 0th allele is *not* necessarily the REF for these datasets.
19
19
bed = bed_reader .open_bed (bed_path , num_threads = 1 , count_A1 = False )
20
- store = zarr .DirectoryStore (zarr_path )
21
- root = zarr .group (store = store )
20
+ root = zarr .open (store = zarr_path , mode = "a" )
22
21
gt = core .BufferedArray (root ["call_genotype" ], start )
23
22
gt_mask = core .BufferedArray (root ["call_genotype_mask" ], start )
24
23
gt_phased = core .BufferedArray (root ["call_genotype_phased" ], start )
@@ -73,8 +72,7 @@ def convert(
73
72
if variants_chunk_size is None :
74
73
variants_chunk_size = 10_000
75
74
76
- store = zarr .DirectoryStore (zarr_path )
77
- root = zarr .group (store = store , overwrite = True )
75
+ root = zarr .open (store = zarr_path , mode = "w" )
78
76
79
77
ploidy = 2
80
78
shape = [m , n ]
@@ -171,8 +169,7 @@ def convert(
171
169
# FIXME do this more efficiently - currently reading the whole thing
172
170
# in for convenience, and also comparing call-by-call
173
171
def validate (bed_path , zarr_path ):
174
- store = zarr .DirectoryStore (zarr_path )
175
- root = zarr .group (store = store )
172
+ root = zarr .open (store = zarr_path , mode = "r" )
176
173
call_genotype = root ["call_genotype" ][:]
177
174
178
175
bed = bed_reader .open_bed (bed_path , count_A1 = False , num_threads = 1 )
0 commit comments