Skip to content

Commit

Permalink
bug-fix zarr root group heirarchy
Browse files Browse the repository at this point in the history
  • Loading branch information
meyerkm committed Dec 7, 2023
1 parent 83cf2fb commit 49c6a8b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions deeprvat/deeprvat/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,8 @@ def __init__(
self.cache_tensors = cache_tensors
if self.cache_tensors:
self.zarr_root = zarr.group()
self.input_tensor_zroot = self.zarr_root.create_group("input_tensor")
self.common_variants_zroot = self.zarr_root.create_group("common_variants")
elif temp_dir is not None:
temp_path = Path(resolve_path_with_env(temp_dir)) / "deeprvat_training"
temp_path.mkdir(parents=True, exist_ok=True)
Expand All @@ -387,21 +389,21 @@ def __init__(
if self.cache_tensors:
zarr.copy(
pheno_data["input_tensor_zarr"],
self.zarr_root,
self.input_tensor_zroot,
name=pheno,
chunks=(self.chunksize, None, None, None),
compressor=Blosc(clevel=1),
)
pheno_data["input_tensor_zarr"] = self.zarr_root[pheno]
pheno_data["input_tensor_zarr"] = self.input_tensor_zroot[pheno]
# pheno_data["input_tensor"] = pheno_data["input_tensor_zarr"][:]
zarr.copy(
pheno_data["common_variants"],
self.zarr_root,
self.common_variants_zroot,
name=pheno,
chunks=(self.chunksize, None),
compressor=Blosc(clevel=1),
)
pheno_data["common_variants"] = self.zarr_root[pheno]
pheno_data["common_variants"] = self.common_variants_zroot[pheno]
elif temp_dir is not None:
tensor_path = (
Path(self.input_tensor_dir.name) / pheno / "input_tensor.zarr"
Expand Down

0 comments on commit 49c6a8b

Please sign in to comment.