An open framework for spatial omics data#
SpatialData is an open framework for working with uni- and multi-modal spatial omics datasets. It defines a common data model and storage format, supported by software libraries for accessing, manipulating and analyzing spatial omics data in languages including Python, R and JavaScript.
This site documents how to install, use and extend the Python spatialdata library. For language-independent definitions of SpatialData datasets and their on-disk representation, see the SpatialData specifications.
See the links below to learn more about other packages in the SpatialData ecosystem.
spatialdata-io: load data from common spatial omics technologies intospatialdata(repository, documentation).spatialdata-plot: Static plotting library forspatialdata(repository, documentation).napari-spatialdata: napari plugin for interactive exploration and annotation ofspatialdata(repository, documentation).spatialdataR: R implementation of the SpatialData framework (repository).SpatialData.js: JavaScript/TypeScript implementation of the SpatialData framework (repository).
Please see our publication [Marconato et al., 2024] for citation and to learn more.
Note
With dask >= 2025.2.0, users can get an error as described in #1077. While we tried implementing fixes in SpatialData, it can be that
users perform operations on the Points data themselves and get this error. In order to prevent it, users can use a context manager we created.
from spatialdata import disable_dask_tune_optimization
import contextlib
...
with disable_dask_tune_optimization() if data.npartitions > 1 else contextlib.nullcontext():
<your operation on points dask dataframe>
This will disable dask graph optimization if the dataframe has more than 1 partition and otherwise keep it enabled. This solves the problem discussed in this dask issue. We are looking into an upstream fix.
spatialdata is part of the scverse® project (website, governance) and is fiscally sponsored by NumFOCUS. If you like scverse® and want to support our mission, please consider making a tax-deductible donation to help the project pay for developer time, professional services, travel, workshops, and a variety of other needs.
Note
This library is currently under active development. We may make changes to the API between versions as the community provides feedback. To ensure reproducibility, please make note of the version you are developing against.
Learn how to install spatialdata.
Navigate your way through spatialdata tutorials.
Learn how to use spatialdata with hands-on examples.
Find a detailed documentation of spatialdata.
Example datasets from 8 different technologies.
The original design approach behind spatialdata (historical; superseded by the specifications).
Learn how to contribute to spatialdata.