image-st

A pipeline to generate count matrix for different spatial technologies. ISS/MERFISH-like data are decoded using PoSTcode

https://github.com/cellgeni/image-st

Science Score: 52.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
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
    Organization cellgeni has institutional domain (www.sanger.ac.uk)
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.2%) to scientific vocabulary
Last synced: 7 months ago · JSON representation ·

Repository

A pipeline to generate count matrix for different spatial technologies. ISS/MERFISH-like data are decoded using PoSTcode

Basic Info
  • Host: GitHub
  • Owner: cellgeni
  • License: mit
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 1.37 MB
Statistics
  • Stars: 1
  • Watchers: 2
  • Forks: 1
  • Open Issues: 0
  • Releases: 0
Created over 1 year ago · Last pushed 8 months ago
Metadata Files
Readme License Citation

README.md

PaSTa is a nextflow-based end-to-end image analysis pipeline for decoding image-based spatial transcriptomics data. It performs imaging cycle registration, cell segmentation and transcripts peak decoding. It is currently supports analysis of three types of ST technology:

  • in-situ sequencing-like encoding
  • MERFISH-like encoding
  • RNAScope-like labelling

Prerequisites: 1. Nextflow. Installation guide: https://www.nextflow.io/docs/latest/getstarted.html 2. Docker or Singularity. Installation guide: https://docs.docker.com/get-docker/ or https://sylabs.io/guides/3.7/user-guide/quick_start.html

Demo run with GitPod

Check this HackMD from I2K2024 workshop: https://hackmd.io/w4DeWEDxRlKwIPTDCc77XA

Basic run

  1. Clone the repository git clone https://github.com/cellgeni/Image-ST.git
  2. Prepare the run.config file * ``` process { withName: CELLPOSE { ext.args = "--channels [0,0]" storeDir = "./output/naivecellposesegmentation/" }

    withName: POSTCODE {
            memory = {20.Gb * task.attempt}
            storeDir = "./output/PoSTcode_decoding_output"
    }
    
    withName: TO_SPATIALDATA {
            memory = {20.Gb * task.attempt}
            ext.args = "--feature_col 'Name' --expansion_in_pixels 30 --save_label_img False"
    }
    
    withName: MERGE_OUTLINES {
            storeDir = "./output/merged_cellpose_segmentation/"
    }
    
    withName: BIOINFOTONGLI_MICROALIGNER {
            memory = {50.Gb * task.attempt}
            storeDir = "./output/registered_stacks"
    }
    
    withName: BIOINFOTONGLI_TILEDSPOTIFLOW {
            memory = {30.Gb * task.attempt}
            storeDir = "./output/spotiflow_peaks/"
    }
    
    withName: BIOINFOTONGLI_MERGEPEAKS {
            memory = {50.Gb * task.attempt}
            storeDir = "./output/spotiflow_peaks/"
    }
    
    withName: BIOINFOTONGLI_CONCATENATEWKTS {
            memory = {50.Gb * task.attempt}
            storeDir = "./output/spotiflow_peaks/"
    }
    
    withName: EXTRACT_PEAK_PROFILE {
            memory = {50.Gb * task.attempt}
            storeDir = "./output/peak_profiles/"
    }
    

    } ```

  3. Prepare the parameters file (e.g. iss.yaml) ``` images:

    • ['id': "test", [ "cycle1.ome.tiff", "cycle2.ome.tiff", "cycle3.ome.tiff", "cycle4.ome.tiff", "cycle5.ome.tiff", "cycle6.ome.tiff", ] ] celldiameters: [30] chstocallpeaks: [1,2] // channels to call peaks, can be multiple codebook:
    • ['id': "test", "./codebook.csv", "./dummy.txt"] // has to match the meta in images variable segmentation_method: "CELLPOSE" // or DEEPCELL or STARDIST or INSTANSEG

outdir: "./output" 4. Run the pipeline nextflow run ./Image-ST/main.nf -profile lsf,singularity -c run.config -params-file iss.yaml -entry RUNDECODING -resume ``` 5. Check the output in the specified storeDir.

