Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
c6999a1
added pipeline metromap, updated README page
khersameesh24 Nov 23, 2024
a3c02db
Update README.md
khersameesh24 Nov 24, 2024
d631c39
Merge pull request #34 from khersameesh24/32-update-pipeline-metro-ma…
khersameesh24 Nov 25, 2024
75a7407
ïnstalled module xeniumranger resegment
khersameesh24 Nov 25, 2024
a9e9eaa
Merge pull request #1 from khersameesh24/32-update-pipeline-metro-map…
khersameesh24 Nov 28, 2024
9066fc9
suggested changes to metro map
khersameesh24 Nov 28, 2024
3813928
Merge pull request #2 from khersameesh24/32-update-pipeline-metro-map…
khersameesh24 Nov 28, 2024
f587904
Merge pull request #39 from khersameesh24/32-update-pipeline-metro-ma…
khersameesh24 Nov 28, 2024
e67d8a6
minor fix
khersameesh24 Dec 3, 2024
7e9f494
Merge branch 'nf-core:32-update-pipeline-metro-map-on-the-readme-page…
khersameesh24 Dec 3, 2024
7965ac0
Add files via upload
khersameesh24 Dec 3, 2024
5fe4b89
Merge pull request #40 from khersameesh24/32-update-pipeline-metro-ma…
khersameesh24 Dec 3, 2024
e89c1d9
Merge pull request #36 from nf-core/32-update-pipeline-metro-map-on-t…
heylf Dec 3, 2024
d330723
include proseg and proseg-to-baysor preprocess into local modules
khersameesh24 Jan 13, 2025
4a088ab
added cellpose for the image seg approach
khersameesh24 Jan 13, 2025
98d91dc
minor fix -naming conventions
khersameesh24 Jan 13, 2025
77ff836
Merge pull request #46 from khersameesh24/add-module-xeniumranger-res…
heylf Jan 24, 2025
60ec402
Delete modules/local/preprocess/main.nf
khersameesh24 Jan 24, 2025
19a90dd
Delete modules/local/proseg/tests/tags.yml
khersameesh24 Jan 24, 2025
697870e
Delete modules/local/proseg/tests/main.nf.test
khersameesh24 Jan 24, 2025
a3de022
Delete modules/local/proseg/nextflow.config
khersameesh24 Jan 24, 2025
1d45969
Delete modules/local/proseg/main.nf
khersameesh24 Jan 24, 2025
80940c9
Delete modules/local/proseg/meta.yml
khersameesh24 Jan 24, 2025
b4cdc0d
Update meta.yml
khersameesh24 Jan 24, 2025
5ad9e64
Delete modules/local/proseg/nextflow.config
khersameesh24 Jan 24, 2025
4102de1
Merge pull request #45 from khersameesh24/new-module-cellpose
heylf Jan 24, 2025
f8c08e4
Merge pull request #48 from nf-core/add-nf-core-module-cellpose
heylf Jan 24, 2025
5b3b603
moved proseg2baysor under proseg local module
khersameesh24 Jan 24, 2025
da8ff48
Merge pull request #44 from khersameesh24/add-local-module-proseg
khersameesh24 Jan 24, 2025
ee3a6f0
resolve merge conflicts
khersameesh24 Jan 24, 2025
10bec30
Merge pull request #49 from nf-core/local-module-proseg
heylf Jan 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@

## Introduction

**nf-core/spatialxe** is a bioinformatics best-practice processing and quality control pipeline for Xenium data. **The pipeline is currently under developement and no completed yet!**
**nf-core/spatialxe** is a bioinformatics best-practice processing and quality control pipeline for Xenium data. **The pipeline is currently under developement and not completed yet!**. The current plan for the pipeline implementation is shown in the metromap below. Please note that the pipeline steps and methods might change as we move forward in the development cycle.

![nf-core/spatialxe-metromap](docs/images/spatialxe-metromap.png)

The pipeline is built using [Nextflow](https://www.nextflow.io), a workflow tool to run tasks across multiple compute infrastructures in a very portable manner. It uses Docker/Singularity containers making installation trivial and results highly reproducible. The [Nextflow DSL2](https://www.nextflow.io/docs/latest/dsl2.html) implementation of this pipeline uses one container per process which makes it much easier to maintain and update software dependencies. Where possible, these processes have been submitted to and installed from [nf-core/modules](https://github.com/nf-core/modules) in order to make them available to all nf-core pipelines, and to everyone within the Nextflow community!

Expand All @@ -22,8 +24,6 @@ On release, automated continuous integration tests run the pipeline on a full-si

## Pipeline summary



## Quick Start

1. Install [`Nextflow`](https://www.nextflow.io/docs/latest/getstarted.html#installation) (`>=22.10.1`)
Expand Down
Binary file removed docs/images/mqc_fastqc_adapter.png
Binary file not shown.
Binary file removed docs/images/mqc_fastqc_counts.png
Binary file not shown.
Binary file removed docs/images/mqc_fastqc_quality.png
Binary file not shown.
Binary file added docs/images/spatialxe-metromap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions docs/images/spatialxe-metromap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
"https://github.com/nf-core/modules.git": {
"modules": {
"nf-core": {
"cellpose": {
"branch": "master",
"git_sha": "666652151335353eef2fcd58880bcef5bc2928e1",
"installed_by": ["modules"]
},
"custom/dumpsoftwareversions": {
"branch": "master",
"git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c",
Expand All @@ -24,6 +29,11 @@
"branch": "master",
"git_sha": "b5e1891a88491d8731b5e68e22bd907726caec4a",
"installed_by": ["modules"]
},
"xeniumranger/resegment": {
"branch": "master",
"git_sha": "b5e1891a88491d8731b5e68e22bd907726caec4a",
"installed_by": ["modules"]
}
}
}
Expand Down
82 changes: 82 additions & 0 deletions modules/local/proseg/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
process PROSEG {
tag "$meta.id"
label 'process_high'

container "nf-core/proseg:1.1.8"

input:
tuple val(meta), path(transcripts)

output:
tuple val(meta), path("cell-polygons.geojson.gz"), emit: cell_polygons_2d
path("expected-counts.csv.gz"), emit: expected_counts
path("cell-metadata.csv.gz"), emit: cell_metadata
path("transcript-metadata.csv.gz"), emit: transcript_metadata
path("gene-metadata.csv.gz"), emit: gene_metadata
path("rates.csv.gz"), emit: rates
path("cell-polygons-layers.geojson.gz"), emit: cell_polygons_layers
path("cell-hulls.geojson.gz"), emit: cell_hulls
path("versions.yml"), emit: versions

when:
task.ext.when == null || task.ext.when

script:
// Exit if running this module with -profile conda / -profile mamba
if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) {
error "PROSEG module does not support Conda. Please use Docker / Singularity / Podman instead."
}
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def platform = preset ? "${params.preset}" : ""

// check for preset values
if (!(platform in ['xenium', 'cosmx', 'merscope'])) {
error "${platform} is an invalid platform (preset) type. Please specify xenium, cosmx, or merscope"
}

"""
proseg \\
--${preset} \\
${transcripts} \\
--nthreads ${task.cpus} \\
--output-expected-counts expected-counts.csv.gz \\
--output-cell-metadata cell-metadata.csv.gz \\
--output-transcript-metadata transcript-metadata.csv.gz \\
--output-gene-metadata gene-metadata.csv.gz \\
--output-rates rates.csv.gz \\
--output-cell-polygons cell-polygons.geojson.gz \\
--output-cell-polygon-layers cell-polygons-layers.geojson.gz \\
--output-cell-hulls cell-hulls.geojson.gz \\
${args}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
proseg: \$(proseg --version | sed 's/proseg //')
END_VERSIONS
"""

stub:
// Exit if running this module with -profile conda / -profile mamba
if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) {
error "PROSEG module does not support Conda. Please use Docker / Singularity / Podman instead."
}
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"

"""
touch expected-counts.csv.gz
touch cell-metadata.csv.gz
touch transcript-metadata.csv.gz
touch gene-metadata.csv.gz
touch rates.csv.gz
touch cell-polygons.geojson.gz
touch cell-polygons-layers.geojson.gz
touch cell-hulls.geojson.gz

cat <<-END_VERSIONS > versions.yml
"${task.process}":
proseg: \$(proseg --version | sed 's/proseg //')
END_VERSIONS
"""
}
76 changes: 76 additions & 0 deletions modules/local/proseg/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: "proseg"
description: Probabilistic cell segmentation for in situ spatial transcriptomics
keywords:
- segmentation
- cell segmentation
- spatialomics
- probabilistic segmentation
- in situ spatial transcriptomics
tools:
- "proseg":
description: "Proseg (probabilistic segmentation) is a cell segmentation method for in situ spatial transcriptomics. Xenium, CosMx, and MERSCOPE platforms are currently supported."
homepage: "https://github.com/dcjones/proseg/tree/main"
documentation: "https://github.com/dcjones/proseg/blob/main/README.md"
tool_dev_url: "https://github.com/dcjones/proseg"
doi: ""
licence: ["GNU Public License"]

input:
- - meta:
type: map
description: |
Groovy Map containing run information
e.g. `[ id:'run_id']`
- transcripts:
type: file
description: |
File containing the transcript position
pattern: "transcripts.csv.gz"

output:
- - meta:
type: map
description: |
Groovy Map containing run information
e.g. `[ id:'run_id']`
- cell_polygons:
type: file
description: 2D polygons for each cell in GeoJSON format. These are flattened from 3D
pattern: "cell-polygons.geojson.gz"
- - expected_counts:
type: file
description: cell-by-gene count matrix
pattern: "expected-counts.csv.gz"
- - cell_metadata:
type: file
description: Cell centroids, volume, and other information
pattern: "cell-metadata.csv.gz"
- - transcript_metadata:
type: file
description: Transcript ids, genes, revised positions, assignment probability
pattern: "transcript-metadata.csv.gz"
- - gene_metadata:
type: file
description: Per-gene summary statistics
pattern: "gene-metadata.csv.gz"
- - rates:
type: file
description: Cell-by-gene Poisson rate parameters
pattern: "rates.csv.gz"
- - cell_polygon_layers:
type: file
description: A separate, non-overlapping cell polygon for each z-layer, preserving 3D segmentation
pattern: "cell-polygons-layers.geojson.gz"
- - cell_hulls:
type: file
description: Convex hulls around assigned transcripts
pattern: "cell-hulls.geojson.gz"
- - versions:
type: file
description: File containing software versions
pattern: "versions.yml"

authors:
- "@khersameesh24"
maintainers:
- "@khersameesh24"
53 changes: 53 additions & 0 deletions modules/local/proseg/preprocess/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
process PROSEG2BAYSOR {
tag "$meta.id"
label 'process_high'

container "nf-core/proseg:1.1.8"

input:
path(transcript_metadata)
path(cell_polygons)

output:
path("xr-transcript-metadata.csv"), emit: xr_metadata
path("xr-cell-polygons.geojson"), emit: xr_polygons

script:
// Exit if running this module with -profile conda / -profile mamba
if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) {
error "PROSEG2BAYSOR (preprocess) module does not support Conda. Please use Docker / Singularity / Podman instead."
}

"""
proseg-to-baysor \
${transcript_metadata} \
${cell_polygons} \
--output-transcript-metadata xr-transcript-metadata.csv \
--output-cell-polygons xr-cell-polygons.geojson

cat <<-END_VERSIONS > versions.yml
"${task.process}":
proseg: \$(proseg --version | sed 's/proseg //')
END_VERSIONS

"""

stub:
// Exit if running this module with -profile conda / -profile mamba
if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) {
error "PROSEG module does not support Conda. Please use Docker / Singularity / Podman instead."
}
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"

"""
touch xr-transcript-metadata.csv
touch xr-cell-polygons.geojson

cat <<-END_VERSIONS > versions.yml
"${task.process}":
proseg: \$(proseg --version | sed 's/proseg //')
END_VERSIONS
"""
}

77 changes: 77 additions & 0 deletions modules/local/proseg/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
nextflow_process {

name "Test Process PROSEG"
script "../main.nf"
process "PROSEG"

tag "modules"
tag "modules_nfcore"
tag "proseg"
tag "segmentation"
tag "cell_segmentation"


setup {
run("UNZIP") {
script "modules/nf-core/unzip/main.nf"
process {
"""
input[0] = [[], file('https://raw.githubusercontent.com/nf-core/test-datasets/spatialxe/Xenium_Prime_Mouse_Ileum_tiny_outs.zip', checkIfExists: true)]
"""
}
}
}

test("proseg - transcripts.csv") {

when {
process {
"""
input[0] = Channel.of([
[id: "test_run_proseg"],
]).combine(UNZIP.out.unzipped_archive.map { it[1] } + "/transcripts.csv")
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() },
{ assert file(process.out.expected_counts.get(0).get(1).find { file(it).name == 'expected-counts.csv.gz' }).exists() },
{ assert file(process.out.cell_metadata.get(0).get(1).find { file(it).name == 'cell-metadata.csv.gz' }).exists() },
{ assert file(process.out.transcript_metadata.get(0).get(1).find { file(it).name == 'transcript-metadata.csv.gz' }).exists() },
{ assert file(process.out.gene_metadata.get(0).get(1).find { file(it).name == 'gene-metadata.csv.gz' }).exists() },
{ assert file(process.out.rates.get(0).get(1).find { file(it).name == 'rates.csv.gz' }).exists() },
{ assert file(process.out.cell_polygons.get(0).get(1).find { file(it).name == 'cell-polygons.geojson.gz' }).exists() },
{ assert file(process.out.cell_polygons_layers.get(0).get(1).find { file(it).name == 'cell-polygons-layers.geojson.gz' }).exists() },
{ assert file(process.out.cell-hulls.get(0).get(1).find { file(it).name == 'cell-hulls.geojson.gz' }).exists() },
)
}

}

test("proseg stub") {

options "-stub"

when {
process {
"""
input[0] = Channel.of([
[id: "test_run_proseg"],
]).combine(UNZIP.out.unzipped_archive.map { it[1] } + "/transcripts.csv")
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}

}

}
2 changes: 2 additions & 0 deletions modules/local/proseg/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
proseg:
- "modules/nf-core/proseg/**"
58 changes: 58 additions & 0 deletions modules/nf-core/cellpose/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading