From a0a51be61d4708277672f1990f3c3e5613b240ee Mon Sep 17 00:00:00 2001 From: tckumarasekara Date: Mon, 26 Jan 2026 10:30:05 +0100 Subject: [PATCH 1/5] add module stainwarpy --- .../stainwarpy/extractchannel/environment.yml | 4 + .../nf-core/stainwarpy/extractchannel/main.nf | 33 ++++++ .../stainwarpy/extractchannel/meta.yml | 67 +++++++++++ .../extractchannel/tests/main.nf.test | 70 ++++++++++++ .../extractchannel/tests/main.nf.test.snap | 47 ++++++++ .../extractchannel/tests/nextflow.config | 5 + .../stainwarpy/register/environment.yml | 4 + modules/nf-core/stainwarpy/register/main.nf | 43 +++++++ modules/nf-core/stainwarpy/register/meta.yml | 106 ++++++++++++++++++ .../stainwarpy/register/tests/main.nf.test | 86 ++++++++++++++ .../register/tests/main.nf.test.snap | 65 +++++++++++ .../stainwarpy/register/tests/nextflow.config | 5 + .../transformsegmask/environment.yml | 4 + .../stainwarpy/transformsegmask/main.nf | 43 +++++++ .../stainwarpy/transformsegmask/meta.yml | 105 +++++++++++++++++ .../transformsegmask/tests/main.nf.test | 98 ++++++++++++++++ .../transformsegmask/tests/main.nf.test.snap | 47 ++++++++ .../transformsegmask/tests/nextflow.config | 5 + 18 files changed, 837 insertions(+) create mode 100644 modules/nf-core/stainwarpy/extractchannel/environment.yml create mode 100644 modules/nf-core/stainwarpy/extractchannel/main.nf create mode 100644 modules/nf-core/stainwarpy/extractchannel/meta.yml create mode 100644 modules/nf-core/stainwarpy/extractchannel/tests/main.nf.test create mode 100644 modules/nf-core/stainwarpy/extractchannel/tests/main.nf.test.snap create mode 100644 modules/nf-core/stainwarpy/extractchannel/tests/nextflow.config create mode 100644 modules/nf-core/stainwarpy/register/environment.yml create mode 100644 modules/nf-core/stainwarpy/register/main.nf create mode 100644 modules/nf-core/stainwarpy/register/meta.yml create mode 100644 modules/nf-core/stainwarpy/register/tests/main.nf.test create mode 100644 modules/nf-core/stainwarpy/register/tests/main.nf.test.snap create mode 100644 modules/nf-core/stainwarpy/register/tests/nextflow.config create mode 100644 modules/nf-core/stainwarpy/transformsegmask/environment.yml create mode 100644 modules/nf-core/stainwarpy/transformsegmask/main.nf create mode 100644 modules/nf-core/stainwarpy/transformsegmask/meta.yml create mode 100644 modules/nf-core/stainwarpy/transformsegmask/tests/main.nf.test create mode 100644 modules/nf-core/stainwarpy/transformsegmask/tests/main.nf.test.snap create mode 100644 modules/nf-core/stainwarpy/transformsegmask/tests/nextflow.config diff --git a/modules/nf-core/stainwarpy/extractchannel/environment.yml b/modules/nf-core/stainwarpy/extractchannel/environment.yml new file mode 100644 index 000000000000..8abd12c0421e --- /dev/null +++ b/modules/nf-core/stainwarpy/extractchannel/environment.yml @@ -0,0 +1,4 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json +channels: [] +dependencies: [] diff --git a/modules/nf-core/stainwarpy/extractchannel/main.nf b/modules/nf-core/stainwarpy/extractchannel/main.nf new file mode 100644 index 000000000000..79784a86edc9 --- /dev/null +++ b/modules/nf-core/stainwarpy/extractchannel/main.nf @@ -0,0 +1,33 @@ +process STAINWARPY_EXTRACTCHANNEL { + tag "$meta.id" + label 'process_single' + + container "community.wave.seqera.io/library/pip_stainwarpy:d2ff09a87c79896b" + + 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 + """ +} diff --git a/modules/nf-core/stainwarpy/extractchannel/meta.yml b/modules/nf-core/stainwarpy/extractchannel/meta.yml new file mode 100644 index 000000000000..3333e448b506 --- /dev/null +++ b/modules/nf-core/stainwarpy/extractchannel/meta.yml @@ -0,0 +1,67 @@ +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: [] + +output: + reg_image: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - single_ch_image: + type: file + description: Single channel extracted image file in OME-TIFF format + pattern: "multiplexed_single_channel_img.ome.tif" + ontologies: [] + 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" diff --git a/modules/nf-core/stainwarpy/extractchannel/tests/main.nf.test b/modules/nf-core/stainwarpy/extractchannel/tests/main.nf.test new file mode 100644 index 000000000000..46b501628df2 --- /dev/null +++ b/modules/nf-core/stainwarpy/extractchannel/tests/main.nf.test @@ -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() } + } + + } + +} diff --git a/modules/nf-core/stainwarpy/extractchannel/tests/main.nf.test.snap b/modules/nf-core/stainwarpy/extractchannel/tests/main.nf.test.snap new file mode 100644 index 000000000000..98b6c04a52da --- /dev/null +++ b/modules/nf-core/stainwarpy/extractchannel/tests/main.nf.test.snap @@ -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-20T13:17:39.703541244" + }, + "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-20T13:17:46.598775214" + } +} \ No newline at end of file diff --git a/modules/nf-core/stainwarpy/extractchannel/tests/nextflow.config b/modules/nf-core/stainwarpy/extractchannel/tests/nextflow.config new file mode 100644 index 000000000000..5aa83ed5de15 --- /dev/null +++ b/modules/nf-core/stainwarpy/extractchannel/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: STAINWARPY_EXTRACTCHANNEL { + ext.args = params.modules_args ?: '' + } +} diff --git a/modules/nf-core/stainwarpy/register/environment.yml b/modules/nf-core/stainwarpy/register/environment.yml new file mode 100644 index 000000000000..8abd12c0421e --- /dev/null +++ b/modules/nf-core/stainwarpy/register/environment.yml @@ -0,0 +1,4 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json +channels: [] +dependencies: [] diff --git a/modules/nf-core/stainwarpy/register/main.nf b/modules/nf-core/stainwarpy/register/main.nf new file mode 100644 index 000000000000..b4c2083edcc1 --- /dev/null +++ b/modules/nf-core/stainwarpy/register/main.nf @@ -0,0 +1,43 @@ +process STAINWARPY_REGISTER { + tag "$meta.id" + label 'process_single' + + container "community.wave.seqera.io/library/pip_stainwarpy:d2ff09a87c79896b" + + input: + tuple val(meta), path(hne_img) + tuple val(meta2), path(multiplx_img) + val fixed_img + val final_sz + + output: + tuple val(meta), path("0_final_channel_image.ome.tif") , emit: reg_image + tuple val(meta), path("registration_metrics_tform_map.json") , emit: reg_metrics_tform + tuple val(meta), path("feature_based_transformation_map.npy") , emit: tform_map + tuple val("${task.process}"), val('stainwarpy'), eval("stainwarpy --version | sed 's/.* //'"), emit: versions_stainwarpy_register, topic: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + + """ + stainwarpy \\ + register \\ + ${multiplx_img} \\ + ${hne_img} \\ + . \\ + ${fixed_img} \\ + ${final_sz} \\ + ${args} + """ + + stub: + + """ + touch 0_final_channel_image.ome.tif + touch registration_metrics_tform_map.json + touch feature_based_transformation_map.npy + """ +} diff --git a/modules/nf-core/stainwarpy/register/meta.yml b/modules/nf-core/stainwarpy/register/meta.yml new file mode 100644 index 000000000000..32cdc417b2cc --- /dev/null +++ b/modules/nf-core/stainwarpy/register/meta.yml @@ -0,0 +1,106 @@ +name: "stainwarpy_register" +description: "Register H&E stained and Multiplexed tissue images using feature-based image registration" +keywords: + - image registration + - histology + - hne + - multiplexed +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' ]` + - hne_img: + type: file + description: H&E stained image file + pattern: "*.{ome.tif,ome.tiff,tif,tiff}" + ontologies: [] + - - meta2: + 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: [] + - fixed_img: + type: string + description: Which image to use as fixed image for registration. Options - 'hne' or 'multiplexed' + ontologies: [] + - final_sz: + type: string + description: In which pixel size to output the registered image and segmentation mask. Options - 'hne' or 'multiplexed' + ontologies: [] + +output: + reg_image: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - "0_final_channel_image.ome.tif": + type: file + description: Registered final channel image in OME-TIFF format + pattern: "0_final_channel_image.ome.tif" + ontologies: [] + reg_metrics_tform: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - "registration_metrics_tform_map.json": + type: file + description: Registration metrics and transformation map in JSON format + pattern: "registration_metrics_tform_map.json" + ontologies: [] + tform_map: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - "feature_based_transformation_map.npy": + type: file + description: Feature-based transformation map in NPY format + pattern: "feature_based_transformation_map.npy" + ontologies: [] + versions_stainwarpy_register: + - - "${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" diff --git a/modules/nf-core/stainwarpy/register/tests/main.nf.test b/modules/nf-core/stainwarpy/register/tests/main.nf.test new file mode 100644 index 000000000000..d73bd9bf738a --- /dev/null +++ b/modules/nf-core/stainwarpy/register/tests/main.nf.test @@ -0,0 +1,86 @@ +nextflow_process { + + name "Test Process STAINWARPY_REGISTER" + script "../main.nf" + process "STAINWARPY_REGISTER" + + tag "modules" + tag "modules_nfcore" + tag "stainwarpy" + tag "stainwarpy/register" + + config "./nextflow.config" + + test("colon_tissue_local - ome.tif") { + + when { + params { + modules_args = "--feature-tform similarity" + } + process { + """ + input[0] = [ + [ id:'sample1'], + file(params.modules_testdata_base_path + 'imaging/hne_multiplexed/hne_image_colon.ome.tif', checkIfExists: true) + ] + input[1] = [ + [ id:'sample1'], + file(params.modules_testdata_base_path + 'imaging/hne_multiplexed/multiplexed_single_channel_img.ome.tif', checkIfExists: true) + ] + input[2] = 'multiplexed' + input[3] = 'multiplexed' + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.reg_image.get(0).get(1)).exists(), + file(process.out.reg_metrics_tform.get(0).get(1)).exists(), + file(process.out.tform_map.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/hne_image_colon.ome.tif', checkIfExists: true) + ] + input[1] = [ + [ id:'sample1'], + file(params.modules_testdata_base_path + 'imaging/hne_multiplexed/multiplexed_single_channel_img.ome.tif', checkIfExists: true) + ] + input[2] = 'multiplexed' + input[3] = 'multiplexed' + """ + } + } + + then { + { assert snapshot( + process.out.reg_image, + process.out.reg_metrics_tform, + process.out.tform_map, + process.out.findAll { key, val -> key.startsWith("versions")} + ).match() } + } + + } + +} diff --git a/modules/nf-core/stainwarpy/register/tests/main.nf.test.snap b/modules/nf-core/stainwarpy/register/tests/main.nf.test.snap new file mode 100644 index 000000000000..05eea7f89299 --- /dev/null +++ b/modules/nf-core/stainwarpy/register/tests/main.nf.test.snap @@ -0,0 +1,65 @@ +{ + "colon_tissue_local - ome.tif": { + "content": [ + true, + true, + true, + { + "versions_stainwarpy_register": [ + [ + "STAINWARPY_REGISTER", + "stainwarpy", + "0.2.3" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.2" + }, + "timestamp": "2026-01-20T13:25:49.750352374" + }, + "colon_tissue_local - ome.tif - stub": { + "content": [ + [ + [ + { + "id": "sample1" + }, + "0_final_channel_image.ome.tif:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + [ + [ + { + "id": "sample1" + }, + "registration_metrics_tform_map.json:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + [ + [ + { + "id": "sample1" + }, + "feature_based_transformation_map.npy:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + { + "versions_stainwarpy_register": [ + [ + "STAINWARPY_REGISTER", + "stainwarpy", + "0.2.3" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.2" + }, + "timestamp": "2026-01-20T13:25:56.647172135" + } +} \ No newline at end of file diff --git a/modules/nf-core/stainwarpy/register/tests/nextflow.config b/modules/nf-core/stainwarpy/register/tests/nextflow.config new file mode 100644 index 000000000000..166c3c2b592b --- /dev/null +++ b/modules/nf-core/stainwarpy/register/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: STAINWARPY_REGISTER { + ext.args = params.modules_args ?: '' + } +} diff --git a/modules/nf-core/stainwarpy/transformsegmask/environment.yml b/modules/nf-core/stainwarpy/transformsegmask/environment.yml new file mode 100644 index 000000000000..8abd12c0421e --- /dev/null +++ b/modules/nf-core/stainwarpy/transformsegmask/environment.yml @@ -0,0 +1,4 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json +channels: [] +dependencies: [] diff --git a/modules/nf-core/stainwarpy/transformsegmask/main.nf b/modules/nf-core/stainwarpy/transformsegmask/main.nf new file mode 100644 index 000000000000..9314e83890cf --- /dev/null +++ b/modules/nf-core/stainwarpy/transformsegmask/main.nf @@ -0,0 +1,43 @@ +process STAINWARPY_TRANSFORMSEGMASK { + tag "$meta.id" + label 'process_single' + + container "community.wave.seqera.io/library/pip_stainwarpy:d2ff09a87c79896b" + + input: + tuple val(meta), path(hne_img) + tuple val(meta2), path(multiplx_img) + tuple val(meta3), path(seg_mask) + tuple val(meta4), path(tform_map) + val fixed_img + val final_sz + + output: + tuple val(meta), path("transformed_segmentation_mask.ome.tif") , emit: transformed_seg_mask + tuple val("${task.process}"), val('stainwarpy'), eval("stainwarpy --version | sed 's/.* //'"), emit: versions_stainwarpy_transformsegmask, topic: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + + """ + stainwarpy \\ + transform-seg-mask \\ + ${seg_mask} \\ + ${multiplx_img} \\ + ${hne_img} \\ + . \\ + ${tform_map} \\ + ${fixed_img} \\ + ${final_sz} \\ + ${args} + """ + + stub: + + """ + touch transformed_segmentation_mask.ome.tif + """ +} diff --git a/modules/nf-core/stainwarpy/transformsegmask/meta.yml b/modules/nf-core/stainwarpy/transformsegmask/meta.yml new file mode 100644 index 000000000000..b078dc7503fe --- /dev/null +++ b/modules/nf-core/stainwarpy/transformsegmask/meta.yml @@ -0,0 +1,105 @@ +name: "stainwarpy_transformsegmask" +description: Transform segmentation mask of multiplexed or H&E stained tissue images using stainwarpy +keywords: + - image registration + - histology + - hne + - multiplexed + - segmentation mask +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' ]` + - hne_img: + type: file + description: H&E stained image file + pattern: "*.{ome.tif,ome.tiff,tif,tiff}" + ontologies: [] + - - meta2: + 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: [] + - - meta3: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - seg_mask: + type: file + description: Segmentation mask file + pattern: "*.{ome.tif,ome.tiff,tif,tiff,npy}" + ontologies: [] + - - meta4: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - tform_map: + type: file + description: Transformation map file + pattern: "*.npy" + ontologies: [] + - fixed_img: + type: string + description: Which image to use as fixed image for registration. Options - 'hne' or 'multiplexed' + ontologies: [] + - final_sz: + type: string + description: In which pixel size to output the registered image and segmentation mask. Options - 'hne' or 'multiplexed' + ontologies: [] + +output: + transformed_segmentation_mask: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - "transformed_segmentation_mask.ome.tif": + type: file + description: Transformed segmentation mask in OME-TIFF format + pattern: "transformed_segmentation_mask.ome.tif" + ontologies: [] + versions_stainwarpy_transformsegmask: + - - "${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" diff --git a/modules/nf-core/stainwarpy/transformsegmask/tests/main.nf.test b/modules/nf-core/stainwarpy/transformsegmask/tests/main.nf.test new file mode 100644 index 000000000000..0cbc43043779 --- /dev/null +++ b/modules/nf-core/stainwarpy/transformsegmask/tests/main.nf.test @@ -0,0 +1,98 @@ +nextflow_process { + + name "Test Process STAINWARPY_TRANSFORMSEGMASK" + script "../main.nf" + process "STAINWARPY_TRANSFORMSEGMASK" + + tag "modules" + tag "modules_nfcore" + tag "stainwarpy" + tag "stainwarpy/transformsegmask" + + config "./nextflow.config" + + test("colon_tissue_local - ome.tif") { + + when { + params { + modules_args = "" + } + process { + """ + input[0] = [ + [ id:'sample1'], + file(params.modules_testdata_base_path + 'imaging/hne_multiplexed/hne_image_colon.ome.tif', checkIfExists: true) + ] + input[1] = [ + [ id:'sample1'], + file(params.modules_testdata_base_path + 'imaging/hne_multiplexed/multiplexed_single_channel_img.ome.tif', checkIfExists: true) + ] + input[2] = [ + [ id:'sample1'], + file(params.modules_testdata_base_path + 'imaging/hne_multiplexed/hne_segmentation_mask.ome.tif', checkIfExists: true) + ] + input[3] = [ + [ id:'sample1'], + file(params.modules_testdata_base_path + 'imaging/hne_multiplexed/feature_based_transformation_map.npy', checkIfExists: true) + ] + input[4] = 'multiplexed' + input[5] = 'multiplexed' + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.transformed_seg_mask.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/hne_image_colon.ome.tif', checkIfExists: true) + ] + input[1] = [ + [ id:'sample1'], + file(params.modules_testdata_base_path + 'imaging/hne_multiplexed/multiplexed_single_channel_img.ome.tif', checkIfExists: true) + ] + input[2] = [ + [ id:'sample1'], + file(params.modules_testdata_base_path + 'imaging/hne_multiplexed/hne_segmentation_mask.ome.tif', checkIfExists: true) + ] + input[3] = [ + [ id:'sample1'], + file(params.modules_testdata_base_path + 'imaging/hne_multiplexed/feature_based_transformation_map.npy', checkIfExists: true) + ] + input[4] = 'multiplexed' + input[5] = 'multiplexed' + """ + } + } + + then { + { assert snapshot( + process.out.transformed_seg_mask, + process.out.findAll { key, val -> key.startsWith("versions")} + ).match() } + } + + } + +} diff --git a/modules/nf-core/stainwarpy/transformsegmask/tests/main.nf.test.snap b/modules/nf-core/stainwarpy/transformsegmask/tests/main.nf.test.snap new file mode 100644 index 000000000000..c4c34ef0534d --- /dev/null +++ b/modules/nf-core/stainwarpy/transformsegmask/tests/main.nf.test.snap @@ -0,0 +1,47 @@ +{ + "colon_tissue_local - ome.tif": { + "content": [ + true, + { + "versions_stainwarpy_transformsegmask": [ + [ + "STAINWARPY_TRANSFORMSEGMASK", + "stainwarpy", + "0.2.3" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.2" + }, + "timestamp": "2026-01-20T13:38:10.728598964" + }, + "colon_tissue_local - ome.tif - stub": { + "content": [ + [ + [ + { + "id": "sample1" + }, + "transformed_segmentation_mask.ome.tif:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + { + "versions_stainwarpy_transformsegmask": [ + [ + "STAINWARPY_TRANSFORMSEGMASK", + "stainwarpy", + "0.2.3" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.2" + }, + "timestamp": "2026-01-20T13:38:17.92763081" + } +} \ No newline at end of file diff --git a/modules/nf-core/stainwarpy/transformsegmask/tests/nextflow.config b/modules/nf-core/stainwarpy/transformsegmask/tests/nextflow.config new file mode 100644 index 000000000000..cf7c6a42a257 --- /dev/null +++ b/modules/nf-core/stainwarpy/transformsegmask/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: STAINWARPY_TRANSFORMSEGMASK { + ext.args = params.modules_args ?: '' + } +} From 7b240da80314c9a55ea23f5dd41f658c226ca7b7 Mon Sep 17 00:00:00 2001 From: tckumarasekara Date: Mon, 26 Jan 2026 10:49:53 +0100 Subject: [PATCH 2/5] changed to bioconda package --- modules/nf-core/stainwarpy/extractchannel/main.nf | 2 +- modules/nf-core/stainwarpy/register/main.nf | 2 +- modules/nf-core/stainwarpy/transformsegmask/main.nf | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/nf-core/stainwarpy/extractchannel/main.nf b/modules/nf-core/stainwarpy/extractchannel/main.nf index 79784a86edc9..1d44d3b02465 100644 --- a/modules/nf-core/stainwarpy/extractchannel/main.nf +++ b/modules/nf-core/stainwarpy/extractchannel/main.nf @@ -2,7 +2,7 @@ process STAINWARPY_EXTRACTCHANNEL { tag "$meta.id" label 'process_single' - container "community.wave.seqera.io/library/pip_stainwarpy:d2ff09a87c79896b" + container "community.wave.seqera.io/library/stainwarpy:0.2.3--2c8b18a5e6d93e4a" input: tuple val(meta), path(multiplx_img) diff --git a/modules/nf-core/stainwarpy/register/main.nf b/modules/nf-core/stainwarpy/register/main.nf index b4c2083edcc1..4f8483dc7e8d 100644 --- a/modules/nf-core/stainwarpy/register/main.nf +++ b/modules/nf-core/stainwarpy/register/main.nf @@ -2,7 +2,7 @@ process STAINWARPY_REGISTER { tag "$meta.id" label 'process_single' - container "community.wave.seqera.io/library/pip_stainwarpy:d2ff09a87c79896b" + container "community.wave.seqera.io/library/stainwarpy:0.2.3--2c8b18a5e6d93e4a" input: tuple val(meta), path(hne_img) diff --git a/modules/nf-core/stainwarpy/transformsegmask/main.nf b/modules/nf-core/stainwarpy/transformsegmask/main.nf index 9314e83890cf..d3d74c220d9a 100644 --- a/modules/nf-core/stainwarpy/transformsegmask/main.nf +++ b/modules/nf-core/stainwarpy/transformsegmask/main.nf @@ -2,7 +2,7 @@ process STAINWARPY_TRANSFORMSEGMASK { tag "$meta.id" label 'process_single' - container "community.wave.seqera.io/library/pip_stainwarpy:d2ff09a87c79896b" + container "community.wave.seqera.io/library/stainwarpy:0.2.3--2c8b18a5e6d93e4a" input: tuple val(meta), path(hne_img) From 0b0483682a4ae758908b87aa0cbc35dee0ad3067 Mon Sep 17 00:00:00 2001 From: tckumarasekara Date: Mon, 26 Jan 2026 12:25:02 +0100 Subject: [PATCH 3/5] tested on conda --- modules/nf-core/stainwarpy/extractchannel/environment.yml | 7 +++++-- modules/nf-core/stainwarpy/extractchannel/main.nf | 1 + modules/nf-core/stainwarpy/register/environment.yml | 7 +++++-- modules/nf-core/stainwarpy/register/main.nf | 1 + .../nf-core/stainwarpy/transformsegmask/environment.yml | 7 +++++-- modules/nf-core/stainwarpy/transformsegmask/main.nf | 1 + 6 files changed, 18 insertions(+), 6 deletions(-) diff --git a/modules/nf-core/stainwarpy/extractchannel/environment.yml b/modules/nf-core/stainwarpy/extractchannel/environment.yml index 8abd12c0421e..94ec10130bdd 100644 --- a/modules/nf-core/stainwarpy/extractchannel/environment.yml +++ b/modules/nf-core/stainwarpy/extractchannel/environment.yml @@ -1,4 +1,7 @@ --- # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json -channels: [] -dependencies: [] +channels: + - conda-forge + - bioconda +dependencies: + - bioconda::stainwarpy=0.2.3 diff --git a/modules/nf-core/stainwarpy/extractchannel/main.nf b/modules/nf-core/stainwarpy/extractchannel/main.nf index 1d44d3b02465..11b001c8d2b9 100644 --- a/modules/nf-core/stainwarpy/extractchannel/main.nf +++ b/modules/nf-core/stainwarpy/extractchannel/main.nf @@ -2,6 +2,7 @@ process STAINWARPY_EXTRACTCHANNEL { tag "$meta.id" label 'process_single' + conda "${moduleDir}/environment.yml" container "community.wave.seqera.io/library/stainwarpy:0.2.3--2c8b18a5e6d93e4a" input: diff --git a/modules/nf-core/stainwarpy/register/environment.yml b/modules/nf-core/stainwarpy/register/environment.yml index 8abd12c0421e..94ec10130bdd 100644 --- a/modules/nf-core/stainwarpy/register/environment.yml +++ b/modules/nf-core/stainwarpy/register/environment.yml @@ -1,4 +1,7 @@ --- # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json -channels: [] -dependencies: [] +channels: + - conda-forge + - bioconda +dependencies: + - bioconda::stainwarpy=0.2.3 diff --git a/modules/nf-core/stainwarpy/register/main.nf b/modules/nf-core/stainwarpy/register/main.nf index 4f8483dc7e8d..5617b314904c 100644 --- a/modules/nf-core/stainwarpy/register/main.nf +++ b/modules/nf-core/stainwarpy/register/main.nf @@ -2,6 +2,7 @@ process STAINWARPY_REGISTER { tag "$meta.id" label 'process_single' + conda "${moduleDir}/environment.yml" container "community.wave.seqera.io/library/stainwarpy:0.2.3--2c8b18a5e6d93e4a" input: diff --git a/modules/nf-core/stainwarpy/transformsegmask/environment.yml b/modules/nf-core/stainwarpy/transformsegmask/environment.yml index 8abd12c0421e..94ec10130bdd 100644 --- a/modules/nf-core/stainwarpy/transformsegmask/environment.yml +++ b/modules/nf-core/stainwarpy/transformsegmask/environment.yml @@ -1,4 +1,7 @@ --- # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json -channels: [] -dependencies: [] +channels: + - conda-forge + - bioconda +dependencies: + - bioconda::stainwarpy=0.2.3 diff --git a/modules/nf-core/stainwarpy/transformsegmask/main.nf b/modules/nf-core/stainwarpy/transformsegmask/main.nf index d3d74c220d9a..50d4a1ca3ad2 100644 --- a/modules/nf-core/stainwarpy/transformsegmask/main.nf +++ b/modules/nf-core/stainwarpy/transformsegmask/main.nf @@ -2,6 +2,7 @@ process STAINWARPY_TRANSFORMSEGMASK { tag "$meta.id" label 'process_single' + conda "${moduleDir}/environment.yml" container "community.wave.seqera.io/library/stainwarpy:0.2.3--2c8b18a5e6d93e4a" input: From 5b0d710def2a469692f06326e29bb8218e950cc4 Mon Sep 17 00:00:00 2001 From: tckumarasekara Date: Mon, 26 Jan 2026 14:19:19 +0100 Subject: [PATCH 4/5] removed other modules --- .../stainwarpy/extractchannel/environment.yml | 7 -- .../nf-core/stainwarpy/extractchannel/main.nf | 34 ------ .../stainwarpy/extractchannel/meta.yml | 67 ----------- .../extractchannel/tests/main.nf.test | 70 ------------ .../extractchannel/tests/main.nf.test.snap | 47 -------- .../extractchannel/tests/nextflow.config | 5 - .../stainwarpy/register/environment.yml | 7 -- modules/nf-core/stainwarpy/register/main.nf | 44 -------- modules/nf-core/stainwarpy/register/meta.yml | 106 ------------------ .../stainwarpy/register/tests/main.nf.test | 86 -------------- .../register/tests/main.nf.test.snap | 65 ----------- .../stainwarpy/register/tests/nextflow.config | 5 - .../stainwarpy/transformsegmask/meta.yml | 2 +- 13 files changed, 1 insertion(+), 544 deletions(-) delete mode 100644 modules/nf-core/stainwarpy/extractchannel/environment.yml delete mode 100644 modules/nf-core/stainwarpy/extractchannel/main.nf delete mode 100644 modules/nf-core/stainwarpy/extractchannel/meta.yml delete mode 100644 modules/nf-core/stainwarpy/extractchannel/tests/main.nf.test delete mode 100644 modules/nf-core/stainwarpy/extractchannel/tests/main.nf.test.snap delete mode 100644 modules/nf-core/stainwarpy/extractchannel/tests/nextflow.config delete mode 100644 modules/nf-core/stainwarpy/register/environment.yml delete mode 100644 modules/nf-core/stainwarpy/register/main.nf delete mode 100644 modules/nf-core/stainwarpy/register/meta.yml delete mode 100644 modules/nf-core/stainwarpy/register/tests/main.nf.test delete mode 100644 modules/nf-core/stainwarpy/register/tests/main.nf.test.snap delete mode 100644 modules/nf-core/stainwarpy/register/tests/nextflow.config diff --git a/modules/nf-core/stainwarpy/extractchannel/environment.yml b/modules/nf-core/stainwarpy/extractchannel/environment.yml deleted file mode 100644 index 94ec10130bdd..000000000000 --- a/modules/nf-core/stainwarpy/extractchannel/environment.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -# 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 diff --git a/modules/nf-core/stainwarpy/extractchannel/main.nf b/modules/nf-core/stainwarpy/extractchannel/main.nf deleted file mode 100644 index 11b001c8d2b9..000000000000 --- a/modules/nf-core/stainwarpy/extractchannel/main.nf +++ /dev/null @@ -1,34 +0,0 @@ -process STAINWARPY_EXTRACTCHANNEL { - tag "$meta.id" - label 'process_single' - - conda "${moduleDir}/environment.yml" - container "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 - """ -} diff --git a/modules/nf-core/stainwarpy/extractchannel/meta.yml b/modules/nf-core/stainwarpy/extractchannel/meta.yml deleted file mode 100644 index 3333e448b506..000000000000 --- a/modules/nf-core/stainwarpy/extractchannel/meta.yml +++ /dev/null @@ -1,67 +0,0 @@ -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: [] - -output: - reg_image: - - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. `[ id:'sample1' ]` - - single_ch_image: - type: file - description: Single channel extracted image file in OME-TIFF format - pattern: "multiplexed_single_channel_img.ome.tif" - ontologies: [] - 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" diff --git a/modules/nf-core/stainwarpy/extractchannel/tests/main.nf.test b/modules/nf-core/stainwarpy/extractchannel/tests/main.nf.test deleted file mode 100644 index 46b501628df2..000000000000 --- a/modules/nf-core/stainwarpy/extractchannel/tests/main.nf.test +++ /dev/null @@ -1,70 +0,0 @@ -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() } - } - - } - -} diff --git a/modules/nf-core/stainwarpy/extractchannel/tests/main.nf.test.snap b/modules/nf-core/stainwarpy/extractchannel/tests/main.nf.test.snap deleted file mode 100644 index 98b6c04a52da..000000000000 --- a/modules/nf-core/stainwarpy/extractchannel/tests/main.nf.test.snap +++ /dev/null @@ -1,47 +0,0 @@ -{ - "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-20T13:17:39.703541244" - }, - "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-20T13:17:46.598775214" - } -} \ No newline at end of file diff --git a/modules/nf-core/stainwarpy/extractchannel/tests/nextflow.config b/modules/nf-core/stainwarpy/extractchannel/tests/nextflow.config deleted file mode 100644 index 5aa83ed5de15..000000000000 --- a/modules/nf-core/stainwarpy/extractchannel/tests/nextflow.config +++ /dev/null @@ -1,5 +0,0 @@ -process { - withName: STAINWARPY_EXTRACTCHANNEL { - ext.args = params.modules_args ?: '' - } -} diff --git a/modules/nf-core/stainwarpy/register/environment.yml b/modules/nf-core/stainwarpy/register/environment.yml deleted file mode 100644 index 94ec10130bdd..000000000000 --- a/modules/nf-core/stainwarpy/register/environment.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -# 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 diff --git a/modules/nf-core/stainwarpy/register/main.nf b/modules/nf-core/stainwarpy/register/main.nf deleted file mode 100644 index 5617b314904c..000000000000 --- a/modules/nf-core/stainwarpy/register/main.nf +++ /dev/null @@ -1,44 +0,0 @@ -process STAINWARPY_REGISTER { - tag "$meta.id" - label 'process_single' - - conda "${moduleDir}/environment.yml" - container "community.wave.seqera.io/library/stainwarpy:0.2.3--2c8b18a5e6d93e4a" - - input: - tuple val(meta), path(hne_img) - tuple val(meta2), path(multiplx_img) - val fixed_img - val final_sz - - output: - tuple val(meta), path("0_final_channel_image.ome.tif") , emit: reg_image - tuple val(meta), path("registration_metrics_tform_map.json") , emit: reg_metrics_tform - tuple val(meta), path("feature_based_transformation_map.npy") , emit: tform_map - tuple val("${task.process}"), val('stainwarpy'), eval("stainwarpy --version | sed 's/.* //'"), emit: versions_stainwarpy_register, topic: versions - - when: - task.ext.when == null || task.ext.when - - script: - def args = task.ext.args ?: '' - - """ - stainwarpy \\ - register \\ - ${multiplx_img} \\ - ${hne_img} \\ - . \\ - ${fixed_img} \\ - ${final_sz} \\ - ${args} - """ - - stub: - - """ - touch 0_final_channel_image.ome.tif - touch registration_metrics_tform_map.json - touch feature_based_transformation_map.npy - """ -} diff --git a/modules/nf-core/stainwarpy/register/meta.yml b/modules/nf-core/stainwarpy/register/meta.yml deleted file mode 100644 index 32cdc417b2cc..000000000000 --- a/modules/nf-core/stainwarpy/register/meta.yml +++ /dev/null @@ -1,106 +0,0 @@ -name: "stainwarpy_register" -description: "Register H&E stained and Multiplexed tissue images using feature-based image registration" -keywords: - - image registration - - histology - - hne - - multiplexed -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' ]` - - hne_img: - type: file - description: H&E stained image file - pattern: "*.{ome.tif,ome.tiff,tif,tiff}" - ontologies: [] - - - meta2: - 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: [] - - fixed_img: - type: string - description: Which image to use as fixed image for registration. Options - 'hne' or 'multiplexed' - ontologies: [] - - final_sz: - type: string - description: In which pixel size to output the registered image and segmentation mask. Options - 'hne' or 'multiplexed' - ontologies: [] - -output: - reg_image: - - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. `[ id:'sample1' ]` - - "0_final_channel_image.ome.tif": - type: file - description: Registered final channel image in OME-TIFF format - pattern: "0_final_channel_image.ome.tif" - ontologies: [] - reg_metrics_tform: - - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. `[ id:'sample1' ]` - - "registration_metrics_tform_map.json": - type: file - description: Registration metrics and transformation map in JSON format - pattern: "registration_metrics_tform_map.json" - ontologies: [] - tform_map: - - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. `[ id:'sample1' ]` - - "feature_based_transformation_map.npy": - type: file - description: Feature-based transformation map in NPY format - pattern: "feature_based_transformation_map.npy" - ontologies: [] - versions_stainwarpy_register: - - - "${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" diff --git a/modules/nf-core/stainwarpy/register/tests/main.nf.test b/modules/nf-core/stainwarpy/register/tests/main.nf.test deleted file mode 100644 index d73bd9bf738a..000000000000 --- a/modules/nf-core/stainwarpy/register/tests/main.nf.test +++ /dev/null @@ -1,86 +0,0 @@ -nextflow_process { - - name "Test Process STAINWARPY_REGISTER" - script "../main.nf" - process "STAINWARPY_REGISTER" - - tag "modules" - tag "modules_nfcore" - tag "stainwarpy" - tag "stainwarpy/register" - - config "./nextflow.config" - - test("colon_tissue_local - ome.tif") { - - when { - params { - modules_args = "--feature-tform similarity" - } - process { - """ - input[0] = [ - [ id:'sample1'], - file(params.modules_testdata_base_path + 'imaging/hne_multiplexed/hne_image_colon.ome.tif', checkIfExists: true) - ] - input[1] = [ - [ id:'sample1'], - file(params.modules_testdata_base_path + 'imaging/hne_multiplexed/multiplexed_single_channel_img.ome.tif', checkIfExists: true) - ] - input[2] = 'multiplexed' - input[3] = 'multiplexed' - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot( - file(process.out.reg_image.get(0).get(1)).exists(), - file(process.out.reg_metrics_tform.get(0).get(1)).exists(), - file(process.out.tform_map.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/hne_image_colon.ome.tif', checkIfExists: true) - ] - input[1] = [ - [ id:'sample1'], - file(params.modules_testdata_base_path + 'imaging/hne_multiplexed/multiplexed_single_channel_img.ome.tif', checkIfExists: true) - ] - input[2] = 'multiplexed' - input[3] = 'multiplexed' - """ - } - } - - then { - { assert snapshot( - process.out.reg_image, - process.out.reg_metrics_tform, - process.out.tform_map, - process.out.findAll { key, val -> key.startsWith("versions")} - ).match() } - } - - } - -} diff --git a/modules/nf-core/stainwarpy/register/tests/main.nf.test.snap b/modules/nf-core/stainwarpy/register/tests/main.nf.test.snap deleted file mode 100644 index 05eea7f89299..000000000000 --- a/modules/nf-core/stainwarpy/register/tests/main.nf.test.snap +++ /dev/null @@ -1,65 +0,0 @@ -{ - "colon_tissue_local - ome.tif": { - "content": [ - true, - true, - true, - { - "versions_stainwarpy_register": [ - [ - "STAINWARPY_REGISTER", - "stainwarpy", - "0.2.3" - ] - ] - } - ], - "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.2" - }, - "timestamp": "2026-01-20T13:25:49.750352374" - }, - "colon_tissue_local - ome.tif - stub": { - "content": [ - [ - [ - { - "id": "sample1" - }, - "0_final_channel_image.ome.tif:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - [ - [ - { - "id": "sample1" - }, - "registration_metrics_tform_map.json:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - [ - [ - { - "id": "sample1" - }, - "feature_based_transformation_map.npy:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - { - "versions_stainwarpy_register": [ - [ - "STAINWARPY_REGISTER", - "stainwarpy", - "0.2.3" - ] - ] - } - ], - "meta": { - "nf-test": "0.9.3", - "nextflow": "25.10.2" - }, - "timestamp": "2026-01-20T13:25:56.647172135" - } -} \ No newline at end of file diff --git a/modules/nf-core/stainwarpy/register/tests/nextflow.config b/modules/nf-core/stainwarpy/register/tests/nextflow.config deleted file mode 100644 index 166c3c2b592b..000000000000 --- a/modules/nf-core/stainwarpy/register/tests/nextflow.config +++ /dev/null @@ -1,5 +0,0 @@ -process { - withName: STAINWARPY_REGISTER { - ext.args = params.modules_args ?: '' - } -} diff --git a/modules/nf-core/stainwarpy/transformsegmask/meta.yml b/modules/nf-core/stainwarpy/transformsegmask/meta.yml index b078dc7503fe..d2c3f18a5088 100644 --- a/modules/nf-core/stainwarpy/transformsegmask/meta.yml +++ b/modules/nf-core/stainwarpy/transformsegmask/meta.yml @@ -66,7 +66,7 @@ input: ontologies: [] output: - transformed_segmentation_mask: + transformed_seg_mask: - - meta: type: map description: | From 17f48201e0f25d6fe4dd37f68ee6de3d77aba62a Mon Sep 17 00:00:00 2001 From: tckumarasekara Date: Tue, 27 Jan 2026 20:34:30 +0100 Subject: [PATCH 5/5] added ontologies and singularity container --- .../nf-core/stainwarpy/transformsegmask/main.nf | 4 +++- .../nf-core/stainwarpy/transformsegmask/meta.yml | 15 +++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/modules/nf-core/stainwarpy/transformsegmask/main.nf b/modules/nf-core/stainwarpy/transformsegmask/main.nf index 50d4a1ca3ad2..59e3a9e72be8 100644 --- a/modules/nf-core/stainwarpy/transformsegmask/main.nf +++ b/modules/nf-core/stainwarpy/transformsegmask/main.nf @@ -3,7 +3,9 @@ process STAINWARPY_TRANSFORMSEGMASK { label 'process_single' conda "${moduleDir}/environment.yml" - container "community.wave.seqera.io/library/stainwarpy:0.2.3--2c8b18a5e6d93e4a" + 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(hne_img) diff --git a/modules/nf-core/stainwarpy/transformsegmask/meta.yml b/modules/nf-core/stainwarpy/transformsegmask/meta.yml index d2c3f18a5088..e44a65533428 100644 --- a/modules/nf-core/stainwarpy/transformsegmask/meta.yml +++ b/modules/nf-core/stainwarpy/transformsegmask/meta.yml @@ -25,7 +25,9 @@ input: type: file description: H&E stained image file pattern: "*.{ome.tif,ome.tiff,tif,tiff}" - ontologies: [] + ontologies: + - edam: "http://edamontology.org/format_3727" + - edam: "http://edamontology.org/format_3591" - - meta2: type: map description: | @@ -35,7 +37,9 @@ input: type: file description: Multiplexed image file pattern: "*.{ome.tif,ome.tiff,tif,tiff}" - ontologies: [] + ontologies: + - edam: "http://edamontology.org/format_3727" + - edam: "http://edamontology.org/format_3591" - - meta3: type: map description: | @@ -45,7 +49,9 @@ input: type: file description: Segmentation mask file pattern: "*.{ome.tif,ome.tiff,tif,tiff,npy}" - ontologies: [] + ontologies: + - edam: "http://edamontology.org/format_3727" + - edam: "http://edamontology.org/format_3591" - - meta4: type: map description: | @@ -76,7 +82,8 @@ output: type: file description: Transformed segmentation mask in OME-TIFF format pattern: "transformed_segmentation_mask.ome.tif" - ontologies: [] + ontologies: + - edam: "http://edamontology.org/format_3727" versions_stainwarpy_transformsegmask: - - "${task.process}": type: string