Spin up Napari with napari-spatialdata plugin installed (https://spatialdata.scverse.org/projects/napari/en/latest/notebooks/spatialdata.html)

Then use the following command to visualize the output ``` from napari_spatialdata import Interactive import spatialdata as spd

data = spd.read_zarr([path-to-.sdata-folder]) Interactive(data) ```

*: You may leave the process block empty if you want to use the default parameters.

FAQ

  1. My HOME dir is full when running Singularity image conversion on HPC.

A quick solution is to manually specify singularity dir by setting:

singularity cache clean export SINGULARITY_CACHEDIR=./singularity_image_dir export NXF_SINGULARITY_CACHEDIR=./singularity_image_dir

  1. How do I modify parameters to specific process/step?

By following nf-core standard, it is possible to add any parameters to the main script using ext.args=”--[key] [value]” in the run.config file.

An example is

withName: POSTCODE { ext.args = "--codebooktargercol L-probe --codebookcodecol code " }

  1. Cannot download pretrained model for the deep-learning tools (Spotiflow/CellPose)

Exception: URL fetch failure on https://drive.switch.ch/index.php/s/6AoTEgpIAeQMRvX/download: None -- [Errno -3] Temporary failure in name resolution Or CellPose urllib.error.URLError:

Mostly likely you've reached max download (?), wait a bit and try later OR manually download those models and update the configuration file.

Owner

  • Name: Cellular Genetics Informatics
  • Login: cellgeni
  • Kind: organization
  • Location: United Kingdom

Wellcome Sanger Institute

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this repo, please cite it"
authors:
- family-names: "LI"
  given-names: "Tong"
  orcid: "https://orcid.org/0000-0002-8240-4476"
title: "A nextflow pipeline to run the end-to-end image-based in-situ sequencing decoding and RNAScope-like analysis"
version: 0.1.1
date-released: 2024-08-18
license: Apache-2.0
url: "https://github.com/cellgeni/Image-ST"

GitHub Events

Total
  • Watch event: 1
  • Push event: 37
  • Pull request event: 8
Last Year
  • Watch event: 1
  • Push event: 37
  • Pull request event: 8

Issues and Pull Requests

Last synced: 7 months ago

All Time
  • Total issues: 0
  • Total pull requests: 4
  • Average time to close issues: N/A
  • Average time to close pull requests: 8 days
  • Total issue authors: 0
  • Total pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 4
  • Average time to close issues: N/A
  • Average time to close pull requests: 8 days
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • BioinfoTongLI (4)
Top Labels
Issue Labels
Pull Request Labels

Dependencies

modules/sanger-cellgeni/imaging/cellpose/meta.yml cpan
modules/sanger-cellgeni/imaging/concatenatewkts/meta.yml cpan
modules/sanger-cellgeni/imaging/deepcell/meta.yml cpan
modules/sanger-cellgeni/imaging/extractpeakprofile/meta.yml cpan
modules/sanger-cellgeni/imaging/generatetiles/meta.yml cpan
modules/sanger-cellgeni/imaging/instanseg/meta.yml cpan
modules/sanger-cellgeni/imaging/mergeoutlines/meta.yml cpan
modules/sanger-cellgeni/imaging/mergepeaks/meta.yml cpan
modules/sanger-cellgeni/imaging/microaligner/meta.yml cpan
modules/sanger-cellgeni/imaging/postcode/meta.yml cpan
modules/sanger-cellgeni/imaging/stardist/meta.yml cpan
modules/sanger-cellgeni/imaging/tiledspotiflow/meta.yml cpan
subworkflows/sanger-cellgeni/microaligner_registration/meta.yml cpan
subworkflows/sanger-cellgeni/tiled_segmentation/meta.yml cpan
subworkflows/sanger-cellgeni/tiled_spotiflow/meta.yml cpan
modules/sanger-cellgeni/imaging/deepcell/environment.yml pypi
modules/sanger-cellgeni/imaging/instanseg/environment.yml pypi
modules/sanger-cellgeni/imaging/stardist/environment.yml pypi