Skip to content

Read existing SpatialData stores in the workflow - #31

Merged
sminot merged 1 commit into
mainfrom
spatialdata-store-input
Nov 30, 2026
Merged

sminot merged 1 commit into
mainfrom
spatialdata-store-input

Conversation

@sminot

@sminot sminot commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator

Add a spatialdata data type so the workflow takes a store another program wrote (an instrument's own .zarr.zip export, spatialdata-io output) and publishes it as a checkpoint the viewer opens. Nothing is specific to one vendor; the motivating case is an Element Cytos export whose points are 72 GB of a 111 GB zip, whose cell table does not sort first, whose obsm['spatial'] is an X/Y data frame, and whose wells each carry their own coordinate origin.

The catalog's detect gains name, so a file can be a dataset; cirro-studio/src/data/discover.ts reads the same catalog and has to honour it, or every folder matches the new type. The importer gains selection and table, and stitches region-local coordinates into obsm['spatial_<system>'] only when they fit their regions as local ones and not as world ones.

Other:

  • Reloading a checkpoint restores the sidecar's first table. spatialdata reads tables back sorted by name, so a checkpoint whose open table did not sort first opened on a different table in the Studio than in the viewer.
  • cli.py passes the input under the reader's own path param (store for the importer, not path).
  • test_cli.py builds its own store for the new path, so it runs without fixtures. test_e2e.py passes locally, with the Xenium-backed flows (including zarr-import) skipped for want of their fixtures.

🤖 Generated with Claude Code

Add a `spatialdata` catalog type, recognised by name (`*.zarr.zip`, `*.zarr`), so a
store another program wrote is a dataset of its own. Discovery gains `detect.name`,
which lets a file be a candidate; the web app's catalog matcher honours it too.

The importer gains `selection` (points are left out and not unpacked) and `table`
(the table to open on, exposed as the workflow's `--table` through the new
`reader_params_from`), converts a data-frame `obsm['spatial']` to an array, and
stitches region-local coordinates of a multi-region table into
`obsm['spatial_<system>']` when the data shows they are local. A reload restores the
sidecar's first table, since spatialdata reads tables back sorted by name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sminot
sminot marked this pull request as ready for review November 30, 2026 19:27
@sminot
sminot merged commit 3e6aa15 into main Nov 30, 2026
11 checks passed
@sminot
sminot deleted the spatialdata-store-input branch November 30, 2026 19:27
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.

1 participant