From 531ef93fb4026d06a7d3778d90b2acbbcc82359f Mon Sep 17 00:00:00 2001 From: Oliver Drechsel Date: Fri, 8 May 2026 15:29:44 +0200 Subject: [PATCH 01/10] Add new component: deeptools/bamcompare --- .../deeptools/bamcompare/environment.yml | 5 + modules/nf-core/deeptools/bamcompare/main.nf | 50 ++++++++ modules/nf-core/deeptools/bamcompare/meta.yml | 96 +++++++++++++++ .../deeptools/bamcompare/tests/main.nf.test | 103 ++++++++++++++++ .../bamcompare/tests/main.nf.test.snap | 114 ++++++++++++++++++ .../bamcompare/tests/nextflow.config | 5 + .../deeptools/bamcompare/tests/tags.yml | 3 + 7 files changed, 376 insertions(+) create mode 100644 modules/nf-core/deeptools/bamcompare/environment.yml create mode 100644 modules/nf-core/deeptools/bamcompare/main.nf create mode 100644 modules/nf-core/deeptools/bamcompare/meta.yml create mode 100644 modules/nf-core/deeptools/bamcompare/tests/main.nf.test create mode 100644 modules/nf-core/deeptools/bamcompare/tests/main.nf.test.snap create mode 100644 modules/nf-core/deeptools/bamcompare/tests/nextflow.config create mode 100644 modules/nf-core/deeptools/bamcompare/tests/tags.yml diff --git a/modules/nf-core/deeptools/bamcompare/environment.yml b/modules/nf-core/deeptools/bamcompare/environment.yml new file mode 100644 index 000000000000..d755dfc6bae7 --- /dev/null +++ b/modules/nf-core/deeptools/bamcompare/environment.yml @@ -0,0 +1,5 @@ +channels: + - conda-forge + - bioconda +dependencies: + - bioconda::deeptools=3.5.6 diff --git a/modules/nf-core/deeptools/bamcompare/main.nf b/modules/nf-core/deeptools/bamcompare/main.nf new file mode 100644 index 000000000000..dd47b3df85bd --- /dev/null +++ b/modules/nf-core/deeptools/bamcompare/main.nf @@ -0,0 +1,50 @@ +// This module was written employing Seqera AI (https://seqera.io/ask-ai/chat-v2) +process DEEPTOOLS_BAMCOMPARE { + 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/deeptools:3.5.6--pyhdfd78af_0' : + 'quay.io/biocontainers/deeptools:3.5.6--pyhdfd78af_0' }" + + input: + tuple val(meta), path(bam1), path(bai1), path(bam2), path(bai2) + + output: + tuple val(meta), path("*.bigWig") , emit: bigwig , optional: true + tuple val(meta), path("*.bedgraph"), emit: bedgraph, optional: true + tuple val("${task.process}"), val('deeptools'), eval('bamCompare --version | sed "s/bamCompare //g"') , emit: versions_deeptools, topic: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + // Determine output format from args or default to bigwig + def format = args.contains('--outFileFormat bedgraph') ? 'bedgraph' : 'bigWig' + def output_file = "${prefix}.${format}" + + """ + bamCompare \\ + --bamfile1 $bam1 \\ + --bamfile2 $bam2 \\ + --outFileName $output_file \\ + --numberOfProcessors $task.cpus \\ + $args + + """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def format = args.contains('--outFileFormat bedgraph') ? 'bedgraph' : 'bigWig' + def output_file = "${prefix}.${format}" + + """ + touch $output_file + + """ +} diff --git a/modules/nf-core/deeptools/bamcompare/meta.yml b/modules/nf-core/deeptools/bamcompare/meta.yml new file mode 100644 index 000000000000..c87eff2880ee --- /dev/null +++ b/modules/nf-core/deeptools/bamcompare/meta.yml @@ -0,0 +1,96 @@ +name: "deeptools_bamcompare" +description: Compares two BAM files based on the number of mapped reads and + generates a bigWig or bedGraph file with the log2 ratio, ratio, difference or + other operations. +keywords: + - bam + - bigwig + - bedgraph + - normalization + - comparison +tools: + - deeptools: + description: A set of user-friendly tools for normalization and + visualization of deep-sequencing data + homepage: https://deeptools.readthedocs.io/en/latest/ + documentation: https://deeptools.readthedocs.io/en/latest/content/tools/bamCompare.html + tool_dev_url: https://github.com/deeptools/deepTools + doi: "10.1093/nar/gkw257" + licence: + - "GPL v3" + identifier: "" +input: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test' ] + - bam1: + type: file + description: Sorted BAM file 1 (usually treatment) + pattern: "*.{bam}" + ontologies: [] + - bai1: + type: file + description: BAM index file for BAM file 1 + pattern: "*.{bai}" + ontologies: [] + - bam2: + type: file + description: Sorted BAM file 2 (usually control) + pattern: "*.{bam}" + ontologies: [] + - bai2: + type: file + description: BAM index file for BAM file 2 + pattern: "*.{bai}" + ontologies: [] +output: + bigwig: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test' ] + - "*.bigWig": + type: file + description: BigWig coverage file of comparison results + pattern: "*.{bigWig}" + ontologies: [] + bedgraph: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test' ] + - "*.bedgraph": + type: file + description: BedGraph coverage file of comparison results + pattern: "*.{bedgraph}" + ontologies: [] + versions_deeptools: + - - ${task.process}: + type: string + description: The name of the process + - deeptools: + type: string + description: The name of the tool + - bamCompare --version | sed "s/bamCompare //g": + type: eval + description: The expression to obtain the version of the tool +topics: + versions: + - - ${task.process}: + type: string + description: The name of the process + - deeptools: + type: string + description: The name of the tool + - bamCompare --version | sed "s/bamCompare //g": + type: eval + description: The expression to obtain the version of the tool +authors: + - "@seqeraai" + - "@oliverdrechsel" +maintainers: + - "@oliverdrechsel" diff --git a/modules/nf-core/deeptools/bamcompare/tests/main.nf.test b/modules/nf-core/deeptools/bamcompare/tests/main.nf.test new file mode 100644 index 000000000000..f2154472c51e --- /dev/null +++ b/modules/nf-core/deeptools/bamcompare/tests/main.nf.test @@ -0,0 +1,103 @@ +nextflow_process { + + name "Test Process DEEPTOOLS_BAMCOMPARE" + script "../main.nf" + process "DEEPTOOLS_BAMCOMPARE" + + tag "modules" + tag "modules_nfcore" + tag "deeptools" + tag "deeptools/bamcompare" + + config "./nextflow.config" + + test("sarscov2 - bam - bigwig") { + + when { + params { + module_args = '' + } + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.single_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.single_end.sorted.bam.bai', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - bam - bedgraph") { + + when { + params { + module_args = '--outFileFormat bedgraph --binSize 10' + } + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.single_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.single_end.sorted.bam.bai', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.bedgraph, + process.out.versions + ).match() } + ) + } + + } + + test("sarscov2 - bam - stub") { + + options "-stub" + + when { + params { + module_args = '' + } + process { + """ + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.single_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.single_end.sorted.bam.bai', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/deeptools/bamcompare/tests/main.nf.test.snap b/modules/nf-core/deeptools/bamcompare/tests/main.nf.test.snap new file mode 100644 index 000000000000..ab0daa1945ce --- /dev/null +++ b/modules/nf-core/deeptools/bamcompare/tests/main.nf.test.snap @@ -0,0 +1,114 @@ +{ + "sarscov2 - bam - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.bigWig:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + + ], + "2": [ + [ + "DEEPTOOLS_BAMCOMPARE", + "deeptools", + "3.5.6" + ] + ], + "bedgraph": [ + + ], + "bigwig": [ + [ + { + "id": "test" + }, + "test.bigWig:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions_deeptools": [ + [ + "DEEPTOOLS_BAMCOMPARE", + "deeptools", + "3.5.6" + ] + ] + } + ], + "timestamp": "2026-05-07T12:55:58.917296921", + "meta": { + "nf-test": "0.9.5", + "nextflow": "25.10.4" + } + }, + "sarscov2 - bam - bedgraph": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.bedgraph:md5,63141eeba79301006699cdee4abf0ff1" + ] + ], + null + ], + "timestamp": "2026-05-07T12:55:08.239773859", + "meta": { + "nf-test": "0.9.5", + "nextflow": "25.10.4" + } + }, + "sarscov2 - bam - bigwig": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.bigWig:md5,c59753155328f9b0dc56746cca440d90" + ] + ], + "1": [ + + ], + "2": [ + [ + "DEEPTOOLS_BAMCOMPARE", + "deeptools", + "3.5.6" + ] + ], + "bedgraph": [ + + ], + "bigwig": [ + [ + { + "id": "test" + }, + "test.bigWig:md5,c59753155328f9b0dc56746cca440d90" + ] + ], + "versions_deeptools": [ + [ + "DEEPTOOLS_BAMCOMPARE", + "deeptools", + "3.5.6" + ] + ] + } + ], + "timestamp": "2026-05-07T12:54:16.387360777", + "meta": { + "nf-test": "0.9.5", + "nextflow": "25.10.4" + } + } +} \ No newline at end of file diff --git a/modules/nf-core/deeptools/bamcompare/tests/nextflow.config b/modules/nf-core/deeptools/bamcompare/tests/nextflow.config new file mode 100644 index 000000000000..2983eb4260c1 --- /dev/null +++ b/modules/nf-core/deeptools/bamcompare/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: 'DEEPTOOLS_BAMCOMPARE' { + ext.args = params.module_args ?: '' + } +} diff --git a/modules/nf-core/deeptools/bamcompare/tests/tags.yml b/modules/nf-core/deeptools/bamcompare/tests/tags.yml new file mode 100644 index 000000000000..7a4858d7c9d1 --- /dev/null +++ b/modules/nf-core/deeptools/bamcompare/tests/tags.yml @@ -0,0 +1,3 @@ +deeptools/bamcompare: + - "modules/nf-core/deeptools/bamcompare/**" + - "tests/modules/nf-core/deeptools/bamcompare/**" From dbc6d486a0c67c39d1edb7f4840d124d4517a2ca Mon Sep 17 00:00:00 2001 From: Oliver Drechsel Date: Fri, 8 May 2026 20:40:48 +0200 Subject: [PATCH 02/10] Update modules/nf-core/deeptools/bamcompare/meta.yml Add identifier Co-authored-by: Jose Espinosa-Carrasco --- modules/nf-core/deeptools/bamcompare/meta.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nf-core/deeptools/bamcompare/meta.yml b/modules/nf-core/deeptools/bamcompare/meta.yml index c87eff2880ee..325cce6ee46d 100644 --- a/modules/nf-core/deeptools/bamcompare/meta.yml +++ b/modules/nf-core/deeptools/bamcompare/meta.yml @@ -18,7 +18,7 @@ tools: doi: "10.1093/nar/gkw257" licence: - "GPL v3" - identifier: "" + identifier: biotools:deeptools input: - - meta: type: map From 5f1f8cfe8844bdc5a91054244486e252dda11905 Mon Sep 17 00:00:00 2001 From: Oliver Drechsel Date: Fri, 8 May 2026 20:41:42 +0200 Subject: [PATCH 03/10] Update modules/nf-core/deeptools/bamcompare/meta.yml fix ontology for bam1 Co-authored-by: Jose Espinosa-Carrasco --- modules/nf-core/deeptools/bamcompare/meta.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/nf-core/deeptools/bamcompare/meta.yml b/modules/nf-core/deeptools/bamcompare/meta.yml index 325cce6ee46d..fd8910fcb6e3 100644 --- a/modules/nf-core/deeptools/bamcompare/meta.yml +++ b/modules/nf-core/deeptools/bamcompare/meta.yml @@ -29,7 +29,8 @@ input: type: file description: Sorted BAM file 1 (usually treatment) pattern: "*.{bam}" - ontologies: [] + ontologies: + - edam: "http://edamontology.org/format_2572" # BAM - bai1: type: file description: BAM index file for BAM file 1 From 0f50b0bcc3ad2f62f4dcb7efa72a3b0a2714aa94 Mon Sep 17 00:00:00 2001 From: Oliver Drechsel Date: Fri, 8 May 2026 20:41:58 +0200 Subject: [PATCH 04/10] Update modules/nf-core/deeptools/bamcompare/meta.yml fix ontology for bai Co-authored-by: Jose Espinosa-Carrasco --- modules/nf-core/deeptools/bamcompare/meta.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/nf-core/deeptools/bamcompare/meta.yml b/modules/nf-core/deeptools/bamcompare/meta.yml index fd8910fcb6e3..f5d4e3644422 100644 --- a/modules/nf-core/deeptools/bamcompare/meta.yml +++ b/modules/nf-core/deeptools/bamcompare/meta.yml @@ -35,7 +35,8 @@ input: type: file description: BAM index file for BAM file 1 pattern: "*.{bai}" - ontologies: [] + ontologies: + - edam: "http://edamontology.org/format_3327" # BAI - bam2: type: file description: Sorted BAM file 2 (usually control) From 8684b7d8ddbdb06365a89f89c55521f2ef021dea Mon Sep 17 00:00:00 2001 From: Oliver Drechsel Date: Fri, 8 May 2026 20:42:25 +0200 Subject: [PATCH 05/10] Update modules/nf-core/deeptools/bamcompare/meta.yml fix ontology for bai2 Co-authored-by: Jose Espinosa-Carrasco --- modules/nf-core/deeptools/bamcompare/meta.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/nf-core/deeptools/bamcompare/meta.yml b/modules/nf-core/deeptools/bamcompare/meta.yml index f5d4e3644422..123be9533e56 100644 --- a/modules/nf-core/deeptools/bamcompare/meta.yml +++ b/modules/nf-core/deeptools/bamcompare/meta.yml @@ -46,7 +46,8 @@ input: type: file description: BAM index file for BAM file 2 pattern: "*.{bai}" - ontologies: [] + ontologies: + - edam: "http://edamontology.org/format_3327" # BAI output: bigwig: - - meta: From 3572766dfb722dd9f37d9f3d279488c5e9d3f4ef Mon Sep 17 00:00:00 2001 From: Oliver Drechsel Date: Fri, 8 May 2026 20:42:40 +0200 Subject: [PATCH 06/10] Update modules/nf-core/deeptools/bamcompare/meta.yml fix ontology for bam2 Co-authored-by: Jose Espinosa-Carrasco --- modules/nf-core/deeptools/bamcompare/meta.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/nf-core/deeptools/bamcompare/meta.yml b/modules/nf-core/deeptools/bamcompare/meta.yml index 123be9533e56..fb1af6a926b5 100644 --- a/modules/nf-core/deeptools/bamcompare/meta.yml +++ b/modules/nf-core/deeptools/bamcompare/meta.yml @@ -41,7 +41,8 @@ input: type: file description: Sorted BAM file 2 (usually control) pattern: "*.{bam}" - ontologies: [] + ontologies: + - edam: "http://edamontology.org/format_2572" # BAM - bai2: type: file description: BAM index file for BAM file 2 From 013bd15472de1a79729c463ddda683b1bc096bff Mon Sep 17 00:00:00 2001 From: Oliver Drechsel Date: Fri, 8 May 2026 20:42:55 +0200 Subject: [PATCH 07/10] Update modules/nf-core/deeptools/bamcompare/meta.yml fix ontology for bigwig Co-authored-by: Jose Espinosa-Carrasco --- modules/nf-core/deeptools/bamcompare/meta.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/nf-core/deeptools/bamcompare/meta.yml b/modules/nf-core/deeptools/bamcompare/meta.yml index fb1af6a926b5..f3078d010177 100644 --- a/modules/nf-core/deeptools/bamcompare/meta.yml +++ b/modules/nf-core/deeptools/bamcompare/meta.yml @@ -60,7 +60,8 @@ output: type: file description: BigWig coverage file of comparison results pattern: "*.{bigWig}" - ontologies: [] + ontologies: + - edam: "http://edamontology.org/format_3006" # bigWig bedgraph: - - meta: type: map From 485d722da51fbfaf7ac8e283f99171ed1b63f47f Mon Sep 17 00:00:00 2001 From: Oliver Drechsel Date: Fri, 8 May 2026 20:43:10 +0200 Subject: [PATCH 08/10] Update modules/nf-core/deeptools/bamcompare/meta.yml fix ontology for bedgraph Co-authored-by: Jose Espinosa-Carrasco --- modules/nf-core/deeptools/bamcompare/meta.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/nf-core/deeptools/bamcompare/meta.yml b/modules/nf-core/deeptools/bamcompare/meta.yml index f3078d010177..2de1ee2d66c5 100644 --- a/modules/nf-core/deeptools/bamcompare/meta.yml +++ b/modules/nf-core/deeptools/bamcompare/meta.yml @@ -72,7 +72,8 @@ output: type: file description: BedGraph coverage file of comparison results pattern: "*.{bedgraph}" - ontologies: [] + ontologies: + - edam: "http://edamontology.org/format_3583" # BedGraph versions_deeptools: - - ${task.process}: type: string From 89f575c54bfd7780a717a6728783a06992a3ee0b Mon Sep 17 00:00:00 2001 From: Oliver Drechsel Date: Fri, 8 May 2026 20:43:22 +0200 Subject: [PATCH 09/10] Update modules/nf-core/deeptools/bamcompare/main.nf Co-authored-by: Jose Espinosa-Carrasco --- modules/nf-core/deeptools/bamcompare/main.nf | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/nf-core/deeptools/bamcompare/main.nf b/modules/nf-core/deeptools/bamcompare/main.nf index dd47b3df85bd..28e6e491b184 100644 --- a/modules/nf-core/deeptools/bamcompare/main.nf +++ b/modules/nf-core/deeptools/bamcompare/main.nf @@ -34,7 +34,6 @@ process DEEPTOOLS_BAMCOMPARE { --outFileName $output_file \\ --numberOfProcessors $task.cpus \\ $args - """ stub: From 4a33fb684d69d786502d5dc4b81cebc9043f9e69 Mon Sep 17 00:00:00 2001 From: Oliver Drechsel Date: Fri, 8 May 2026 20:43:32 +0200 Subject: [PATCH 10/10] Update modules/nf-core/deeptools/bamcompare/main.nf Co-authored-by: Jose Espinosa-Carrasco --- modules/nf-core/deeptools/bamcompare/main.nf | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/nf-core/deeptools/bamcompare/main.nf b/modules/nf-core/deeptools/bamcompare/main.nf index 28e6e491b184..6eb0779f6001 100644 --- a/modules/nf-core/deeptools/bamcompare/main.nf +++ b/modules/nf-core/deeptools/bamcompare/main.nf @@ -44,6 +44,5 @@ process DEEPTOOLS_BAMCOMPARE { """ touch $output_file - """ }