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).
You may also be interested in Novae, developed by the same authors, now published in Nature Methods 🎉
Documentation
Check Sopa’s documentation to get started. It contains installation explanations, CLI/API details, and tutorials.
Overview
The following illustration describes the main steps of sopa:
Installation
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 sopa
Usage modes
Sopa comes in four different flavours, each corresponding to a different use case:
API: use directly sopa as 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 of nf-core/sopa, see the public archive here).
CLI: use our command-line-interface for prototyping quickly your own pipeline (advanced users).
API usage
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 cells
Cite us
Our 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
评论