Spatial-omics pipeline and analysis
Project description
Spatial omics pipeline and analysis
Built on top of SpatialData, Sopa enables processing and analyses of image-based spatial omics (spatial transcriptomics and multiplex imaging data) using a standard data structure and output. We currently support the following technologies: Xenium, MERSCOPE, CosMX, PhenoCycler, MACSima, Hyperion. Sopa was designed for generability and low memory consumption on large images (scales to 1TB+
images).
The pipeline outputs contain: (i) Xenium Explorer files for interactive visualization, (ii) an HTML report for quick quality controls, and (iii) a SpatialData .zarr
directory for further analyses.
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
:
Xenium Explorer is a registered trademark of 10x Genomics. The Xenium Explorer is licensed for usage on Xenium data (more details here).
Installation
PyPI installation
Sopa can be installed via PyPI
on all operating systems. The preferred Python version is python==3.10
, but we also support 3.9
to 3.11
. On a new environment, run the following command:
pip install sopa
To install extras (for example, if you want to use snakemake
/cellpose
/baysor
/tangram
), please run:
pip install 'sopa[snakemake,cellpose,baysor,tangram]'
Important: even though pip install 'sopa[baysor]'
will install some dependencies related to baysor, you still have to install the baysor
command line (see the official repository) if you want to use it.
Other installation modes
You can clone the repository and run one of these command lines at the root of sopa
:
pip install -e . # dev mode installation
poetry install # poetry installation
Features
Sopa comes in three different flavours, each corresponding to a different use case:
Snakemake pipeline
: choose a config, and run our pipeline on your spatial data in a couple of minutesCLI
: use our command-line-interface for prototyping quickly your own pipelineAPI
: use directlysopa
as a Python package for complete flexibility and customization
Snakemake pipeline
Clone our repository, choose a config here (or create your own), and execute our pipeline locally or on a high-performance cluster:
git clone https://github.com/gustaveroussy/sopa.git
cd sopa/workflow
snakemake --configfile=/path/to/yaml_config --config data_path=/path/to/data_directory --cores 1 --use-conda
For more details on snakemake
configuration and how to properly setup your environments, please refer to the documentation.
CLI
Below are examples of commands that can be run with the sopa
CLI:
> sopa --help # show command names and arguments
> sopa read merscope_directory --technology merscope # read some data
> sopa patchify image merscope_directory.zarr # make patches for low-memory segmentation
> sopa segmentation cellpose merscope_directory.zarr --diameter 60 --channels DAPI # segmentation
> sopa resolve cellpose merscope_directory.zarr # resolve segmentation conflicts at boundaries
> sopa aggregate merscope_directory.zarr --average-intensities # transcripts/channels aggregation
> sopa explorer write merscope_directory.zarr # convert for interactive vizualisation
For a complete description of the CLI, please refer to the documentation.
API
import sopa
# use the 'sopa' python package
For a complete API description, please refer to the documentation.
Cite us
Our article is published in Nature Communications. You can cite our paper as below:
@article{blampey_sopa_2024,
title = {Sopa: a technology-invariant pipeline for analyses of image-based spatial omics},
volume = {15},
url = {https://www.nature.com/articles/s41467-024-48981-z},
doi = {10.1038/s41467-024-48981-z},
journal = {Nature Communications},
author = {Blampey, Quentin and Mulder, Kevin and Gardet, Margaux and Christodoulidis, Stergios and Dutertre, Charles-Antoine and André, Fabrice and Ginhoux, Florent and Cournède, Paul-Henry},
year = {2024},
note = {Publisher: Nature Publishing Group},
pages = {4981},
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file sopa-1.1.5.tar.gz
.
File metadata
- Download URL: sopa-1.1.5.tar.gz
- Upload date:
- Size: 112.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.11 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2b7265b5d231bdcca49185e8b2015fea34ea53404336165befb920fb3427fc6 |
|
MD5 | 8226960ed822dd94a39d1bd5e20dc313 |
|
BLAKE2b-256 | 7e6fe618e38713522c7d3ac63b6893f7649f78f5c2b91b351bdff650e4a8d00e |
File details
Details for the file sopa-1.1.5-py3-none-any.whl
.
File metadata
- Download URL: sopa-1.1.5-py3-none-any.whl
- Upload date:
- Size: 138.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.11 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dec0b6c13783f17866664cc238cc73746d2f8b9ac8997237a4c54d0d158a7601 |
|
MD5 | cc3c0f8729da6476e98cd58512939794 |
|
BLAKE2b-256 | 6e4e7631afb0c1aa1b73c40f6d3726814b6392a49aedeb2a2077c4519ee4c9ff |