From 16568e138ead6717f4fb27e604e4269bb95709eb Mon Sep 17 00:00:00 2001 From: edogiuili Date: Wed, 1 Apr 2026 18:31:02 +0200 Subject: [PATCH 01/19] add methurator gtestimator and plot modules --- .../methurator/gtestimator/environment.yml | 7 ++ .../nf-core/methurator/gtestimator/main.nf | 52 +++++++++++++ .../nf-core/methurator/gtestimator/meta.yml | 71 +++++++++++++++++ .../methurator/gtestimator/tests/main.nf.test | 78 +++++++++++++++++++ .../gtestimator/tests/main.nf.test.snap | 26 +++++++ .../nf-core/methurator/plot/environment.yml | 7 ++ modules/nf-core/methurator/plot/main.nf | 43 ++++++++++ modules/nf-core/methurator/plot/meta.yml | 53 +++++++++++++ .../methurator/plot/tests/main.nf.test | 77 ++++++++++++++++++ .../methurator/plot/tests/main.nf.test.snap | 26 +++++++ 10 files changed, 440 insertions(+) create mode 100644 modules/nf-core/methurator/gtestimator/environment.yml create mode 100644 modules/nf-core/methurator/gtestimator/main.nf create mode 100755 modules/nf-core/methurator/gtestimator/meta.yml create mode 100644 modules/nf-core/methurator/gtestimator/tests/main.nf.test create mode 100644 modules/nf-core/methurator/gtestimator/tests/main.nf.test.snap create mode 100644 modules/nf-core/methurator/plot/environment.yml create mode 100644 modules/nf-core/methurator/plot/main.nf create mode 100644 modules/nf-core/methurator/plot/meta.yml create mode 100644 modules/nf-core/methurator/plot/tests/main.nf.test create mode 100644 modules/nf-core/methurator/plot/tests/main.nf.test.snap diff --git a/modules/nf-core/methurator/gtestimator/environment.yml b/modules/nf-core/methurator/gtestimator/environment.yml new file mode 100644 index 000000000000..942a9948cb6d --- /dev/null +++ b/modules/nf-core/methurator/gtestimator/environment.yml @@ -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::methurator=2.1.1" diff --git a/modules/nf-core/methurator/gtestimator/main.nf b/modules/nf-core/methurator/gtestimator/main.nf new file mode 100644 index 000000000000..2c63c00510a9 --- /dev/null +++ b/modules/nf-core/methurator/gtestimator/main.nf @@ -0,0 +1,52 @@ +process METHURATOR_GTESTIMATOR { + tag "$meta.id" + label 'process_medium' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/methurator:2.1.1--pyhdfd78af_0' : + 'biocontainers/methurator:2.1.1--pyhdfd78af_0' }" + + input: + tuple val(meta), path(bam) + tuple val(meta2), path(bai) + tuple val(meta3), path(fasta) + + output: + tuple val(meta), path("methurator_*.yml") , emit: summary_report + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + if(params.rrbs) { args += '--rrbs'} + """ + methurator gt-estimator \\ + $bam \\ + --fasta $fasta \\ + --minimum-coverage ${params.minimum_coverage} \\ + --t-max ${params.t_max} \\ + -@ ${task.cpus} \\ + --outdir . \\ + --compute_ci \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + methurator: "\$(methurator --version 2>&1 | sed -E 's/.*version[[:space:]]+([0-9.]+).*/\\1/')" + END_VERSIONS + """ + + stub: + def prefix = task.ext.prefix ?: "methurator_summary_${meta.id}" + """ + touch ${prefix}.yml + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + methurator: "\$(methurator --version 2>&1 | sed -E 's/.*version[[:space:]]+([0-9.]+).*/\\1/')" + END_VERSIONS + """ +} diff --git a/modules/nf-core/methurator/gtestimator/meta.yml b/modules/nf-core/methurator/gtestimator/meta.yml new file mode 100755 index 000000000000..07873d7e48c7 --- /dev/null +++ b/modules/nf-core/methurator/gtestimator/meta.yml @@ -0,0 +1,71 @@ +name: methurator_gtestimator +description: | + Methurator is a Python package designed to estimate CpGs saturation + for DNA methylation sequencing data. +keywords: + - rrbs + - BS-seq + - methylation + - 5mC + - methylseq + - bisulphite + - bam +tools: + - methurator: + description: | + Methurator is a Python package designed to estimate CpGs saturation + for DNA methylation sequencing data. + homepage: https://github.com/VIBTOBIlab/methurator + documentation: https://github.com/VIBTOBIlab/methurator/README.md + licence: ["MIT"] + identifier: "" +input: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: BAM/CRAM file + pattern: "*.{bam,cram}" + - - meta2: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bai: + type: file + description: BAM/CRAM index file + pattern: "*.{bai,crai}" + - - meta3: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - fasta: + type: file + description: Input genome fasta file + pattern: "*.{fasta,fa}" +output: + summary_report: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "methurator_*.yml": + type: file + description: | + YAML file summarizing the saturation analysis results. + pattern: "methurator_*.yml" + versions: + - versions.yml: + type: file + description: | + File containing software versions + pattern: "versions.yml" +authors: + - "@edogiuili" +maintainers: + - "@edogiuili" diff --git a/modules/nf-core/methurator/gtestimator/tests/main.nf.test b/modules/nf-core/methurator/gtestimator/tests/main.nf.test new file mode 100644 index 000000000000..e9f670b3617b --- /dev/null +++ b/modules/nf-core/methurator/gtestimator/tests/main.nf.test @@ -0,0 +1,78 @@ +nextflow_process { + + name "Test Process METHURATOR_GTESTIMATOR" + script "../main.nf" + process "METHURATOR_GTESTIMATOR" + + tag "modules" + tag "modules_nfcore" + tag "methurator" + tag "methurator/gtestimator" + + test("Run methurator gt-estimator on paired-end methylated [bam] | sarscov2 genome [fasta]") { + + when { + params { + t_max = 10 + minimum_coverage = 1 + rrbs = false + } + process { + """ + input[0] = [ [ id:'test_bam' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam', checkIfExists: true) + ] + input[1] = [ [ id:'test', single_end:false ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam.bai') + ] + input[2] = [ [ id: 'test_fasta' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert process.out.summary_report.size() == 1 }, + { assert snapshot(process.out.versions).match("versions") } + ) + } + + } + + test("Run methurator gt-estimator on paired-end methylated [bam] | sarscov2 genome [fasta] - stub") { + + options "-stub" + + when { + params { + minimum_coverage = 1 + t_max = 10 + rrbs = false + } + process { + """ + input[0] = [ [ id:'test_bam' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam', checkIfExists: true) + ] + input[1] = [ [ id:'test', single_end:false ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam.bai') + ] + input[2] = [ [ id: 'test_fasta' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert process.out.summary_report.size() == 1 }, + { assert snapshot(process.out.versions).match("versions_stub") } + ) + } + } +} diff --git a/modules/nf-core/methurator/gtestimator/tests/main.nf.test.snap b/modules/nf-core/methurator/gtestimator/tests/main.nf.test.snap new file mode 100644 index 000000000000..ebe2634ec81a --- /dev/null +++ b/modules/nf-core/methurator/gtestimator/tests/main.nf.test.snap @@ -0,0 +1,26 @@ +{ + "versions_stub": { + "content": [ + [ + "versions.yml:md5,22b8f66df736ae7c456269f537532688" + ] + ], + "timestamp": "2026-04-01T18:22:15.772095", + "meta": { + "nf-test": "0.9.5", + "nextflow": "25.10.0" + } + }, + "versions": { + "content": [ + [ + "versions.yml:md5,22b8f66df736ae7c456269f537532688" + ] + ], + "timestamp": "2026-04-01T18:17:57.637285", + "meta": { + "nf-test": "0.9.5", + "nextflow": "25.10.0" + } + } +} \ No newline at end of file diff --git a/modules/nf-core/methurator/plot/environment.yml b/modules/nf-core/methurator/plot/environment.yml new file mode 100644 index 000000000000..942a9948cb6d --- /dev/null +++ b/modules/nf-core/methurator/plot/environment.yml @@ -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::methurator=2.1.1" diff --git a/modules/nf-core/methurator/plot/main.nf b/modules/nf-core/methurator/plot/main.nf new file mode 100644 index 000000000000..91643dce5651 --- /dev/null +++ b/modules/nf-core/methurator/plot/main.nf @@ -0,0 +1,43 @@ +process METHURATOR_PLOT { + tag "$meta.id" + label 'process_medium' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/methurator:2.1.1--pyhdfd78af_0' : + 'biocontainers/methurator:2.1.1--pyhdfd78af_0' }" + + input: + tuple val(meta), path(summary_report) + + output: + tuple val(meta), path("plots/*.html") , emit: plots + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + """ + methurator plot \\ + --summary $summary_report \\ + --outdir . + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + methurator: "\$(methurator --version 2>&1 | sed -E 's/.*version[[:space:]]+([0-9.]+).*/\\1/')" + END_VERSIONS + """ + + stub: + def prefix = task.ext.prefix ?: "plots/${meta.id}.html" + """ + mkdir plots/ + touch ${prefix} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + methurator: "\$(methurator --version 2>&1 | sed -E 's/.*version[[:space:]]+([0-9.]+).*/\\1/')" + END_VERSIONS + """ +} diff --git a/modules/nf-core/methurator/plot/meta.yml b/modules/nf-core/methurator/plot/meta.yml new file mode 100644 index 000000000000..c9b9629af4bd --- /dev/null +++ b/modules/nf-core/methurator/plot/meta.yml @@ -0,0 +1,53 @@ +name: methurator_plot +description: Plots results produced by methurator. +keywords: + - rrbs + - BS-seq + - methylation + - 5mC + - methylseq + - bisulphite + - bisulfite + - bam +tools: + - methurator: + description: | + methurator is a Python package designed to estimate sequencing saturation + for DNA methylation sequencing data. + homepage: https://github.com/VIBTOBIlab/methurator + documentation: https://github.com/VIBTOBIlab/methurator/README.md + licence: ["MIT"] + identifier: "" +input: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - summary_report: + type: file + description: | + YAML file summarizing the saturation analysis results. + pattern: "methurator_*.yml" +output: + plots: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "plots/*.html": + type: file + description: | + HTML plots generated from the saturation analysis. + pattern: "plots/*.html" + versions: + - versions.yml: + type: file + description: | + File containing software versions + pattern: "versions.yml" +authors: + - "@edogiuili" +maintainers: + - "@edogiuili" diff --git a/modules/nf-core/methurator/plot/tests/main.nf.test b/modules/nf-core/methurator/plot/tests/main.nf.test new file mode 100644 index 000000000000..d1fb05cce6a2 --- /dev/null +++ b/modules/nf-core/methurator/plot/tests/main.nf.test @@ -0,0 +1,77 @@ +nextflow_process { + + name "Test Process METHURATOR_PLOT" + script "../main.nf" + process "METHURATOR_PLOT" + + tag "modules" + tag "modules_nfcore" + tag "methurator" + tag "methurator/plot" + tag "methurator/gtestimator" + + setup { + run("METHURATOR_GTESTIMATOR") { + script "../../gtestimator/main.nf" + params { + t_max = 10 + minimum_coverage = 1 + rrbs = false + } + process { + """ + input[0] = [ [ id:'test_bam' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam', checkIfExists: true) + ] + input[1] = [ [ id:'test', single_end:false ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam.bai') + ] + input[2] = [ [ id: 'test_fasta' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + } + + test("Run methurator plot on the output of methurator gt-estimator") { + + when { + process { + """ + input[0] = METHURATOR_GTESTIMATOR.out.summary_report + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.versions).match("versions") } + ) + } + + } + + test("Run methurator plot on the output of methurator gt-estimator - stub") { + + options "-stub" + + when { + process { + """ + input[0] = METHURATOR_GTESTIMATOR.out.summary_report + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.versions).match("versions_stub") } + ) + } + + } + +} diff --git a/modules/nf-core/methurator/plot/tests/main.nf.test.snap b/modules/nf-core/methurator/plot/tests/main.nf.test.snap new file mode 100644 index 000000000000..879f1c206a06 --- /dev/null +++ b/modules/nf-core/methurator/plot/tests/main.nf.test.snap @@ -0,0 +1,26 @@ +{ + "versions_stub": { + "content": [ + [ + "versions.yml:md5,fe5385d3b0af362701076bf8738e51ff" + ] + ], + "timestamp": "2026-04-01T18:22:44.204721", + "meta": { + "nf-test": "0.9.5", + "nextflow": "25.10.0" + } + }, + "versions": { + "content": [ + [ + "versions.yml:md5,fe5385d3b0af362701076bf8738e51ff" + ] + ], + "timestamp": "2026-04-01T18:18:21.803755", + "meta": { + "nf-test": "0.9.5", + "nextflow": "25.10.0" + } + } +} \ No newline at end of file From d1089a4fd6fb8d6188afee1fa0cadc2956df19d2 Mon Sep 17 00:00:00 2001 From: edogiuili Date: Thu, 2 Apr 2026 23:51:30 +0200 Subject: [PATCH 02/19] add sanitizeOutput and snapshot on summary_report content --- .../methurator/gtestimator/tests/main.nf.test | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/nf-core/methurator/gtestimator/tests/main.nf.test b/modules/nf-core/methurator/gtestimator/tests/main.nf.test index e9f670b3617b..8d63bc6933d6 100644 --- a/modules/nf-core/methurator/gtestimator/tests/main.nf.test +++ b/modules/nf-core/methurator/gtestimator/tests/main.nf.test @@ -35,13 +35,14 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert process.out.summary_report.size() == 1 }, - { assert snapshot(process.out.versions).match("versions") } + { assert snapshot( + // Avoid first 3 lines of the summary report as they contain the date and time of the run + file(process.out.summary_report[0][1]).readLines()[3..10], + process.out.findAll { key, val -> key.startsWith('versions') } + ).match() } ) } - } - test("Run methurator gt-estimator on paired-end methylated [bam] | sarscov2 genome [fasta] - stub") { options "-stub" @@ -70,8 +71,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert process.out.summary_report.size() == 1 }, - { assert snapshot(process.out.versions).match("versions_stub") } + { assert snapshot(sanitizeOutput(process.out)).match() } ) } } From c8cf29c7cc65bd6338f2126a3ed68d300e379f9a Mon Sep 17 00:00:00 2001 From: edogiuili Date: Thu, 2 Apr 2026 23:52:01 +0200 Subject: [PATCH 03/19] add sanitizeOutput and snapshot on summary_report content --- modules/nf-core/methurator/gtestimator/tests/main.nf.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nf-core/methurator/gtestimator/tests/main.nf.test b/modules/nf-core/methurator/gtestimator/tests/main.nf.test index 8d63bc6933d6..3bada798d2cb 100644 --- a/modules/nf-core/methurator/gtestimator/tests/main.nf.test +++ b/modules/nf-core/methurator/gtestimator/tests/main.nf.test @@ -39,7 +39,7 @@ nextflow_process { // Avoid first 3 lines of the summary report as they contain the date and time of the run file(process.out.summary_report[0][1]).readLines()[3..10], process.out.findAll { key, val -> key.startsWith('versions') } - ).match() } + ).match()} ) } } From 0234675f806a2b602cb91f8c9cd63953a88be0af Mon Sep 17 00:00:00 2001 From: edogiuili Date: Thu, 2 Apr 2026 23:53:41 +0200 Subject: [PATCH 04/19] update versions output to utilize topics and chanuniform name summary report with methurator_summary --- .../nf-core/methurator/gtestimator/main.nf | 33 ++++++++----------- 1 file changed, 13 insertions(+), 20 deletions(-) mode change 100644 => 100755 modules/nf-core/methurator/gtestimator/main.nf diff --git a/modules/nf-core/methurator/gtestimator/main.nf b/modules/nf-core/methurator/gtestimator/main.nf old mode 100644 new mode 100755 index 2c63c00510a9..a0ab41140cf2 --- a/modules/nf-core/methurator/gtestimator/main.nf +++ b/modules/nf-core/methurator/gtestimator/main.nf @@ -1,11 +1,11 @@ process METHURATOR_GTESTIMATOR { - tag "$meta.id" + tag "${meta.id}" label 'process_medium' conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/methurator:2.1.1--pyhdfd78af_0' : - 'biocontainers/methurator:2.1.1--pyhdfd78af_0' }" + container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container + ? 'https://depot.galaxyproject.org/singularity/methurator:2.1.1--pyhdfd78af_0' + : 'biocontainers/methurator:2.1.1--pyhdfd78af_0'}" input: tuple val(meta), path(bam) @@ -13,40 +13,33 @@ process METHURATOR_GTESTIMATOR { tuple val(meta3), path(fasta) output: - tuple val(meta), path("methurator_*.yml") , emit: summary_report - path "versions.yml" , emit: versions + tuple val(meta), path("methurator_summary.yml"), emit: summary_report + tuple val("${task.process}"), val('methurator'), eval('methurator --version'), emit: versions_methurator, topic: versions when: task.ext.when == null || task.ext.when script: def args = task.ext.args ?: '' - if(params.rrbs) { args += '--rrbs'} + if (params.rrbs) { + args += '--rrbs' + } """ methurator gt-estimator \\ - $bam \\ - --fasta $fasta \\ + ${bam} \\ + --fasta ${fasta} \\ --minimum-coverage ${params.minimum_coverage} \\ --t-max ${params.t_max} \\ -@ ${task.cpus} \\ --outdir . \\ --compute_ci \\ - $args + ${args} - cat <<-END_VERSIONS > versions.yml - "${task.process}": - methurator: "\$(methurator --version 2>&1 | sed -E 's/.*version[[:space:]]+([0-9.]+).*/\\1/')" - END_VERSIONS """ stub: - def prefix = task.ext.prefix ?: "methurator_summary_${meta.id}" """ - touch ${prefix}.yml + touch methurator_summary.yml - cat <<-END_VERSIONS > versions.yml - "${task.process}": - methurator: "\$(methurator --version 2>&1 | sed -E 's/.*version[[:space:]]+([0-9.]+).*/\\1/')" - END_VERSIONS """ } From df43d78ca6b385b849671102f9f098d5087f67fb Mon Sep 17 00:00:00 2001 From: edogiuili Date: Thu, 2 Apr 2026 23:55:53 +0200 Subject: [PATCH 05/19] add ontologies, make the description more specific, add topics --- .../nf-core/methurator/gtestimator/meta.yml | 40 ++++++++++++++----- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/modules/nf-core/methurator/gtestimator/meta.yml b/modules/nf-core/methurator/gtestimator/meta.yml index 07873d7e48c7..70d5538daaf0 100755 --- a/modules/nf-core/methurator/gtestimator/meta.yml +++ b/modules/nf-core/methurator/gtestimator/meta.yml @@ -1,7 +1,6 @@ name: methurator_gtestimator description: | - Methurator is a Python package designed to estimate CpGs saturation - for DNA methylation sequencing data. + Run estimator for DNA methylation sequencing saturation. keywords: - rrbs - BS-seq @@ -17,7 +16,8 @@ tools: for DNA methylation sequencing data. homepage: https://github.com/VIBTOBIlab/methurator documentation: https://github.com/VIBTOBIlab/methurator/README.md - licence: ["MIT"] + licence: + - "MIT" identifier: "" input: - - meta: @@ -29,6 +29,7 @@ input: type: file description: BAM/CRAM file pattern: "*.{bam,cram}" + ontologies: [] - - meta2: type: map description: | @@ -38,6 +39,7 @@ input: type: file description: BAM/CRAM index file pattern: "*.{bai,crai}" + ontologies: [] - - meta3: type: map description: | @@ -47,6 +49,7 @@ input: type: file description: Input genome fasta file pattern: "*.{fasta,fa}" + ontologies: [] output: summary_report: - - meta: @@ -54,17 +57,32 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - "methurator_*.yml": + - methurator_summary.yml: type: file description: | - YAML file summarizing the saturation analysis results. - pattern: "methurator_*.yml" + methurator gtestimator summary report in YAML format + ontologies: [] + versions_methurator: + - - ${task.process}: + type: string + description: methurator gtestimator + - methurator: + type: string + description: methurator + - methurator --version: + type: eval + description: methurator software versions +topics: versions: - - versions.yml: - type: file - description: | - File containing software versions - pattern: "versions.yml" + - - ${task.process}: + type: string + description: methurator gtestimator + - methurator: + type: string + description: methurator + - methurator --version: + type: eval + description: methurator software versions authors: - "@edogiuili" maintainers: From 888568422b06a98aa65d3635c28104aeff674353 Mon Sep 17 00:00:00 2001 From: edogiuili Date: Thu, 2 Apr 2026 23:57:03 +0200 Subject: [PATCH 06/19] add snapshots on the file name and sanitizeOutput --- modules/nf-core/methurator/plot/tests/main.nf.test | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/nf-core/methurator/plot/tests/main.nf.test b/modules/nf-core/methurator/plot/tests/main.nf.test index d1fb05cce6a2..1d3bfe4353da 100644 --- a/modules/nf-core/methurator/plot/tests/main.nf.test +++ b/modules/nf-core/methurator/plot/tests/main.nf.test @@ -47,10 +47,12 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out.versions).match("versions") } + { assert snapshot( + process.out.plots.collect { it.collect { it instanceof Map ? it : file(it).name } }, + process.out.findAll { key, val -> key.startsWith('versions') }).match() + } ) } - } test("Run methurator plot on the output of methurator gt-estimator - stub") { @@ -68,7 +70,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out.versions).match("versions_stub") } + { assert snapshot(sanitizeOutput(process.out)).match() } ) } From 6a27790519c25ab17e2dc7ca9a1da9f1f9d59f45 Mon Sep 17 00:00:00 2001 From: edogiuili Date: Thu, 2 Apr 2026 23:57:21 +0200 Subject: [PATCH 07/19] add snapshots on the file name and sanitizeOutput --- modules/nf-core/methurator/plot/tests/main.nf.test | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/nf-core/methurator/plot/tests/main.nf.test b/modules/nf-core/methurator/plot/tests/main.nf.test index 1d3bfe4353da..1b5228f40c76 100644 --- a/modules/nf-core/methurator/plot/tests/main.nf.test +++ b/modules/nf-core/methurator/plot/tests/main.nf.test @@ -73,7 +73,5 @@ nextflow_process { { assert snapshot(sanitizeOutput(process.out)).match() } ) } - } - } From 622022f26a878514bbe3b459d878be4a0d8c385c Mon Sep 17 00:00:00 2001 From: edogiuili Date: Thu, 2 Apr 2026 23:58:20 +0200 Subject: [PATCH 08/19] add topics, lint the process --- modules/nf-core/methurator/plot/main.nf | 26 +++++++++---------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/modules/nf-core/methurator/plot/main.nf b/modules/nf-core/methurator/plot/main.nf index 91643dce5651..2910daebaa1f 100644 --- a/modules/nf-core/methurator/plot/main.nf +++ b/modules/nf-core/methurator/plot/main.nf @@ -1,18 +1,18 @@ process METHURATOR_PLOT { - tag "$meta.id" + tag "${meta.id}" label 'process_medium' conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/methurator:2.1.1--pyhdfd78af_0' : - 'biocontainers/methurator:2.1.1--pyhdfd78af_0' }" + container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container + ? 'https://depot.galaxyproject.org/singularity/methurator:2.1.1--pyhdfd78af_0' + : 'biocontainers/methurator:2.1.1--pyhdfd78af_0'}" input: tuple val(meta), path(summary_report) output: - tuple val(meta), path("plots/*.html") , emit: plots - path "versions.yml" , emit: versions + tuple val(meta), path("plots/*.html"), emit: plots + tuple val("${task.process}"), val('methurator'), eval('methurator --version'), emit: versions_methurator, topic: versions when: task.ext.when == null || task.ext.when @@ -20,24 +20,16 @@ process METHURATOR_PLOT { script: """ methurator plot \\ - --summary $summary_report \\ + --summary ${summary_report} \\ --outdir . - cat <<-END_VERSIONS > versions.yml - "${task.process}": - methurator: "\$(methurator --version 2>&1 | sed -E 's/.*version[[:space:]]+([0-9.]+).*/\\1/')" - END_VERSIONS """ stub: - def prefix = task.ext.prefix ?: "plots/${meta.id}.html" + def prefix = task.ext.prefix ?: "${meta.id}.html" """ mkdir plots/ - touch ${prefix} + touch plots/${prefix} - cat <<-END_VERSIONS > versions.yml - "${task.process}": - methurator: "\$(methurator --version 2>&1 | sed -E 's/.*version[[:space:]]+([0-9.]+).*/\\1/')" - END_VERSIONS """ } From 670437cc65d3063b63cc422efe748b18911d1a3f Mon Sep 17 00:00:00 2001 From: edogiuili Date: Thu, 2 Apr 2026 23:59:20 +0200 Subject: [PATCH 09/19] add topics, update output, update description, add ontologies --- modules/nf-core/methurator/plot/meta.yml | 35 ++++++++++++++++++------ 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/modules/nf-core/methurator/plot/meta.yml b/modules/nf-core/methurator/plot/meta.yml index c9b9629af4bd..69c1e8d4562c 100644 --- a/modules/nf-core/methurator/plot/meta.yml +++ b/modules/nf-core/methurator/plot/meta.yml @@ -1,5 +1,5 @@ name: methurator_plot -description: Plots results produced by methurator. +description: Plots results produced by methurator gtestimator. keywords: - rrbs - BS-seq @@ -16,7 +16,8 @@ tools: for DNA methylation sequencing data. homepage: https://github.com/VIBTOBIlab/methurator documentation: https://github.com/VIBTOBIlab/methurator/README.md - licence: ["MIT"] + licence: + - "MIT" identifier: "" input: - - meta: @@ -29,6 +30,8 @@ input: description: | YAML file summarizing the saturation analysis results. pattern: "methurator_*.yml" + ontologies: + - edam: http://edamontology.org/format_3750 output: plots: - - meta: @@ -36,17 +39,33 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - "plots/*.html": + - plots/*.html: type: file description: | HTML plots generated from the saturation analysis. pattern: "plots/*.html" + ontologies: [] + versions_methurator: + - - ${task.process}: + type: string + description: The name of the process + - methurator: + type: string + description: The name of the tool + - methurator --version: + type: eval + description: The expression to obtain the version of the tool +topics: versions: - - versions.yml: - type: file - description: | - File containing software versions - pattern: "versions.yml" + - - ${task.process}: + type: string + description: The name of the process + - methurator: + type: string + description: The name of the tool + - methurator --version: + type: eval + description: The expression to obtain the version of the tool authors: - "@edogiuili" maintainers: From c992f4ad0bd28495822bb821c91608eafae395d4 Mon Sep 17 00:00:00 2001 From: edogiuili Date: Thu, 2 Apr 2026 23:59:38 +0200 Subject: [PATCH 10/19] update snaps --- .../gtestimator/tests/main.nf.test.snap | 48 +++++++++++++++---- .../methurator/plot/tests/main.nf.test.snap | 46 ++++++++++++++---- 2 files changed, 76 insertions(+), 18 deletions(-) diff --git a/modules/nf-core/methurator/gtestimator/tests/main.nf.test.snap b/modules/nf-core/methurator/gtestimator/tests/main.nf.test.snap index ebe2634ec81a..5ec06a166a44 100644 --- a/modules/nf-core/methurator/gtestimator/tests/main.nf.test.snap +++ b/modules/nf-core/methurator/gtestimator/tests/main.nf.test.snap @@ -1,23 +1,53 @@ { - "versions_stub": { + "Run methurator gt-estimator on paired-end methylated [bam] | sarscov2 genome [fasta] - stub": { "content": [ - [ - "versions.yml:md5,22b8f66df736ae7c456269f537532688" - ] + { + "summary_report": [ + [ + { + "id": "test_bam" + }, + "methurator_summary.yml:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions_methurator": [ + [ + "METHURATOR_GTESTIMATOR", + "methurator", + "methurator, version 2.1.1" + ] + ] + } ], - "timestamp": "2026-04-01T18:22:15.772095", + "timestamp": "2026-04-02T23:42:39.24087", "meta": { "nf-test": "0.9.5", "nextflow": "25.10.0" } }, - "versions": { + "Run methurator gt-estimator on paired-end methylated [bam] | sarscov2 genome [fasta]": { "content": [ [ - "versions.yml:md5,22b8f66df736ae7c456269f537532688" - ] + " methurator_version: 2.1.1", + " command: methurator gt_estimator", + " options:", + " cov_files:", + " - ./covs/test.paired_end.methylated.sorted_CpG.bedGraph.gz", + " outdir: .", + " minimum_coverage: '1'", + " t_step: 0.05" + ], + { + "versions_methurator": [ + [ + "METHURATOR_GTESTIMATOR", + "methurator", + "methurator, version 2.1.1" + ] + ] + } ], - "timestamp": "2026-04-01T18:17:57.637285", + "timestamp": "2026-04-02T15:49:50.342905", "meta": { "nf-test": "0.9.5", "nextflow": "25.10.0" diff --git a/modules/nf-core/methurator/plot/tests/main.nf.test.snap b/modules/nf-core/methurator/plot/tests/main.nf.test.snap index 879f1c206a06..03434ad98874 100644 --- a/modules/nf-core/methurator/plot/tests/main.nf.test.snap +++ b/modules/nf-core/methurator/plot/tests/main.nf.test.snap @@ -1,23 +1,51 @@ { - "versions_stub": { + "Run methurator plot on the output of methurator gt-estimator": { "content": [ [ - "versions.yml:md5,fe5385d3b0af362701076bf8738e51ff" - ] + [ + { + "id": "test_bam" + }, + "test.paired_end.methylated.sorted_CpG.bedGraph_1x_plot.html" + ] + ], + { + "versions_methurator": [ + [ + "METHURATOR_PLOT", + "methurator", + "methurator, version 2.1.1" + ] + ] + } ], - "timestamp": "2026-04-01T18:22:44.204721", + "timestamp": "2026-04-02T19:34:24.912049", "meta": { "nf-test": "0.9.5", "nextflow": "25.10.0" } }, - "versions": { + "Run methurator plot on the output of methurator gt-estimator - stub": { "content": [ - [ - "versions.yml:md5,fe5385d3b0af362701076bf8738e51ff" - ] + { + "plots": [ + [ + { + "id": "test_bam" + }, + "test_bam.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions_methurator": [ + [ + "METHURATOR_PLOT", + "methurator", + "methurator, version 2.1.1" + ] + ] + } ], - "timestamp": "2026-04-01T18:18:21.803755", + "timestamp": "2026-04-02T17:04:03.284", "meta": { "nf-test": "0.9.5", "nextflow": "25.10.0" From 083231d7bfe24d1ce7fa63fa2bf41f726853b307 Mon Sep 17 00:00:00 2001 From: edogiuili Date: Sat, 4 Apr 2026 18:02:47 +0200 Subject: [PATCH 11/19] change the expression in eval to output just version number --- modules/nf-core/methurator/gtestimator/main.nf | 2 +- modules/nf-core/methurator/gtestimator/meta.yml | 12 ++++++------ .../methurator/gtestimator/tests/main.nf.test.snap | 8 ++++---- modules/nf-core/methurator/plot/main.nf | 2 +- modules/nf-core/methurator/plot/meta.yml | 8 ++++---- .../nf-core/methurator/plot/tests/main.nf.test.snap | 8 ++++---- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/modules/nf-core/methurator/gtestimator/main.nf b/modules/nf-core/methurator/gtestimator/main.nf index a0ab41140cf2..bda54e93edf7 100755 --- a/modules/nf-core/methurator/gtestimator/main.nf +++ b/modules/nf-core/methurator/gtestimator/main.nf @@ -14,7 +14,7 @@ process METHURATOR_GTESTIMATOR { output: tuple val(meta), path("methurator_summary.yml"), emit: summary_report - tuple val("${task.process}"), val('methurator'), eval('methurator --version'), emit: versions_methurator, topic: versions + tuple val("${task.process}"), val('methurator'), eval("methurator --version | sed 's/.* //'"), emit: versions_methurator, topic: versions when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/methurator/gtestimator/meta.yml b/modules/nf-core/methurator/gtestimator/meta.yml index 70d5538daaf0..32b76c8b0a0b 100755 --- a/modules/nf-core/methurator/gtestimator/meta.yml +++ b/modules/nf-core/methurator/gtestimator/meta.yml @@ -68,10 +68,10 @@ output: description: methurator gtestimator - methurator: type: string - description: methurator - - methurator --version: + description: The name of the tool + - methurator --version | sed 's/.* //': type: eval - description: methurator software versions + description: The expression to obtain the version of the tool topics: versions: - - ${task.process}: @@ -79,10 +79,10 @@ topics: description: methurator gtestimator - methurator: type: string - description: methurator - - methurator --version: + description: The name of the tool + - methurator --version | sed 's/.* //': type: eval - description: methurator software versions + description: The expression to obtain the version of the tool authors: - "@edogiuili" maintainers: diff --git a/modules/nf-core/methurator/gtestimator/tests/main.nf.test.snap b/modules/nf-core/methurator/gtestimator/tests/main.nf.test.snap index 5ec06a166a44..b2705b99dea2 100644 --- a/modules/nf-core/methurator/gtestimator/tests/main.nf.test.snap +++ b/modules/nf-core/methurator/gtestimator/tests/main.nf.test.snap @@ -14,12 +14,12 @@ [ "METHURATOR_GTESTIMATOR", "methurator", - "methurator, version 2.1.1" + "2.1.1" ] ] } ], - "timestamp": "2026-04-02T23:42:39.24087", + "timestamp": "2026-04-04T17:56:55.555845", "meta": { "nf-test": "0.9.5", "nextflow": "25.10.0" @@ -42,12 +42,12 @@ [ "METHURATOR_GTESTIMATOR", "methurator", - "methurator, version 2.1.1" + "2.1.1" ] ] } ], - "timestamp": "2026-04-02T15:49:50.342905", + "timestamp": "2026-04-04T17:56:48.448736", "meta": { "nf-test": "0.9.5", "nextflow": "25.10.0" diff --git a/modules/nf-core/methurator/plot/main.nf b/modules/nf-core/methurator/plot/main.nf index 2910daebaa1f..d7563b1185e6 100644 --- a/modules/nf-core/methurator/plot/main.nf +++ b/modules/nf-core/methurator/plot/main.nf @@ -12,7 +12,7 @@ process METHURATOR_PLOT { output: tuple val(meta), path("plots/*.html"), emit: plots - tuple val("${task.process}"), val('methurator'), eval('methurator --version'), emit: versions_methurator, topic: versions + tuple val("${task.process}"), val('methurator'), eval("methurator --version | sed 's/.* //'"), emit: versions_methurator, topic: versions when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/methurator/plot/meta.yml b/modules/nf-core/methurator/plot/meta.yml index 69c1e8d4562c..fe7b17499d3f 100644 --- a/modules/nf-core/methurator/plot/meta.yml +++ b/modules/nf-core/methurator/plot/meta.yml @@ -48,22 +48,22 @@ output: versions_methurator: - - ${task.process}: type: string - description: The name of the process + description: methurator plot - methurator: type: string description: The name of the tool - - methurator --version: + - methurator --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 + description: methurator plot - methurator: type: string description: The name of the tool - - methurator --version: + - methurator --version | sed 's/.* //': type: eval description: The expression to obtain the version of the tool authors: diff --git a/modules/nf-core/methurator/plot/tests/main.nf.test.snap b/modules/nf-core/methurator/plot/tests/main.nf.test.snap index 03434ad98874..18c351ef696c 100644 --- a/modules/nf-core/methurator/plot/tests/main.nf.test.snap +++ b/modules/nf-core/methurator/plot/tests/main.nf.test.snap @@ -14,12 +14,12 @@ [ "METHURATOR_PLOT", "methurator", - "methurator, version 2.1.1" + "2.1.1" ] ] } ], - "timestamp": "2026-04-02T19:34:24.912049", + "timestamp": "2026-04-04T17:57:10.580629", "meta": { "nf-test": "0.9.5", "nextflow": "25.10.0" @@ -40,12 +40,12 @@ [ "METHURATOR_PLOT", "methurator", - "methurator, version 2.1.1" + "2.1.1" ] ] } ], - "timestamp": "2026-04-02T17:04:03.284", + "timestamp": "2026-04-04T17:57:21.322182", "meta": { "nf-test": "0.9.5", "nextflow": "25.10.0" From 2d1c6db5306542f24b5a0871b1cf585b324ab871 Mon Sep 17 00:00:00 2001 From: edogiuili Date: Tue, 7 Apr 2026 14:51:10 +0200 Subject: [PATCH 12/19] add .join().md5 as suggested --- .../methurator/gtestimator/tests/main.nf.test | 2 +- .../gtestimator/tests/main.nf.test.snap | 15 +++------------ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/modules/nf-core/methurator/gtestimator/tests/main.nf.test b/modules/nf-core/methurator/gtestimator/tests/main.nf.test index 3bada798d2cb..4e5507308710 100644 --- a/modules/nf-core/methurator/gtestimator/tests/main.nf.test +++ b/modules/nf-core/methurator/gtestimator/tests/main.nf.test @@ -37,7 +37,7 @@ nextflow_process { { assert process.success }, { assert snapshot( // Avoid first 3 lines of the summary report as they contain the date and time of the run - file(process.out.summary_report[0][1]).readLines()[3..10], + file(process.out.summary_report[0][1]).readLines()[3..10].join('\n').md5(), process.out.findAll { key, val -> key.startsWith('versions') } ).match()} ) diff --git a/modules/nf-core/methurator/gtestimator/tests/main.nf.test.snap b/modules/nf-core/methurator/gtestimator/tests/main.nf.test.snap index b2705b99dea2..527590e12264 100644 --- a/modules/nf-core/methurator/gtestimator/tests/main.nf.test.snap +++ b/modules/nf-core/methurator/gtestimator/tests/main.nf.test.snap @@ -19,7 +19,7 @@ ] } ], - "timestamp": "2026-04-04T17:56:55.555845", + "timestamp": "2026-04-07T14:33:34.389842", "meta": { "nf-test": "0.9.5", "nextflow": "25.10.0" @@ -27,16 +27,7 @@ }, "Run methurator gt-estimator on paired-end methylated [bam] | sarscov2 genome [fasta]": { "content": [ - [ - " methurator_version: 2.1.1", - " command: methurator gt_estimator", - " options:", - " cov_files:", - " - ./covs/test.paired_end.methylated.sorted_CpG.bedGraph.gz", - " outdir: .", - " minimum_coverage: '1'", - " t_step: 0.05" - ], + "983d27e4d62f86d15a779820758af458", { "versions_methurator": [ [ @@ -47,7 +38,7 @@ ] } ], - "timestamp": "2026-04-04T17:56:48.448736", + "timestamp": "2026-04-07T14:33:27.127158", "meta": { "nf-test": "0.9.5", "nextflow": "25.10.0" From 74ecd84d94f120ae5e8ce10e5be61c6f5b763e6a Mon Sep 17 00:00:00 2001 From: edogiuili Date: Tue, 7 Apr 2026 14:51:25 +0200 Subject: [PATCH 13/19] update test --- modules/nf-core/methurator/plot/tests/main.nf.test.snap | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/nf-core/methurator/plot/tests/main.nf.test.snap b/modules/nf-core/methurator/plot/tests/main.nf.test.snap index 18c351ef696c..8202a599255c 100644 --- a/modules/nf-core/methurator/plot/tests/main.nf.test.snap +++ b/modules/nf-core/methurator/plot/tests/main.nf.test.snap @@ -19,7 +19,7 @@ ] } ], - "timestamp": "2026-04-04T17:57:10.580629", + "timestamp": "2026-04-07T14:33:51.151509", "meta": { "nf-test": "0.9.5", "nextflow": "25.10.0" @@ -45,7 +45,7 @@ ] } ], - "timestamp": "2026-04-04T17:57:21.322182", + "timestamp": "2026-04-07T14:34:01.714635", "meta": { "nf-test": "0.9.5", "nextflow": "25.10.0" From 26b2bca468eff3aff0d124254935dd60e7c7569f Mon Sep 17 00:00:00 2001 From: Edoardo <85080683+edogiuili@users.noreply.github.com> Date: Tue, 7 Apr 2026 18:18:11 +0200 Subject: [PATCH 14/19] Update main.nf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Famke Bäuerle <45968370+famosab@users.noreply.github.com> --- modules/nf-core/methurator/plot/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nf-core/methurator/plot/main.nf b/modules/nf-core/methurator/plot/main.nf index d7563b1185e6..cd71379f280b 100644 --- a/modules/nf-core/methurator/plot/main.nf +++ b/modules/nf-core/methurator/plot/main.nf @@ -29,7 +29,7 @@ process METHURATOR_PLOT { def prefix = task.ext.prefix ?: "${meta.id}.html" """ mkdir plots/ - touch plots/${prefix} + touch plots/${prefix}.html """ } From 60ab8939781daf1fc073f5c76f3f4352ab82668a Mon Sep 17 00:00:00 2001 From: Edoardo <85080683+edogiuili@users.noreply.github.com> Date: Tue, 7 Apr 2026 18:18:29 +0200 Subject: [PATCH 15/19] Update main.nf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Famke Bäuerle <45968370+famosab@users.noreply.github.com> --- modules/nf-core/methurator/plot/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nf-core/methurator/plot/main.nf b/modules/nf-core/methurator/plot/main.nf index cd71379f280b..f079093cc5ca 100644 --- a/modules/nf-core/methurator/plot/main.nf +++ b/modules/nf-core/methurator/plot/main.nf @@ -26,7 +26,7 @@ process METHURATOR_PLOT { """ stub: - def prefix = task.ext.prefix ?: "${meta.id}.html" + def prefix = task.ext.prefix ?: "${meta.id}" """ mkdir plots/ touch plots/${prefix}.html From 4e1d5eec602c70afc0a505d1ea0e40f0f3b62bb5 Mon Sep 17 00:00:00 2001 From: edogiuili Date: Tue, 7 Apr 2026 22:48:39 +0200 Subject: [PATCH 16/19] put all the inputs into one tuple and add ontologies --- .../nf-core/methurator/gtestimator/main.nf | 11 +++++---- .../nf-core/methurator/gtestimator/meta.yml | 21 ++++++---------- .../methurator/gtestimator/tests/main.nf.test | 24 +++++++------------ .../gtestimator/tests/main.nf.test.snap | 7 +++--- 4 files changed, 25 insertions(+), 38 deletions(-) diff --git a/modules/nf-core/methurator/gtestimator/main.nf b/modules/nf-core/methurator/gtestimator/main.nf index bda54e93edf7..0307b39b1f8b 100755 --- a/modules/nf-core/methurator/gtestimator/main.nf +++ b/modules/nf-core/methurator/gtestimator/main.nf @@ -8,12 +8,10 @@ process METHURATOR_GTESTIMATOR { : 'biocontainers/methurator:2.1.1--pyhdfd78af_0'}" input: - tuple val(meta), path(bam) - tuple val(meta2), path(bai) - tuple val(meta3), path(fasta) + tuple val(meta), path(bam), path(bai), path(fasta) output: - tuple val(meta), path("methurator_summary.yml"), emit: summary_report + tuple val(meta), path("${prefix}.yml"), emit: summary_report tuple val("${task.process}"), val('methurator'), eval("methurator --version | sed 's/.* //'"), emit: versions_methurator, topic: versions when: @@ -24,6 +22,7 @@ process METHURATOR_GTESTIMATOR { if (params.rrbs) { args += '--rrbs' } + prefix = task.ext.prefix?: "${meta.id}" """ methurator gt-estimator \\ ${bam} \\ @@ -35,11 +34,13 @@ process METHURATOR_GTESTIMATOR { --compute_ci \\ ${args} + mv methurator_summary.yml ${prefix}.yml """ stub: + prefix = task.ext.prefix?: "${meta.id}" """ - touch methurator_summary.yml + touch ${prefix}.yml """ } diff --git a/modules/nf-core/methurator/gtestimator/meta.yml b/modules/nf-core/methurator/gtestimator/meta.yml index 32b76c8b0a0b..0b40456c9b7e 100755 --- a/modules/nf-core/methurator/gtestimator/meta.yml +++ b/modules/nf-core/methurator/gtestimator/meta.yml @@ -25,26 +25,17 @@ input: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] + ontologies: [] - bam: type: file - description: BAM/CRAM file + description: Single BAM file pattern: "*.{bam,cram}" ontologies: [] - - - meta2: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - bai: type: file - description: BAM/CRAM index file + description: Single BAM/CRAM index file pattern: "*.{bai,crai}" ontologies: [] - - - meta3: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - fasta: type: file description: Input genome fasta file @@ -57,10 +48,12 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - methurator_summary.yml: + ontologies: [] + - "${prefix}.yml": type: file description: | - methurator gtestimator summary report in YAML format + YAML file summarizing the saturation analysis results. + pattern: "${prefix}.yml" ontologies: [] versions_methurator: - - ${task.process}: diff --git a/modules/nf-core/methurator/gtestimator/tests/main.nf.test b/modules/nf-core/methurator/gtestimator/tests/main.nf.test index 4e5507308710..4fbee0155822 100644 --- a/modules/nf-core/methurator/gtestimator/tests/main.nf.test +++ b/modules/nf-core/methurator/gtestimator/tests/main.nf.test @@ -19,14 +19,10 @@ nextflow_process { } process { """ - input[0] = [ [ id:'test_bam' ], - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam', checkIfExists: true) - ] - input[1] = [ [ id:'test', single_end:false ], - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam.bai') - ] - input[2] = [ [ id: 'test_fasta' ], - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + input[0] = [ [ id:'test', single_end:false ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam.bai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] """ } @@ -55,14 +51,10 @@ nextflow_process { } process { """ - input[0] = [ [ id:'test_bam' ], - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam', checkIfExists: true) - ] - input[1] = [ [ id:'test', single_end:false ], - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam.bai') - ] - input[2] = [ [ id: 'test_fasta' ], - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + input[0] = [ [ id:'test', single_end:false ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam.bai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] """ } diff --git a/modules/nf-core/methurator/gtestimator/tests/main.nf.test.snap b/modules/nf-core/methurator/gtestimator/tests/main.nf.test.snap index 527590e12264..6e5d5ab3639f 100644 --- a/modules/nf-core/methurator/gtestimator/tests/main.nf.test.snap +++ b/modules/nf-core/methurator/gtestimator/tests/main.nf.test.snap @@ -5,9 +5,10 @@ "summary_report": [ [ { - "id": "test_bam" + "id": "test", + "single_end": false }, - "methurator_summary.yml:md5,d41d8cd98f00b204e9800998ecf8427e" + "test.yml:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "versions_methurator": [ @@ -19,7 +20,7 @@ ] } ], - "timestamp": "2026-04-07T14:33:34.389842", + "timestamp": "2026-04-07T22:41:16.975667", "meta": { "nf-test": "0.9.5", "nextflow": "25.10.0" From b8218c051993fa9709831a7825ab99e1ddc98f8c Mon Sep 17 00:00:00 2001 From: edogiuili Date: Tue, 7 Apr 2026 22:49:48 +0200 Subject: [PATCH 17/19] put inputs into one tuple and minor changes --- modules/nf-core/methurator/plot/meta.yml | 2 ++ modules/nf-core/methurator/plot/tests/main.nf.test | 12 ++++-------- .../nf-core/methurator/plot/tests/main.nf.test.snap | 12 +++++++----- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/modules/nf-core/methurator/plot/meta.yml b/modules/nf-core/methurator/plot/meta.yml index fe7b17499d3f..630067d1008c 100644 --- a/modules/nf-core/methurator/plot/meta.yml +++ b/modules/nf-core/methurator/plot/meta.yml @@ -25,6 +25,7 @@ input: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] + ontologies: [] - summary_report: type: file description: | @@ -39,6 +40,7 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] + ontologies: [] - plots/*.html: type: file description: | diff --git a/modules/nf-core/methurator/plot/tests/main.nf.test b/modules/nf-core/methurator/plot/tests/main.nf.test index 1b5228f40c76..acd4043937f1 100644 --- a/modules/nf-core/methurator/plot/tests/main.nf.test +++ b/modules/nf-core/methurator/plot/tests/main.nf.test @@ -20,14 +20,10 @@ nextflow_process { } process { """ - input[0] = [ [ id:'test_bam' ], - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam', checkIfExists: true) - ] - input[1] = [ [ id:'test', single_end:false ], - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam.bai') - ] - input[2] = [ [ id: 'test_fasta' ], - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + input[0] = [ [ id:'test', single_end:false ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam.bai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] """ } diff --git a/modules/nf-core/methurator/plot/tests/main.nf.test.snap b/modules/nf-core/methurator/plot/tests/main.nf.test.snap index 8202a599255c..a52140b74c25 100644 --- a/modules/nf-core/methurator/plot/tests/main.nf.test.snap +++ b/modules/nf-core/methurator/plot/tests/main.nf.test.snap @@ -4,7 +4,8 @@ [ [ { - "id": "test_bam" + "id": "test", + "single_end": false }, "test.paired_end.methylated.sorted_CpG.bedGraph_1x_plot.html" ] @@ -19,7 +20,7 @@ ] } ], - "timestamp": "2026-04-07T14:33:51.151509", + "timestamp": "2026-04-07T22:44:11.302149", "meta": { "nf-test": "0.9.5", "nextflow": "25.10.0" @@ -31,9 +32,10 @@ "plots": [ [ { - "id": "test_bam" + "id": "test", + "single_end": false }, - "test_bam.html:md5,d41d8cd98f00b204e9800998ecf8427e" + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "versions_methurator": [ @@ -45,7 +47,7 @@ ] } ], - "timestamp": "2026-04-07T14:34:01.714635", + "timestamp": "2026-04-07T22:44:22.201627", "meta": { "nf-test": "0.9.5", "nextflow": "25.10.0" From e75b482a76cb23d1cbd6ed8cb79d45739c7e02d5 Mon Sep 17 00:00:00 2001 From: edogiuili Date: Fri, 10 Apr 2026 11:25:51 +0200 Subject: [PATCH 18/19] move args and params to the task.ext.args and make a nextflow.config file for the test --- modules/nf-core/methurator/gtestimator/main.nf | 8 +------- .../nf-core/methurator/gtestimator/tests/main.nf.test | 3 +++ .../methurator/gtestimator/tests/nextflow.config | 10 ++++++++++ 3 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 modules/nf-core/methurator/gtestimator/tests/nextflow.config diff --git a/modules/nf-core/methurator/gtestimator/main.nf b/modules/nf-core/methurator/gtestimator/main.nf index 0307b39b1f8b..cf64e35a881e 100755 --- a/modules/nf-core/methurator/gtestimator/main.nf +++ b/modules/nf-core/methurator/gtestimator/main.nf @@ -19,19 +19,13 @@ process METHURATOR_GTESTIMATOR { script: def args = task.ext.args ?: '' - if (params.rrbs) { - args += '--rrbs' - } - prefix = task.ext.prefix?: "${meta.id}" + prefix = task.ext.prefix ?: "${meta.id}" """ methurator gt-estimator \\ ${bam} \\ --fasta ${fasta} \\ - --minimum-coverage ${params.minimum_coverage} \\ - --t-max ${params.t_max} \\ -@ ${task.cpus} \\ --outdir . \\ - --compute_ci \\ ${args} mv methurator_summary.yml ${prefix}.yml diff --git a/modules/nf-core/methurator/gtestimator/tests/main.nf.test b/modules/nf-core/methurator/gtestimator/tests/main.nf.test index 4fbee0155822..38c621f44949 100644 --- a/modules/nf-core/methurator/gtestimator/tests/main.nf.test +++ b/modules/nf-core/methurator/gtestimator/tests/main.nf.test @@ -3,6 +3,7 @@ nextflow_process { name "Test Process METHURATOR_GTESTIMATOR" script "../main.nf" process "METHURATOR_GTESTIMATOR" + config './nextflow.config' tag "modules" tag "modules_nfcore" @@ -15,6 +16,7 @@ nextflow_process { params { t_max = 10 minimum_coverage = 1 + compute_ci = true rrbs = false } process { @@ -47,6 +49,7 @@ nextflow_process { params { minimum_coverage = 1 t_max = 10 + compute_ci = true rrbs = false } process { diff --git a/modules/nf-core/methurator/gtestimator/tests/nextflow.config b/modules/nf-core/methurator/gtestimator/tests/nextflow.config new file mode 100644 index 000000000000..7748c17ff65d --- /dev/null +++ b/modules/nf-core/methurator/gtestimator/tests/nextflow.config @@ -0,0 +1,10 @@ +process { + withName: METHURATOR_GTESTIMATOR { + ext.args = { [ + params.rrbs ? '--rrbs' : '', + params.compute_ci ? ' --compute_ci' : '', + params.t_max ? " --t-max ${params.t_max}" : '', + params.minimum_coverage ? " --minimum-coverage ${params.minimum_coverage}" : '' + ].join(' ').trim() } + } +} From 9c8326025e1c35219536eb06ebaf375d68beabc0 Mon Sep 17 00:00:00 2001 From: edogiuili Date: Fri, 10 Apr 2026 13:15:59 +0200 Subject: [PATCH 19/19] move args into module_args param --- .../nf-core/methurator/gtestimator/tests/main.nf.test | 11 +++-------- .../methurator/gtestimator/tests/nextflow.config | 7 +------ 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/modules/nf-core/methurator/gtestimator/tests/main.nf.test b/modules/nf-core/methurator/gtestimator/tests/main.nf.test index 38c621f44949..de1cff6e2687 100644 --- a/modules/nf-core/methurator/gtestimator/tests/main.nf.test +++ b/modules/nf-core/methurator/gtestimator/tests/main.nf.test @@ -14,11 +14,9 @@ nextflow_process { when { params { - t_max = 10 - minimum_coverage = 1 - compute_ci = true - rrbs = false + module_args = '--t-max 10 --minimum-coverage 1 --compute_ci' } + process { """ input[0] = [ [ id:'test', single_end:false ], @@ -47,10 +45,7 @@ nextflow_process { when { params { - minimum_coverage = 1 - t_max = 10 - compute_ci = true - rrbs = false + module_args = '--t-max 10 --minimum-coverage 1 --compute_ci' } process { """ diff --git a/modules/nf-core/methurator/gtestimator/tests/nextflow.config b/modules/nf-core/methurator/gtestimator/tests/nextflow.config index 7748c17ff65d..9cb31eb3a925 100644 --- a/modules/nf-core/methurator/gtestimator/tests/nextflow.config +++ b/modules/nf-core/methurator/gtestimator/tests/nextflow.config @@ -1,10 +1,5 @@ process { withName: METHURATOR_GTESTIMATOR { - ext.args = { [ - params.rrbs ? '--rrbs' : '', - params.compute_ci ? ' --compute_ci' : '', - params.t_max ? " --t-max ${params.t_max}" : '', - params.minimum_coverage ? " --minimum-coverage ${params.minimum_coverage}" : '' - ].join(' ').trim() } + ext.args = params.module_args } }