Spatial omics pipeline and analysis
Built on top of SpatialData, Sopa enables processing and analyses of spatial omics data with single-cell resolution (spatial transcriptomics or multiplex imaging data) using a standard data structure and output. We currently support the following technologies: Xenium, Visium HD, MERSCOPE, CosMx, PhenoCycler, MACSima, Molecular Cartography, and others. Sopa was designed for generability and low memory consumption on large images (scales to 1TB+ images).
Note
You may also be interested in Novae, developed by the same authors, now published in Nature Methods 🎉
Check Sopa's documentation to get started. It contains installation explanations, CLI/API details, and tutorials.
The following illustration describes the main steps of sopa:
Sopa can be installed from PyPI on all OS, for any Python version >=3.12. On a new environment, run the following command:
pip install sopaNote
See this installation section for more details about extras and other installations modes.
Sopa comes in four different flavours, each corresponding to a different use case:
API: use directlysopaas a Python package for complete flexibility and customization (example below).nf-core/sopa: run Sopa with Nextflow (see this repo and the corresponding usage guide).Snakemake pipeline: choose a config, and run our pipeline on your spatial data in a couple of minutes (deprecated in favor ofnf-core/sopa, see the public archive here).CLI: use our command-line-interface for prototyping quickly your own pipeline (advanced users).
Below is a minimal example of API usage. For a complete API description, please refer to the documentation.
import sopa
sdata = sopa.io.xenium("path/to/data") # reading Xenium data
sopa.make_image_patches(sdata) # creating overlapping patches
sopa.segmentation.cellpose(sdata, "DAPI", diameter=30) # running cellpose segmentation
sopa.aggregate(sdata) # counting the transcripts inside the cellsOur article is published in Nature Communications. You can cite Sopa as below:
Blampey, Q., Mulder, K., Gardet, M. et al. Sopa: a technology-invariant pipeline for analyses of image-based spatial omics.
Nat Commun 15, 4981 (2024). https://doi.org/10.1038/s41467-024-48981-z
