spatialproteomics
Cell segmentation and downstream analysis pipeline for spatial proteomics (MIBI & COMET).
Science Score: 65.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 10 DOI reference(s) in README -
○Academic publication links
-
○Academic email domains
-
✓Institutional organization owner
Organization wehi-soda-hub has institutional domain (www.wehi.edu.au) -
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (9.9%) to scientific vocabulary
Keywords
Repository
Cell segmentation and downstream analysis pipeline for spatial proteomics (MIBI & COMET).
Basic Info
Statistics
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
- Releases: 0
Topics
Metadata Files
README.md
Introduction
WEHI-SODA-Hub/spatialproteomics is a pipeline for running cell segmentation on COMET and MIBI data. For COMET, background subtraction can be performed followed by patched cellpose segmentation, or non-patched mesmer segmentation. For MIBI, mesmer segmentation can be run. Whole-cell and nuclear segmentations are run separately, and then consolidated into whole cells with nuclei with full shape and intensity measurements per compartment. The output GeoJSON files can be viewed in QuPath.

The pipeline uses the following tools:
- Background_subtraction -- background subtraction tool for COMET.
- MesmerSegmentation -- a CLI for running Mesmer segmentation of MIBI and OME-XML TIFFs.
- cellmeasurement -- a Groovy app that matches whole-cell segmentations with nuclei, and uses the QuPath API to calculate compartment measurements and intensities.
- sopa -- we use the sopa CLI tool to patchify images and perform cellpose segmentation.
Please see the docs for more detailed information on pipeline usage and output
Usage
[!NOTE] If you are new to Nextflow and nf-core, please refer to this page on how to set-up Nextflow. Make sure to test your setup with
-profile test(to test cellpose segmentation) or-profile test_mesmerto test mesmer segmentation before running the workflow on actual data.
If you are running this pipeline from WEHI, it has been set up to run on Seqera Platform.
[!NOTE] If you don't have a .gradle directory in your home, make sure you create it with
mkdir $HOME/.gradlebefore runnning the pipeline. You con't need to do this if you are running via WEHI's Seqera Platform mentioned above.
Usage will depend on your desired steps. See usage docs for more detailed information.
Background subtraction
[!NOTE] This step will only work with COMET OME-TIF files.
Prepare a sample sheet as follows:
samplesheet.csv:
csv
sample,run_backsub,run_mesmer,run_cellpose,tiff
sample1,true,true,false,/path/to/sample1.tiff
sample2,true,false,true,/path/to/sample2.tiff
You may also prefer to use YAML for your samplesheet, either is supported:
samplesheet.yml:
yaml
- sample: sample1
run_backsub: true
run_mesmer: true
run_cellpose: false
tiff: /path/to/sample1.tiff
- sample: sample2
run_backsub: true
run_mesmer: true
run_cellpose: false
tiff: /path/to/sample2.tiff
[!WARNING] Please ensure that your image name and all directories in your file path do not contain spaces.
If you don't specify any segmentation algorithm to run (mesmer or cellpose), the pipeline will run a background subtraction only.
Now, you can run the pipeline using:
bash
nextflow run WEHI-SODA-Hub/spatialproteomics \
-profile <docker/singularity/.../institute> \
--input samplesheet.csv \
--outdir <OUTDIR>
[!WARNING] Please provide pipeline parameters via the CLI or Nextflow
-params-fileoption. Custom config files including those provided by the-cNextflow option can be used to provide any configuration except for parameters; see docs.
Mesmer segmentation
Before running Mesmer, ensure that you have a deepcell access token and that you have set it in your Nextflow secrets:
bash
nextflow secrets set DEEPCELL_ACCESS_TOKEN $YOUR_TOKEN
If you want to run Mesmer as your segmentation algorithm, you can specify a config file like so:
csv
sample,run_backsub,run_mesmer,tiff,nuclear_channel,membrane_channels
sample1,true,true,/path/to/sample1.tiff,DAPI,CD45:CD8
sample2,false,true,/path/to/sample2.tiff,DAPI,CD45
Nuclear channels only support one entry; membrane channels may have multiple
values separated by : characters. If your channels have spaces in them, make
sure that you surround your channel name with quotes. For example, CD45:"HLA I".
You can also set the segmentation parameters for mesmer either via CLI
(e.g., --combine_method prod or in a config file pass to the workflow
via -c. See usage for a full list.
[!WARNING] You cannot run both Mesmer and Cellpose segmentation on the same sample (with the same name). If you want to run both on a sample, put it on a different line and give it a different sample name.
Cellpose segmentation
If you want to run Cellpose as your segmentation algorithm, you can specify a config file like so:
csv
sample,run_backsub,run_cellpose,tiff,nuclear_channel,membrane_channels
sample1,true,true,/path/to/sample1.tiff,DAPI,CD45:CD8
sample2,false,true,/path/to/sample2.tiff,DAPI,CD45
As with Mesmer, nuclear channels only support one entry; membrane channels may
have multiple values separated by : characters. You can also set the following
parameters, either via CLI (e.g., --combine_method prod or in a config
file pass to the workflow via -c. See usage for a full list.
Cellpose will run in a parallelised patched workflow using sopa. To control the
patching process, you can use the patch_width_pixel and patch_overlap_pixel
parameters.
If you want to skip measurements (this may take some time for large images), you
can use set the parameter skip_measurements to true.
Dealing with large images
You can run the pipeline with different profiles for different size images:
small: for images <150GBmedium: for images <300GBlarge: for images <600GB
[!WARNING] If you are combining many membrane channels, using
prodas the combine method may lead to large memory usage. In these cases, it is recommended to usemaxinstead.
Credits
WEHI-SODA-Hub/spatialproteomics was originally written by the WEHI SODA-Hub.
We thank the following people for their extensive assistance in the development of this pipeline:
- Michael McKay (@mikemcka)
- Emma Watson
Contributions and Support
If you would like to contribute to this pipeline, please see the contributing guidelines.
Citations
An extensive list of references for the tools used by the pipeline can be found in the CITATIONS.md file.
This pipeline was created using the nf-core template. You can cite the nf-core publication as follows:
The nf-core framework for community-curated bioinformatics pipelines.
Philip Ewels, Alexander Peltzer, Sven Fillinger, Harshil Patel, Johannes Alneberg, Andreas Wilm, Maxime Ulysse Garcia, Paolo Di Tommaso & Sven Nahnsen.
Nat Biotechnol. 2020 Feb 13. doi: 10.1038/s41587-020-0439-x.
Owner
- Name: WEHI SODA Hub
- Login: WEHI-SODA-Hub
- Kind: organization
- Location: Australia
- Website: https://www.wehi.edu.au/research/technologies/spatial-omics/
- Repositories: 1
- Profile: https://github.com/WEHI-SODA-Hub
Spatial Omics Data Analytics Hub based at The Walter and Eliza Hall Institute of Medical Research
Citation (CITATIONS.md)
# WEHI-SODA-Hub/spatialproteomics: Citations ## [nf-core](https://pubmed.ncbi.nlm.nih.gov/32055031/) > Ewels PA, Peltzer A, Fillinger S, Patel H, Alneberg J, Wilm A, Garcia MU, Di Tommaso P, Nahnsen S. The nf-core framework for community-curated bioinformatics pipelines. Nat Biotechnol. 2020 Mar;38(3):276-278. doi: 10.1038/s41587-020-0439-x. PubMed PMID: 32055031. ## [Nextflow](https://pubmed.ncbi.nlm.nih.gov/28398311/) > Di Tommaso P, Chatzou M, Floden EW, Barja PP, Palumbo E, Notredame C. Nextflow enables reproducible computational workflows. Nat Biotechnol. 2017 Apr 11;35(4):316-319. doi: 10.1038/nbt.3820. PubMed PMID: 28398311. ## Pipeline tools ## Software packaging/containerisation tools - [Anaconda](https://anaconda.com) > Anaconda Software Distribution. Computer software. Vers. 2-2.4.0. Anaconda, Nov. 2016. Web. - [Bioconda](https://pubmed.ncbi.nlm.nih.gov/29967506/) > Grüning B, Dale R, Sjödin A, Chapman BA, Rowe J, Tomkins-Tinch CH, Valieris R, Köster J; Bioconda Team. Bioconda: sustainable and comprehensive software distribution for the life sciences. Nat Methods. 2018 Jul;15(7):475-476. doi: 10.1038/s41592-018-0046-7. PubMed PMID: 29967506. - [BioContainers](https://pubmed.ncbi.nlm.nih.gov/28379341/) > da Veiga Leprevost F, Grüning B, Aflitos SA, Röst HL, Uszkoreit J, Barsnes H, Vaudel M, Moreno P, Gatto L, Weber J, Bai M, Jimenez RC, Sachsenberg T, Pfeuffer J, Alvarez RV, Griss J, Nesvizhskii AI, Perez-Riverol Y. BioContainers: an open-source and community-driven framework for software standardization. Bioinformatics. 2017 Aug 15;33(16):2580-2582. doi: 10.1093/bioinformatics/btx192. PubMed PMID: 28379341; PubMed Central PMCID: PMC5870671. - [Docker](https://dl.acm.org/doi/10.5555/2600239.2600241) > Merkel, D. (2014). Docker: lightweight linux containers for consistent development and deployment. Linux Journal, 2014(239), 2. doi: 10.5555/2600239.2600241. - [Singularity](https://pubmed.ncbi.nlm.nih.gov/28494014/) > Kurtzer GM, Sochat V, Bauer MW. Singularity: Scientific containers for mobility of compute. PLoS One. 2017 May 11;12(5):e0177459. doi: 10.1371/journal.pone.0177459. eCollection 2017. PubMed PMID: 28494014; PubMed Central PMCID: PMC5426675.
GitHub Events
Total
- Issues event: 9
- Issue comment event: 11
- Push event: 55
- Public event: 1
Last Year
- Issues event: 9
- Issue comment event: 11
- Push event: 55
- Public event: 1
Dependencies
- actions/upload-artifact v4 composite
- octokit/request-action v2.x composite
- seqeralabs/action-tower-launch v2 composite
- actions/upload-artifact v4 composite
- seqeralabs/action-tower-launch v2 composite
- mshick/add-pr-comment b8f338c590a895d50bcbfa6c5859251edc8952fc composite
- actions/checkout 0ad4b8fadaa221de15dcec353f45205ec38ea70b composite
- conda-incubator/setup-miniconda a4260408e20b96e80095f42ff7f1a15b27dd94ca composite
- docker/login-action v2 composite
- eWaterCycle/setup-apptainer main composite
- jlumbroso/free-disk-space 54081f138730dfa15788a46383842cd2f914a1be composite
- nf-core/setup-nextflow v2 composite
- actions/stale 28ca1036281a5e5922ead5184a1bbf96e5fc984e composite
- actions/setup-python 82c7e631bb3cdc910f68e0081d67478d79c6982d composite
- eWaterCycle/setup-apptainer 4bb22c52d4f63406c49e94c804632975787312b3 composite
- jlumbroso/free-disk-space 54081f138730dfa15788a46383842cd2f914a1be composite
- nf-core/setup-nextflow v2 composite
- actions/checkout 0ad4b8fadaa221de15dcec353f45205ec38ea70b composite
- actions/setup-python 82c7e631bb3cdc910f68e0081d67478d79c6982d composite
- peter-evans/create-or-update-comment 71345be0265236311c031f5c7866368bd1eff043 composite
- actions/checkout 0ad4b8fadaa221de15dcec353f45205ec38ea70b composite
- actions/setup-python 82c7e631bb3cdc910f68e0081d67478d79c6982d composite
- actions/upload-artifact 65462800fd760344b1a7b4382951275a0abb4808 composite
- nf-core/setup-nextflow v2 composite
- pietrobolcato/action-read-yaml 1.1.0 composite
- dawidd6/action-download-artifact bf251b5aa9c2f7eeb574a96ee720e24f801b7c11 composite
- marocchino/sticky-pull-request-comment 331f8f5b4215f0445d3c07b4967662a32a2d3e31 composite
- actions/setup-python 82c7e631bb3cdc910f68e0081d67478d79c6982d composite
- rzr/fediverse-action master composite
- zentered/bluesky-post-action 80dbe0a7697de18c15ad22f4619919ceb5ccf597 composite
- actions/checkout 0ad4b8fadaa221de15dcec353f45205ec38ea70b composite
- mshick/add-pr-comment b8f338c590a895d50bcbfa6c5859251edc8952fc composite
- nichmor/minimal-read-yaml v0.0.2 composite
- bioconductor-spasim 1.8.0.*
- bioconductor-spatialexperiment 1.16.0.*
- r-devtools 2.4.5.*
- r-magick 2.8.5.*
- r-quarto 1.4.4.*
- r-tidyverse 2.0.0.*
- pandas 2.3.0.*
- tifffile 2025.6.11.*
- typer 0.16.0.*
- deepcell >=0.12,<0.13
- tensorflow-cpu >=2.8,<2.9