Skip to content

Commit 81b4337

Browse files
edogiuilifamosab
andauthored
add methurator gtestimator and plot modules (#11110)
* add methurator gtestimator and plot modules * add sanitizeOutput and snapshot on summary_report content * add sanitizeOutput and snapshot on summary_report content * update versions output to utilize topics and chanuniform name summary report with methurator_summary * add ontologies, make the description more specific, add topics * add snapshots on the file name and sanitizeOutput * add snapshots on the file name and sanitizeOutput * add topics, lint the process * add topics, update output, update description, add ontologies * update snaps * change the expression in eval to output just version number * add .join().md5 as suggested * update test * Update main.nf Co-authored-by: Famke Bäuerle <45968370+famosab@users.noreply.github.com> * Update main.nf Co-authored-by: Famke Bäuerle <45968370+famosab@users.noreply.github.com> * put all the inputs into one tuple and add ontologies * put inputs into one tuple and minor changes * move args and params to the task.ext.args and make a nextflow.config file for the test * move args into module_args param * add container prefix * add ontologies * remove empty ontologies --------- Co-authored-by: Famke Bäuerle <45968370+famosab@users.noreply.github.com>
1 parent ef2ee03 commit 81b4337

11 files changed

Lines changed: 496 additions & 0 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
3+
channels:
4+
- conda-forge
5+
- bioconda
6+
dependencies:
7+
- "bioconda::methurator=2.1.1"
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
process METHURATOR_GTESTIMATOR {
2+
tag "${meta.id}"
3+
label 'process_medium'
4+
5+
conda "${moduleDir}/environment.yml"
6+
container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container
7+
? 'https://depot.galaxyproject.org/singularity/methurator:2.1.1--pyhdfd78af_0'
8+
: 'quay.io/biocontainers/methurator:2.1.1--pyhdfd78af_0'}"
9+
10+
input:
11+
tuple val(meta), path(bam), path(bai), path(fasta)
12+
13+
output:
14+
tuple val(meta), path("${prefix}.yml"), emit: summary_report
15+
tuple val("${task.process}"), val('methurator'), eval("methurator --version | sed 's/.* //'"), emit: versions_methurator, topic: versions
16+
17+
when:
18+
task.ext.when == null || task.ext.when
19+
20+
script:
21+
def args = task.ext.args ?: ''
22+
prefix = task.ext.prefix ?: "${meta.id}"
23+
"""
24+
methurator gt-estimator \\
25+
${bam} \\
26+
--fasta ${fasta} \\
27+
-@ ${task.cpus} \\
28+
--outdir . \\
29+
${args}
30+
31+
mv methurator_summary.yml ${prefix}.yml
32+
"""
33+
34+
stub:
35+
prefix = task.ext.prefix?: "${meta.id}"
36+
"""
37+
touch ${prefix}.yml
38+
39+
"""
40+
}
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: methurator_gtestimator
2+
description: |
3+
Run estimator for DNA methylation sequencing saturation.
4+
keywords:
5+
- rrbs
6+
- BS-seq
7+
- methylation
8+
- 5mC
9+
- methylseq
10+
- bisulphite
11+
- bam
12+
tools:
13+
- methurator:
14+
description: |
15+
Methurator is a Python package designed to estimate CpGs saturation
16+
for DNA methylation sequencing data.
17+
homepage: https://github.com/VIBTOBIlab/methurator
18+
documentation: https://github.com/VIBTOBIlab/methurator/README.md
19+
licence:
20+
- "MIT"
21+
identifier: ""
22+
input:
23+
- - meta:
24+
type: map
25+
description: |
26+
Groovy Map containing sample information
27+
e.g. [ id:'test', single_end:false ]
28+
- bam:
29+
type: file
30+
description: Single BAM file
31+
pattern: "*.{bam,cram}"
32+
ontologies:
33+
- edam: "http://edamontology.org/format_2572" # BAM
34+
- bai:
35+
type: file
36+
description: Single BAM/CRAM index file
37+
pattern: "*.{bai,crai}"
38+
ontologies:
39+
- edam: "http://edamontology.org/format_3327" # BAM index
40+
- fasta:
41+
type: file
42+
description: Input genome fasta file
43+
pattern: "*.{fasta,fa}"
44+
ontologies:
45+
- edam: "http://edamontology.org/format_1332" # FASTA
46+
output:
47+
summary_report:
48+
- - meta:
49+
type: map
50+
description: |
51+
Groovy Map containing sample information
52+
e.g. [ id:'test', single_end:false ]
53+
- "${prefix}.yml":
54+
type: file
55+
description: |
56+
YAML file summarizing the saturation analysis results.
57+
pattern: "${prefix}.yml"
58+
ontologies:
59+
- edam: http://edamontology.org/format_3750 # YAML
60+
versions_methurator:
61+
- - ${task.process}:
62+
type: string
63+
description: methurator gtestimator
64+
- methurator:
65+
type: string
66+
description: The name of the tool
67+
- methurator --version | sed 's/.* //':
68+
type: eval
69+
description: The expression to obtain the version of the tool
70+
topics:
71+
versions:
72+
- - ${task.process}:
73+
type: string
74+
description: methurator gtestimator
75+
- methurator:
76+
type: string
77+
description: The name of the tool
78+
- methurator --version | sed 's/.* //':
79+
type: eval
80+
description: The expression to obtain the version of the tool
81+
authors:
82+
- "@edogiuili"
83+
maintainers:
84+
- "@edogiuili"
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
nextflow_process {
2+
3+
name "Test Process METHURATOR_GTESTIMATOR"
4+
script "../main.nf"
5+
process "METHURATOR_GTESTIMATOR"
6+
config './nextflow.config'
7+
8+
tag "modules"
9+
tag "modules_nfcore"
10+
tag "methurator"
11+
tag "methurator/gtestimator"
12+
13+
test("Run methurator gt-estimator on paired-end methylated [bam] | sarscov2 genome [fasta]") {
14+
15+
when {
16+
params {
17+
module_args = '--t-max 10 --minimum-coverage 1 --compute_ci'
18+
}
19+
20+
process {
21+
"""
22+
input[0] = [ [ id:'test', single_end:false ],
23+
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam', checkIfExists: true),
24+
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam.bai', checkIfExists: true),
25+
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
26+
]
27+
"""
28+
}
29+
}
30+
31+
then {
32+
assertAll(
33+
{ assert process.success },
34+
{ assert snapshot(
35+
// Avoid first 3 lines of the summary report as they contain the date and time of the run
36+
file(process.out.summary_report[0][1]).readLines()[3..10].join('\n').md5(),
37+
process.out.findAll { key, val -> key.startsWith('versions') }
38+
).match()}
39+
)
40+
}
41+
}
42+
test("Run methurator gt-estimator on paired-end methylated [bam] | sarscov2 genome [fasta] - stub") {
43+
44+
options "-stub"
45+
46+
when {
47+
params {
48+
module_args = '--t-max 10 --minimum-coverage 1 --compute_ci'
49+
}
50+
process {
51+
"""
52+
input[0] = [ [ id:'test', single_end:false ],
53+
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam', checkIfExists: true),
54+
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam.bai', checkIfExists: true),
55+
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
56+
]
57+
"""
58+
}
59+
}
60+
61+
then {
62+
assertAll(
63+
{ assert process.success },
64+
{ assert snapshot(sanitizeOutput(process.out)).match() }
65+
)
66+
}
67+
}
68+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"Run methurator gt-estimator on paired-end methylated [bam] | sarscov2 genome [fasta] - stub": {
3+
"content": [
4+
{
5+
"summary_report": [
6+
[
7+
{
8+
"id": "test",
9+
"single_end": false
10+
},
11+
"test.yml:md5,d41d8cd98f00b204e9800998ecf8427e"
12+
]
13+
],
14+
"versions_methurator": [
15+
[
16+
"METHURATOR_GTESTIMATOR",
17+
"methurator",
18+
"2.1.1"
19+
]
20+
]
21+
}
22+
],
23+
"timestamp": "2026-04-07T22:41:16.975667",
24+
"meta": {
25+
"nf-test": "0.9.5",
26+
"nextflow": "25.10.0"
27+
}
28+
},
29+
"Run methurator gt-estimator on paired-end methylated [bam] | sarscov2 genome [fasta]": {
30+
"content": [
31+
"983d27e4d62f86d15a779820758af458",
32+
{
33+
"versions_methurator": [
34+
[
35+
"METHURATOR_GTESTIMATOR",
36+
"methurator",
37+
"2.1.1"
38+
]
39+
]
40+
}
41+
],
42+
"timestamp": "2026-04-07T14:33:27.127158",
43+
"meta": {
44+
"nf-test": "0.9.5",
45+
"nextflow": "25.10.0"
46+
}
47+
}
48+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
process {
2+
withName: METHURATOR_GTESTIMATOR {
3+
ext.args = params.module_args
4+
}
5+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
3+
channels:
4+
- conda-forge
5+
- bioconda
6+
dependencies:
7+
- "bioconda::methurator=2.1.1"
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
process METHURATOR_PLOT {
2+
tag "${meta.id}"
3+
label 'process_medium'
4+
5+
conda "${moduleDir}/environment.yml"
6+
container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container
7+
? 'https://depot.galaxyproject.org/singularity/methurator:2.1.1--pyhdfd78af_0'
8+
: 'quay.io/biocontainers/methurator:2.1.1--pyhdfd78af_0'}"
9+
10+
input:
11+
tuple val(meta), path(summary_report)
12+
13+
output:
14+
tuple val(meta), path("plots/*.html"), emit: plots
15+
tuple val("${task.process}"), val('methurator'), eval("methurator --version | sed 's/.* //'"), emit: versions_methurator, topic: versions
16+
17+
when:
18+
task.ext.when == null || task.ext.when
19+
20+
script:
21+
"""
22+
methurator plot \\
23+
--summary ${summary_report} \\
24+
--outdir .
25+
26+
"""
27+
28+
stub:
29+
def prefix = task.ext.prefix ?: "${meta.id}"
30+
"""
31+
mkdir plots/
32+
touch plots/${prefix}.html
33+
34+
"""
35+
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: methurator_plot
2+
description: Plots results produced by methurator gtestimator.
3+
keywords:
4+
- rrbs
5+
- BS-seq
6+
- methylation
7+
- 5mC
8+
- methylseq
9+
- bisulphite
10+
- bisulfite
11+
- bam
12+
tools:
13+
- methurator:
14+
description: |
15+
methurator is a Python package designed to estimate sequencing saturation
16+
for DNA methylation sequencing data.
17+
homepage: https://github.com/VIBTOBIlab/methurator
18+
documentation: https://github.com/VIBTOBIlab/methurator/README.md
19+
licence:
20+
- "MIT"
21+
identifier: ""
22+
input:
23+
- - meta:
24+
type: map
25+
description: |
26+
Groovy Map containing sample information
27+
e.g. [ id:'test', single_end:false ]
28+
- summary_report:
29+
type: file
30+
description: |
31+
YAML file summarizing the saturation analysis results.
32+
pattern: "methurator_*.yml"
33+
ontologies:
34+
- edam: http://edamontology.org/format_3750 # YAML
35+
output:
36+
plots:
37+
- - meta:
38+
type: map
39+
description: |
40+
Groovy Map containing sample information
41+
e.g. [ id:'test', single_end:false ]
42+
- plots/*.html:
43+
type: file
44+
description: |
45+
HTML plots generated from the saturation analysis.
46+
pattern: "plots/*.html"
47+
ontologies:
48+
- edam: "http://edamontology.org/format_2331" # HTML
49+
versions_methurator:
50+
- - ${task.process}:
51+
type: string
52+
description: methurator plot
53+
- methurator:
54+
type: string
55+
description: The name of the tool
56+
- methurator --version | sed 's/.* //':
57+
type: eval
58+
description: The expression to obtain the version of the tool
59+
topics:
60+
versions:
61+
- - ${task.process}:
62+
type: string
63+
description: methurator plot
64+
- methurator:
65+
type: string
66+
description: The name of the tool
67+
- methurator --version | sed 's/.* //':
68+
type: eval
69+
description: The expression to obtain the version of the tool
70+
authors:
71+
- "@edogiuili"
72+
maintainers:
73+
- "@edogiuili"

0 commit comments

Comments
 (0)