Abstract
Spatially resolved omics technologies are transforming our understanding of biological tissues. However, handling uni- and multi-modal spatial omics datasets remains a challenge owing to large volumes of data, heterogeneous data types and the lack of unified spatially-aware data structures. Here, we introduce SpatialData, a framework that establishes a unified and extensible multi-platform file-format, lazy representation of larger-than-memory data, transformations, and alignment to common coordinate systems. SpatialData facilitates spatial annotations and cross-modal aggregation and analysis, the utility of which is illustrated via multiple vignettes, including integrative analysis on a multi-modal Xenium and Visium breast cancer study.
Introduction
Biological tissues are inherently complex, and spatial omics technologies aim to map this complexity by measuring molecular activity—such as gene expression—while preserving the physical location of those molecules. Despite the rapid advancement of these technologies, the field is currently hampered by a "data silo" problem. Researchers struggle with massive data volumes (often exceeding RAM capacity), extreme heterogeneity in data types (raster images, segmentation masks, and tabular sequencing data), and the difficulty of aligning datasets from different platforms (e.g., 10x Genomics Visium vs. Xenium).
SpatialData addresses these challenges by providing a unified "language" for spatial data, bridging the gap between high-resolution image processing and molecular analysis.
The SpatialData Framework
The framework is built upon two main pillars: a standardized storage format and a comprehensive Python library.
Standardized Storage and Data Primitives
SpatialData utilizes a storage format built on OME-NGFF and Zarr. This "cloud-native" approach supports lazy loading, allowing the software to read only the specific "chunks" of data required for a given task. This is critical for handling high-resolution microscopy images that can reach hundreds of gigabytes.
To represent the diversity of spatial omics data, the framework defines five basic primitives:
- Images: Raster data representing pixel intensities.
- Labels: Segmentation masks identifying specific objects like cells or nuclei.
- Points: Individual molecular detections (e.g., single transcripts).
- Shapes: Regions of interest or capture spots (e.g., Visium spots).
- Tables: Molecular quantifications and metadata associated with spatial elements.
Coordinate Systems and Transformations
A core innovation of SpatialData is treating coordinate systems as first-class citizens. Every data element can be assigned to one or more coordinate systems. The library supports affine transformations—such as translation, scaling, and rotation—which are stored as metadata. This allows different assays to be virtually aligned without the need to rewrite or duplicate the raw data, facilitating reproducible and scalable multi-modal integration.
Ecosystem Integration and Deep Learning
The SpatialData library is designed to integrate seamlessly with the broader scverse ecosystem, including popular tools like Scanpy and Squidpy. Furthermore, it provides a dedicated PyTorch Dataset class, simplifying the data engineering required to feed spatially-aligned data directly into deep learning models. This enables advanced tasks such as predicting cell types or gene expression directly from image tiles.
Validation and Results
The authors validated the framework through several complex biological scenarios, most notably a multi-modal breast cancer study. By aligning two Xenium replicates and one Visium slide into a shared coordinate space using landmark points, they demonstrated:
- High Concordance: Cell type fractions calculated from Xenium data showed a Pearson correlation of R = 0.75 between replicates.
- Cross-Platform Validation: Comparing gene expression between Xenium and Visium at identical spatial locations yielded a correlation of R = 0.48, with significantly higher agreement for highly expressed genes.
Additionally, the framework was used to map 12 Visium slides from a prostate cancer study onto a single global reference layout and to create a standardized collection of 42 fields of view from 7 different technologies.
Conclusion and Future Directions
SpatialData represents a major step toward standardizing spatial omics data. By providing a robust, scalable, and spatially-aware framework, it empowers researchers to move beyond data silos toward integrated, multi-modal tissue analysis. Future development aims to extend interoperability to the R/Bioconductor community, support more complex multiscale geometries, and enhance cloud-native visualization through tools like Vitessce.
Summary updated