spatialdata-db: spatial omics datasets as SpatialData#

spatialdata-db is a catalog of public spatial omics datasets, from Visium and Xenium to MERSCOPE, CosMx and mass spectrometry imaging. Each dataset is converted to a SpatialData Zarr store, described by one row of the catalog and registered in the Lamin instance scverse/spatialdata-db. The catalog of 2026-10-31 holds 7575 datasets from 13 technologies. You can browse every dataset and collection on the website.

This Python client queries the catalog by technology, tissue, organism, gene or free text and loads the datasets you pick as SpatialData objects. It builds cohorts of datasets that you can freeze, split by study and turn into training data, and it collects the citations of the studies they come from. The sddb-cli command and the sddb-mcp server give the shell and AI agents the same queries and downloads.

A grid of twelve tissue thumbnails, each labelled with its technology
The 12 largest technologies in the catalog, one dataset each.

Installation#

pip install "spatialdata-db @ git+https://github.com/theislab/spatialdata-db-client@v0.1.2"
uv pip install "spatialdata-db @ git+https://github.com/theislab/spatialdata-db-client@v0.1.2"

This installs the alpha release, v0.1.2. The main branch may be ahead of it, and you get the newest code if you leave out @v0.1.2.

The client needs Python 3.12 or newer. It is not on PyPI yet, so install it from GitHub.

Quick example#

from sddb import Catalog

hits = Catalog().query(technology="Visium", tissue="lung")
hits.summary()
smallest = min(hits, key=lambda ds: ds.size_bytes)
sdata = smallest.to_sdata()  # about 7 MB, copied to the local cache once

Guides and reference#

From the website

Load a dataset or collection you found on the website.

From the website to Python
Find and load

Filter by facets or free text, then load what you pick.

Find and load datasets
Cohorts

Combine datasets, freeze exact versions and split by study.

Build, freeze and split cohorts
Machine learning

Load one table from many stores and train on a split.

Use cohorts for machine learning
CLI and agents

Query, download and cite from the shell or an AI agent.

Command line and agents
API reference

Every public class and function, with its parameters.

API reference

Cite and license#

The paper that describes the database is forthcoming. Until then, cite the studies behind the data you use: cohort.citations() writes their BibTeX entries, and sddb-cli cite does the same from the shell. Each dataset keeps the license of its source, and Cite and license explains how to check and filter by license.