Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions modules/nf-core/deeptools/bamcompare/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
channels:
- conda-forge
- bioconda
dependencies:
- bioconda::deeptools=3.5.6
48 changes: 48 additions & 0 deletions modules/nf-core/deeptools/bamcompare/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// 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
"""
}
102 changes: 102 additions & 0 deletions modules/nf-core/deeptools/bamcompare/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
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: biotools:deeptools
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:
- edam: "http://edamontology.org/format_2572" # BAM
- bai1:
type: file
description: BAM index file for BAM file 1
pattern: "*.{bai}"
ontologies:
- edam: "http://edamontology.org/format_3327" # BAI
- bam2:
type: file
description: Sorted BAM file 2 (usually control)
pattern: "*.{bam}"
ontologies:
- edam: "http://edamontology.org/format_2572" # BAM
- bai2:
type: file
description: BAM index file for BAM file 2
pattern: "*.{bai}"
ontologies:
- edam: "http://edamontology.org/format_3327" # BAI
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:
- edam: "http://edamontology.org/format_3006" # bigWig
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:
- edam: "http://edamontology.org/format_3583" # BedGraph
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"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, we only allow for valid GitHub users by the moment, if you want you could raise it on slack to see what others think

Suggested change
- "@seqeraai"

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point.
I asked the Slack community and would wait a little to collect opinions.

I'd like to credit the AI somehow. The format is less important to me.

- "@oliverdrechsel"
maintainers:
- "@oliverdrechsel"
103 changes: 103 additions & 0 deletions modules/nf-core/deeptools/bamcompare/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -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() }
)
}

}

}
114 changes: 114 additions & 0 deletions modules/nf-core/deeptools/bamcompare/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
5 changes: 5 additions & 0 deletions modules/nf-core/deeptools/bamcompare/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
process {
withName: 'DEEPTOOLS_BAMCOMPARE' {
ext.args = params.module_args ?: ''
}
}
3 changes: 3 additions & 0 deletions modules/nf-core/deeptools/bamcompare/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
deeptools/bamcompare:
- "modules/nf-core/deeptools/bamcompare/**"
- "tests/modules/nf-core/deeptools/bamcompare/**"
Loading