Add support for spatial tiling of vector data to SpatialData #1251
Replies: 2 comments 2 replies
|
Thanks again @cornhundred for starting the discussion. I'll start with a comment on the 4th point. Expression matrixI agree. Like you, I also think that storing the csc matrix as an additional layer would be beneficial. Another argument in favor of adding the csc representation comes from workflows for Visium HD, Stereoseq, or other similar data. See for example our Visium HD notebook (you can search for Another place where such request was advanced is in this Zulip thread (point 3): #data-structures > anndata storage conventions @ 💬. Philipp seems to be supportive as well. I'd be good to coordinate with Philipp and Ilan and even upstream this convention to |
|
Can you elaborate further on the spatial tiling and the required metadata? Does the parquet standard allow each row group to be a different size? What is the advantage or disadvantage of using row groups vs. multi-part parquet files (should we use one or the other or both to achieve the spatial tiling, or is there any impact/consequence on the multi-part parquet usage that SpatialData currently does)? |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
We have been thinking about spatial tiling approaches to make SpatialData objects compatible with a visualization scheme that loads tiled data at high zoom levels to enable visual exploration of large datasets (e.g., >1B transcripts), as we do with our Celldega front end (https://broadinstitute.github.io/celldega/). We have also had some initial discussions along these lines in a previous hackathon (2025-03 hackathon owkin > TileJSON for SpatialData/OMENGFF @ 💬), have read about recent work from the scverse (https://osf.io/preprints/biohackrxiv/s6bph_v1), and have reached out on a Zulip chat.
Based on our testing we have a minimal set of proposed changes to the SpatialData specification that appears to work well with our visualization spatial tiling approach. We would like to get feedback from the SpatialData community on whether this approach might make sense generally for SpatialData.
Proposed SpatialData storage/schema changes and Celldega compatibility demo
The SpatialData logical model is unchanged: the store still contains standard images, points, shapes, and an AnnData table and can be opened with
spatialdata.read_zarr. The proposal changes or more narrowly specifies parts of their on-disk representation to support efficient visualization.spatial_tilingmetadata (zarr.json).xandycolumns; no projection-oriented physical column order is prescribed.x,y, andfeature_name) first (for more efficient parquet_wasm column projection/filtering -note this is demonstrated with this unmerged pull request fix kylebarron/parquet-wasm#811)update this pull request has been merged.geoarrow.polygoncolumns so Arrow-compatible clients can read them without decoding WKB.Xmatrix and add the equivalent CSC matrix aslayers["X_csc"]for efficient access to individual genes.The column ordering, GeoArrow encoding, and CSC layer use capabilities already available in the underlying formats. The new convention introduced by this POC is the shared spatial tile and Parquet row-group mapping.
Please see
Please see this repo for a Claude-coded proof-of-concept set of modifications to SpatialData-io in order to produce this new specification: scverse/spatialdata-io#423 [note that this functionality would need to be moved into SpatialData in order to provide general support for spatial transcriptomics technologies]
@jaspreetishar @LucaMarconato @keller-mark
All reactions