Skip to content

Accept zipped zarr stores as an input for spatialdata.read_zarr(). Must also have ome-zarr-py ZarrLocation changes.#1141

Open
pennycuda wants to merge 3 commits into
scverse:mainfrom
hubmapconsortium:pennycuda/zip-zarr-io
Open

Accept zipped zarr stores as an input for spatialdata.read_zarr(). Must also have ome-zarr-py ZarrLocation changes.#1141
pennycuda wants to merge 3 commits into
scverse:mainfrom
hubmapconsortium:pennycuda/zip-zarr-io

Conversation

@pennycuda
Copy link
Copy Markdown

@pennycuda pennycuda commented Jun 3, 2026

This branch introduces functionality to allow zipped zarr stores as an input for the read_zarr() function. It will only work with changes to ome-zarr-py's ZarrLocation class made in the following PR:
ome/ome-zarr-py#587

This was motivated by HuBMAP Consortium's desire to reduce the number of files in our filesystem while maintaining our requirement that our output files be easily readable by our users. HuBMAP has already built other infrastructure to support zipped zarr stores for AnnData objects as well.

Please let me know what changes I need to make to get this PR merged; I am happy to work with you all!

@pennycuda
Copy link
Copy Markdown
Author

Hi again! I got an update from @will-moore this morning that ome-zarr is preparing to fully deprecate io.py and parse_url() with this PR that is close to merging: ome/ome-zarr-py#515
That PR introduces a new API for reading and writing, so I am going to test that out to see if it can work with zipped stores.
Thanks!

@keller-mark
Copy link
Copy Markdown
Contributor

Hi, wanted to chime in to voice my support for the Zipped zarr directory use case as another member of the HuBMAP consortium. For further background, Vitessce, which is used by HuBMAP for visualization purposes, also supports reading Zipped AnnData objects, OME-Zarr images, and SpatialData objects (code).

@pennycuda , I also wonder whether the open pull request at #1107 will resolve the ZipStore usage issues already (once it is finalized/merged). It seems to generalize the function signature of sd.read_zarr to accept any zarr.storage.StoreLike instance, which would presumably include ZipStore instances

Screenshot 2026-06-04 at 10 35 20 AM

(Another related point to mention is the OME-Zarr proposal called RFC-9 to define a new .ozx file extension for zipped OME-Zarr images specifically)

@pennycuda
Copy link
Copy Markdown
Author

pennycuda commented Jun 4, 2026

Thanks @keller-mark for your support! I will look at that PR as well and test to see if any changes need to be made for it to read zipped zarr stores as well. I also read about the .ozx suffix when doing research for this effort, and I am interested to see where that goes.
Edit to add: I did test #1107 and it cannot read zipped stores as it is right now, but I am happy to apply my updates to that branch since it is closer to being ready to merge. The branch in #1107 does use ome-zarr-py's IO methods which will be deprecated as @will-moore mentioned in ome/ome-zarr-py#515 , but I can apply those changes as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants