-
Notifications
You must be signed in to change notification settings - Fork 956
Add new module stainwarpy/extractchannel #9776
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tckumarasekara
wants to merge
7
commits into
nf-core:master
Choose a base branch
from
tckumarasekara:pr-extractchannel
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8164106
add module stainwarpy
tckumarasekara a9f4c1a
changed to bioconda package
tckumarasekara 3ede64c
tested on conda
tckumarasekara 19cb214
removed other modules
tckumarasekara 5ff6d82
corrected meta-yml
tckumarasekara fc3fe6f
Update meta.yml
tckumarasekara 2392ac0
added ontologies and singularity container
tckumarasekara File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json | ||
| channels: | ||
| - conda-forge | ||
| - bioconda | ||
| dependencies: | ||
| - bioconda::stainwarpy=0.2.3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| process STAINWARPY_EXTRACTCHANNEL { | ||
| tag "$meta.id" | ||
| label 'process_single' | ||
|
|
||
| conda "${moduleDir}/environment.yml" | ||
| container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
| 'oras://community.wave.seqera.io/library/stainwarpy:0.2.3--5966e23f2f7d254a' : | ||
| 'community.wave.seqera.io/library/stainwarpy:0.2.3--2c8b18a5e6d93e4a'}" | ||
|
|
||
| input: | ||
| tuple val(meta), path(multiplx_img) | ||
|
|
||
| output: | ||
| tuple val(meta), path("multiplexed_single_channel_img.ome.tif") , emit: single_ch_image | ||
| tuple val("${task.process}"), val('stainwarpy'), eval("stainwarpy --version | sed 's/.* //'"), emit: versions_stainwarpy_extractchannel, topic: versions | ||
|
|
||
| when: | ||
| task.ext.when == null || task.ext.when | ||
|
|
||
| script: | ||
| def args = task.ext.args ?: '' | ||
|
|
||
| """ | ||
| stainwarpy \\ | ||
| extract-channel \\ | ||
| ${multiplx_img} \\ | ||
| . \\ | ||
| ${args} | ||
| """ | ||
|
|
||
| stub: | ||
|
|
||
| """ | ||
| touch multiplexed_single_channel_img.ome.tif | ||
| """ | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| name: "stainwarpy_extractchannel" | ||
| description: Extract a single channel image from multiplexed tissue images using stainwarpy | ||
| keywords: | ||
| - image registration | ||
| - histology | ||
| - hne | ||
| - multiplexed | ||
| - channel extraction | ||
| tools: | ||
| - "stainwarpy": | ||
| description: "Register H&E stained and Multiplexed tissue images using feature-based image registration" | ||
| homepage: "https://github.com/tckumarasekara/stainwarpy" | ||
| documentation: "https://github.com/tckumarasekara/stainwarpy" | ||
| tool_dev_url: "https://github.com/tckumarasekara/stainwarpy" | ||
| licence: ["MIT License", "Apache-2.0"] | ||
| identifier: "" | ||
|
|
||
| input: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. `[ id:'sample1' ]` | ||
| - multiplx_img: | ||
| type: file | ||
| description: Multiplexed image file | ||
| pattern: "*.{ome.tif,ome.tiff,tif,tiff}" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_3727" | ||
| - edam: "http://edamontology.org/format_3591" | ||
|
|
||
| output: | ||
| single_ch_image: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. `[ id:'sample1' ]` | ||
| - "multiplexed_single_channel_img.ome.tif": | ||
| type: file | ||
| description: Single channel extracted image file in OME-TIFF format | ||
| pattern: "multiplexed_single_channel_img.ome.tif" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_3727" | ||
| versions_stainwarpy_extractchannel: | ||
| - - "${task.process}": | ||
| type: string | ||
| description: The name of the process | ||
| - "stainwarpy": | ||
| type: string | ||
| description: The name of the tool | ||
| - "stainwarpy --version | sed 's/.* //'": | ||
| type: eval | ||
| description: The expression to obtain the version of the tool | ||
|
|
||
| topics: | ||
| versions: | ||
| - - ${task.process}: | ||
| type: string | ||
| description: The name of the process | ||
| - stainwarpy: | ||
| type: string | ||
| description: The name of the tool | ||
| - stainwarpy --version | sed 's/.* //': | ||
| type: eval | ||
| description: The expression to obtain the version of the tool | ||
| authors: | ||
| - "@tckumarasekara" | ||
| maintainers: | ||
| - "@tckumarasekara" |
70 changes: 70 additions & 0 deletions
70
modules/nf-core/stainwarpy/extractchannel/tests/main.nf.test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| nextflow_process { | ||
|
|
||
| name "Test Process STAINWARPY_EXTRACTCHANNEL" | ||
| script "../main.nf" | ||
| process "STAINWARPY_EXTRACTCHANNEL" | ||
|
|
||
| tag "modules" | ||
| tag "modules_nfcore" | ||
| tag "stainwarpy" | ||
| tag "stainwarpy/extractchannel" | ||
|
|
||
| config "./nextflow.config" | ||
|
|
||
| test("colon_tissue_local - ome.tif") { | ||
|
|
||
| when { | ||
| params { | ||
| modules_args = "--channel-idx 0" | ||
| } | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'sample1'], | ||
| file(params.modules_testdata_base_path + 'imaging/hne_multiplexed/multiplexed_image_colon.ome.tif', checkIfExists: true) | ||
| ] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot( | ||
| file(process.out.single_ch_image.get(0).get(1)).exists(), | ||
| process.out.findAll { key, val -> key.startsWith("versions")} | ||
| ).match() | ||
| } | ||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| test("colon_tissue_local - ome.tif - stub") { | ||
|
|
||
| options "-stub" | ||
|
|
||
| when { | ||
| params { | ||
| modules_args = null | ||
| } | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'sample1'], | ||
| file(params.modules_testdata_base_path + 'imaging/hne_multiplexed/multiplexed_image_colon.ome.tif', checkIfExists: true) | ||
| ] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| { assert snapshot( | ||
| process.out.single_ch_image, | ||
| process.out.findAll { key, val -> key.startsWith("versions")} | ||
| ).match() } | ||
| } | ||
|
|
||
| } | ||
|
|
||
| } | ||
47 changes: 47 additions & 0 deletions
47
modules/nf-core/stainwarpy/extractchannel/tests/main.nf.test.snap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| { | ||
| "colon_tissue_local - ome.tif": { | ||
| "content": [ | ||
| true, | ||
| { | ||
| "versions_stainwarpy_extractchannel": [ | ||
| [ | ||
| "STAINWARPY_EXTRACTCHANNEL", | ||
| "stainwarpy", | ||
| "0.2.3" | ||
| ] | ||
| ] | ||
| } | ||
| ], | ||
| "meta": { | ||
| "nf-test": "0.9.3", | ||
| "nextflow": "25.10.2" | ||
| }, | ||
| "timestamp": "2026-01-26T12:55:18.107266402" | ||
| }, | ||
| "colon_tissue_local - ome.tif - stub": { | ||
| "content": [ | ||
| [ | ||
| [ | ||
| { | ||
| "id": "sample1" | ||
| }, | ||
| "multiplexed_single_channel_img.ome.tif:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
| ] | ||
| ], | ||
| { | ||
| "versions_stainwarpy_extractchannel": [ | ||
| [ | ||
| "STAINWARPY_EXTRACTCHANNEL", | ||
| "stainwarpy", | ||
| "0.2.3" | ||
| ] | ||
| ] | ||
| } | ||
| ], | ||
| "meta": { | ||
| "nf-test": "0.9.3", | ||
| "nextflow": "25.10.2" | ||
| }, | ||
| "timestamp": "2026-01-26T12:55:26.070540691" | ||
| } | ||
| } |
5 changes: 5 additions & 0 deletions
5
modules/nf-core/stainwarpy/extractchannel/tests/nextflow.config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| process { | ||
| withName: STAINWARPY_EXTRACTCHANNEL { | ||
| ext.args = params.modules_args ?: '' | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the file in question indeterministic? Is there any data in the channel that is not checked here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, yes, the output file is non-deterministic between runs due to metadata (ef: UUIDs) and minor floating-point differences. This is the case for the other modules also. This module emits just one file in a tuple.