Skip to content
prism-oncologyPublic

About

Technology-invariant pipeline for spatial omics analysis that scales to millions of cells (Xenium / Visium HD / MERSCOPE / CosMx / PhenoCycler / MACSima / etc.)

Topics

Resources

Contributing

Stars

299 stars

Watchers

9 watching

Forks

Repository files navigation

sopa_logo

Spatial omics pipeline and analysis

PyPI Downloads Docs Build License uv Ruff

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 🎉

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:

sopa_overview

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

Note

See this installation section for more details about extras and other installations modes.

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

About

Technology-invariant pipeline for spatial omics analysis that scales to millions of cells (Xenium / Visium HD / MERSCOPE / CosMx / PhenoCycler / MACSima / etc.)

Topics

Resources

Contributing

Stars

299 stars

Watchers

9 watching

Forks

Releases

Packages

Used by

Contributors

Languages