nf-core pipeline · segmentation, spatial-omics, spatial-proteomics
nf-core/sopa
Nextflow pipeline for processing and analysing single-cell spatial transcriptomics and multiplex imaging data.
What nf-core/sopa is
nf-core/sopa is a bioinformatics pipeline for analysing spatial omics datasets at single-cell resolution, supporting both spatial transcriptomics and multiplex imaging. Built on top of the SpatialData framework, it standardises heterogeneous spatial formats into a shared data structure. The workflow was originally developed by Quentin Blampey during work at CentraleSupélec, Gustave Roussy Institute, Université Paris-Saclay, and Cure51, alongside community contributors.
Spatial technologies generate diverse data modalities, ranging from transcript coordinates to multi-channel optical images. The pipeline addresses this fragmentation across platforms including Xenium, Visium HD, MERSCOPE, CosMX, PhenoCycler, MACSima, and Molecular Cartography. It processes raw inputs and boundaries into unified, reproducible formats.
Outputs include a processed SpatialData object structured as a Zarr directory alongside an explorer directory for visualisation. These outputs allow researchers to perform single-cell transcript and channel intensity analyses directly or proceed to custom analyses using the Sopa Python library.
What the pipeline does
The workflow begins by accepting raw or vendor-processed spatial directories defined via a samplesheet. For Visium HD data, it can optionally execute initial raw data processing using Space Ranger. The pipeline then carries out optional tissue segmentation, followed by single-cell segmentation using algorithms such as Cellpose, Baysor, Proseg, Comseg, or StarDist.
Following boundary segmentation, the pipeline aggregates data by counting cellular transcripts or averaging channel pixel intensities per cell. Users can optionally perform cell-type annotation. Finally, the workflow exports user-friendly visualisation files in an explorer directory and saves the full processed SpatialData object inside a Zarr directory.
Key facts
- Framework
- Nextflow, SpatialData
- Primary developer
- Quentin Blampey
- Latest release
- 1.0.1 (2026-08-25)
- Supported platforms
- Xenium, Visium HD, MERSCOPE, CosMX, PhenoCycler, MACSima, Molecular Cartography
- Segmentation methods
- Cellpose, Baysor, Proseg, Comseg, StarDist
- Primary output format
- .zarr (SpatialData) and .explorer directory
- Primary input format
- CSV samplesheet with sample directories
What you can use it for
- Subcellular spatial transcriptomics processing
- Processes transcript coordinate data from platforms such as Xenium, MERSCOPE, CosMX, or Molecular Cartography to generate single-cell count matrices.
- Multiplex tissue imaging segmentation
- Segments single cells across multi-channel protein imaging experiments from platforms such as PhenoCycler or MACSima.
- Visium HD spatial pipeline execution
- Runs end-to-end processing starting with raw sequencing data via Space Ranger through to high-resolution cell segmentation and feature aggregation.
- Standardised spatial data export
- Standardises measurements from diverse experimental instruments into unified SpatialData Zarr structures for downstream Python analyses.
Run it here
The research agent runs nf-core/sopa with Nextflow on its own machine — up to 32 cores, 256 GiB of memory and 24 hours per run, which covers the test profile and real single-sample runs. It builds the samplesheet, checks it against the pipeline's schema and reads the results back. When a run is too big for one machine, it gives you the exact command for your own cluster instead.
Strengths and limits
Good at
- Standardises data across diverse spatial transcriptomics and multiplex imaging platforms into a single framework.
- Offers multiple cell segmentation algorithms including Cellpose, Baysor, Proseg, Comseg, and StarDist.
- Generates both a standard SpatialData Zarr object and an interactive explorer directory for immediate visualisation.
Watch out for
- Visium HD processing uses a different samplesheet format than the standard samplesheet accepted for other platforms.
- Space Ranger data processing is restricted only to Visium HD datasets.
- Pipeline parameters must be supplied via the command line or parameter files rather than standard custom configuration files.
Questions
Can I run nf-core/sopa without my own cluster?
The research agent runs nf-core/sopa with Nextflow on its own machine — up to 32 cores, 256 GiB of memory and 24 hours per run, which covers the test profile and real single-sample runs. It builds the samplesheet, checks it against the pipeline's schema and reads the results back. When a run is too big for one machine, it gives you the exact command for your own cluster instead.
What licence is nf-core/sopa under?
MIT, like every nf-core pipeline.
What inputs does nf-core/sopa require?
The pipeline requires a CSV samplesheet listing the data path to each sample output directory, with an optional sample name column. Visium HD inputs require a dedicated samplesheet structure.
Which segmentation algorithms are supported?
The pipeline supports Cellpose, Baysor, Proseg, Comseg, and StarDist for cell segmentation, alongside optional tissue segmentation.
What outputs are generated by the pipeline?
The workflow exports a processed SpatialData object within a .zarr directory and an accompanying .explorer directory designed for quick analysis and visual inspection.
Can downstream analysis be continued after running the pipeline?
Yes, the exported .zarr SpatialData object can be imported directly into the Sopa Python package for further exploratory and single-cell analysis.
How to cite it
Quentin Blampey, Kevin Mulder, Margaux Gardet, Stergios Christodoulidis, Charles-Antoine Dutertre, Fabrice André, Florent Ginhoux & Paul-Henry Cournède. Sopa: a technology-invariant pipeline for analyses of image-based spatial omics. Nat Commun. 2024 June 11. doi: 10.1038/s41467-024-48981-z
Written from nf-core/sopa's own README. Statements citing a figure that does not appear there are removed before publication. Licence and running details come from our registry.