Abstract
Spatial omics data are advancing the study of tissue organization and cellular communication at an unprecedented scale. Here, we present Squidpy, a Python framework that brings together tools from omics and image analysis to enable scalable description of spatial molecular data, such as transcriptome or multivariate proteins. Squidpy provides both infrastructure and numerous analysis methods that allow to efficiently store, manipulate and interactively visualize spatial omics data.
Introduction
The "spatial omics" revolution is currently generating massive datasets that reveal not just the molecular activity of a cell (its gene or protein expression), but its precise location within a tissue. However, researchers have faced a major hurdle: software fragmentation. Existing tools often focus either on the "omics" side (gene expression matrices) or the "image" side (histology/fluorescence microscopy), but rarely both. Furthermore, as datasets grow to include hundreds of thousands of cells and gigapixel images, many current tools struggle with memory and speed.
Squidpy addresses these challenges by providing a scalable, technology-agnostic infrastructure that treats spatial coordinates, molecular profiles, and tissue images as a single, integrated unit.
Methods and Infrastructure
Squidpy is built on top of the popular single-cell analysis ecosystem in Python, specifically Scanpy and AnnData. Its core innovations lie in two main data representations:
- The Spatial Graph: Instead of treating cells as isolated points, Squidpy builds a neighborhood graph based on spatial coordinates. This graph serves as the foundation for spatial statistics, such as identifying "neighborhood enrichment" (which cell types hang out together) or calculating "centrality scores."
- The ImageContainer: This is a specialized object for handling large-scale microscopy images. It uses "lazy loading" (via
xarray,dask, andrasterio), meaning it only loads the parts of an image needed for a specific calculation. This allows it to process images that are far too large to fit into a computer's RAM.
Squidpy also integrates with napari, a multi-dimensional image viewer, allowing researchers to interactively visualize and manually annotate their data in a way that is directly linked to the underlying molecular analysis.
Key Results and Biological Insights
The authors demonstrated Squidpy’s versatility across several diverse spatial technologies, including seqFISH, 4i, Visium, and Imaging Mass Cytometry (IMC).
Biological Recapitulation
In a mouse gastrulation dataset (seqFISH), Squidpy successfully identified known cell-type proximities, such as the co-enrichment of "Lateral plate mesoderm" with "Allantois," validating the framework's accuracy in capturing tissue architecture.
Subcellular Precision and Image-Omics Correlation
Using the 4i dataset, the authors showed that Squidpy could quantify the co-occurrence of organelles (like the Nucleolus within the Nucleus) at increasing distance thresholds. Furthermore, in the mouse brain (Visium), the authors found a 77% overlap between clusters defined by image features (histology) and clusters defined by gene expression in the hippocampus. This proves that the visual morphology of tissue is deeply linked to its molecular state.
Scalability
By leveraging the Python data science stack (Dask, Numba), Squidpy achieves significant speedups. For example, its neighborhood enrichment analysis is roughly 10 times faster than previous state-of-the-art implementations like Giotto.
Discussion and Future Directions
While Squidpy is a massive leap forward, there are areas for growth. Currently, it relies on external tools for the initial alignment (registration) of images to molecular data. While it supports custom deep learning feature extraction, future versions will likely include more native, pre-trained models for automated tissue segmentation. Additionally, while the infrastructure handles multi-dimensional data, expanding the suite of 3D-specific spatial statistics is a natural next step.
Squidpy represents a significant shift toward a more unified, scalable, and user-friendly ecosystem for the next generation of tissue biology, bridging the gap between pixels and phenotypes.
Summary updated