henhaobio
Sign in

Abstract

Spatial omics data are advancing the study of tissue organization and cellular communication at an unprecedented scale. Flexible tools are required to store, integrate and visualize the large diversity of spatial omics data. 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 efficient infrastructure and numerous analysis methods that allow to efficiently store, manipulate and interactively visualize spatial omics data. Squidpy is extensible and can be interfaced with a variety of already existing libraries for the scalable analysis of spatial omics data.

In-depth summary

Claude Opus 5.5 · max effort · 8 Nov 2026 · from the full text of version 2 (29 Apr 2021) · CC BY 4.0

Squidpy extends Scanpy/AnnData with spatial neighbor graphs and a lazy-loading image container, enabling spatial statistics, ligand-receptor tests, image features, and ~10-fold faster neighborhood enrichment than Giotto.

Spatial omics technologies vary in resolution, multiplexing, molecular modality, and whether a tissue image is captured, and existing frameworks cover either preprocessing or a single analysis facet without a shared data model, so users cannot, for example, combine stlearn's image analysis with Giotto's spatial statistics. Squidpy supplies common graph and image representations with modular analysis and interactive visualization inside the Scanpy ecosystem.

Key results

  1. ShownNeighborhood enrichment and spatial graph construction ran faster than Giotto's equivalents, and the tiled, parallelizable image feature workflow scaled to very large images.

    Enrichment ~10-fold faster than Giotto; Squidpy faster for graph building and enrichment on all four benchmark datasets at increasing observation counts (means of 10 runs, but Giotto's 4i enrichment run once; 4-core Intel Core i5, 16 GB RAM, serial). Feature extraction time fell linearly with more cores, supporting images >400M pixels. · Squidpy enables calculation of spatial cellular…; Squidpy allows analysis of images in spatial…; Image features; Figure legends

  2. ShownPermutation-based neighborhood enrichment recovered published cluster adjacencies in seqFISH mouse gastrulation data, and the distance-resolved co-occurrence score captured expected subcellular compartment proximity in 4i HeLa data.

    seqFISH (mouse): Lateral plate mesoderm co-enriched with Allantois and Intermediate mesoderm, Endothelium with Haematoendothelial progenitors, matching the original study (1,000 permutations by default). 4i HeLa cells (~270,000 pixels): nuclear pixels co-occur at short range with Nucleus and Nuclear envelope clusters (conditioning cluster named Nucleolus in the legend). · Squidpy enables calculation of spatial cellular…; Neighborhood enrichment test; Figure legends

  3. SuggestedImage-derived features add tissue information to Visium spots: DAPI-based nuclei counts delineate the cell-dense hippocampal pyramidal layer, and H&E summary-feature clusters match some gene-expression domains but diverge in cortex.

    Mouse fluorescence Visium: nuclei counts resolve the pyramidal layer that gene clustering merges into one Hippocampus cluster. Mouse H&E Visium: main text gives hippocampus 77% and hypothalamus 54% overlap with image cluster 10, no cortex overlap >33%; legend instead pairs Hypothalamus_1 77% with cluster 8, Hippocampus 54% with cluster 10. ResNet: Thalamus_2 88% in cluster 2. · Squidpy allows analysis of images in spatial…; Figure legends

  4. SuggestedA Numba-compiled re-implementation of the CellPhoneDB permutation test uses Omnipath annotations and can average complex subunits instead of taking their minimum, recovering more ligand-receptor interactions in two test datasets.

    Omnipath merges the CellPhoneDB database with 5 other resources; null distribution from 1000 permutations by default. Omnipath recovered a higher number of interactions for paul15 (mouse) and pbmc3k (human); runtime was profiled against gene number on a human forebrain development dataset (32-core, 128 GB Centos 8 cluster). · Squidpy enables calculation of spatial cellular…; Ligand-receptor interaction analysis; Figure legends

  5. SuggestedOn Imaging Mass Cytometry of breast cancer biopsies, Ripley's K, co-occurrence, neighborhood enrichment, and group centralities produced interpretable descriptions of cell-type spatial organization.

    Ripley's K showed no clear pattern apart from mild clustering of basal CK tumor cells, which co-occurred slightly with small elongated stromal cells; immune subsets and stromal cells formed closer neighborhoods than tumor cells; apoptotic tumor cells, the most abundant and widespread label, had high closeness and degree centrality. · Squidpy enables calculation of spatial cellular…; Figure legends

Methods, data and reproducibility

Squidpy builds spatial neighbor graphs (hexagonal rings, kNN, or radius) and a lazy xarray/Dask Image Container for tissue images linked to AnnData, then computes permutation-tested neighborhood enrichment and ligand-receptor scores, co-occurrence, Moran's I, Ripley's K, and centralities, plus Scikit-image segmentation and image features viewable in Napari.

  • seqFISH mouse gastrulation dataset (previously published) used to test neighborhood enrichment · mouse · figshare 10.6084/m9.figshare.c.5273297.v1 (pre-processed collection)
  • 4i imaging of HeLa cells with pixels used as subcellular observations for cluster co-occurrence; also a runtime benchmark dataset · HeLa cell line (species not stated) · n = ~270,000 pixels · figshare 10.6084/m9.figshare.c.5273297.v1 (pre-processed collection)
  • Visium mouse brain section with H&E image: gene clusters vs image summary-feature and ResNet clusters; Moran's I (Nrgn, Mobp) and ligand-receptor demos · mouse
  • Visium mouse brain section with fluorescence image (DAPI, anti-NEUN, anti-GFAP channels) for nuclei segmentation features · mouse
  • Visium mouse brain coronal section paired with mouse cortex scRNA-seq (Tasic et al.) for segmentation-aware Tangram mapping · mouse
  • Imaging Mass Cytometry of breast cancer biopsies with cell types from the original authors (Ripley's K, co-occurrence, enrichment, centrality) · figshare 10.6084/m9.figshare.c.5273297.v1 (pre-processed collection)
  • paul15 and pbmc3k datasets used to compare numbers of ligand-receptor interactions recovered with Omnipath · mouse (paul15); human (pbmc3k)
  • Human forebrain development dataset used to time the ligand-receptor permutation test at increasing gene numbers · human
Methods & tools
Scanpy and AnnData (data model and single-cell analysis workflows), xarray, Dask, rasterio and zarr (lazy, on-disk Image Container), Napari (interactive image viewer and manual tissue annotation), Scikit-image (preprocessing, watershed segmentation, texture and summary features), Scikit-learn (k-nearest-neighbor spatial graph), Numba (just-in-time compiled permutation tests), CellPhoneDB method (re-implemented) with Omnipath ligand-receptor annotations, libpysal (global Moran's I); Astropy cited for the Ripley's K edge-correction term, NetworkX (group centralities, interaction matrix), Stardist, Splinedist, Cellpose, ResNet (deep learning segmentation and features), Tangram, Cell2Location (cell-type deconvolution), Giotto (runtime benchmark comparator)
Software & environment
pip-installable Python package built on Scanpy/AnnData, using xarray, Dask, rasterio, zarr, Numba, Scikit-image, Scikit-learn, NetworkX, libpysal and Napari (usable from Jupyter notebooks); pre-processed datasets load through the squidpy.dataset module.
Assay conditions & compute
Graph, enrichment and feature-extraction benchmarks: 2,4 GHz Intel Core i5, 4 cores, 16 GB RAM; ligand-receptor benchmarks: Centos 8 cluster, 32 cores, 128 GB; serial unless stated; image tiles of size 2000.
Reproducibility gaps
No package versions, dependency pins, or containers stated; raw seqFISH, 4i and Imaging Mass Cytometry sources lack original accessions, and the specific 10x Visium datasets are not individually identified (pre-processed copies on figshare).
Limitations (5)
  • A pre-trained ResNet trained on the H&E image to predict gene-expression clusters could not discriminate some labels, and parts of the cortex and hypothalamus appeared not to be classified accurately. · stated by the authors
  • Simple watershed segmentation may be inappropriate depending on data quality, and partially overlapping nuclei are hard to separate, so users may need pre-trained deep learning segmenters such as Stardist or Cellpose. · stated by the authors
  • In the speed benchmark, Giotto's 4i neighborhood enrichment was timed only once, whereas the other reported timings are means of 10 runs. · stated by the authors
  • Reported overlaps conflict between main text and supplementary legend (hippocampus 77% with cluster 10 vs Hypothalamus_1 77% with cluster 8), and the 4i conditioning cluster is called Nucleus in text but Nucleolus in the legend. · noted in this summary
  • Evaluation is mostly qualitative: spatial statistics are checked against prior findings or expectations without simulated ground truth, runtime is compared only with Giotto (not original CellPhoneDB), and Omnipath's additional interactions are counted but not validated. · noted in this summary

Read this if you analyze Visium, seqFISH, or imaging mass cytometry data in Python and want graph-based spatial statistics, ligand-receptor tests, and tissue image features within a Scanpy-compatible toolkit.

Citations
1,145
FWCI
62.43
Field percentile
top 1%

Reproducibility ledger

Nobody has reported trying to reproduce this paper yet. Did you replicate an experiment or run the code? Your report saves the next lab a week.

Sign in to file a reproducibility report.

Similarity Map
SelectedSame fieldCross-field
THISLi '25Blampey '24Marconato '24Gunz '26Langseth '26Baker '23
71% semantic matchBioinformatics
Xiao Li, Ximo Pechuan-Jorge, Tyler Risom+20 more·GigaScience·Jan 1, 2025· 13 citations