Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
3 changes: 3 additions & 0 deletions modules/nf-core/sambamba/depth/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ process SAMBAMBA_DEPTH {

input:
tuple val(meta), path(bam), path(bai)
tuple val(meta2), path(bed)
val(mode)

output:
Expand All @@ -24,11 +25,13 @@ process SAMBAMBA_DEPTH {
if (!['region','window','base'].contains(mode)) {
error "Mode needs to be one of: region, window, base"
}
def bed_arg = bed ? "--regions ${bed}" : ''

"""
sambamba \\
depth \\
$mode \\
$bed_arg \\
$args \\
-t $task.cpus \\
-o ${prefix}.bed \\
Expand Down
10 changes: 10 additions & 0 deletions modules/nf-core/sambamba/depth/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ input:
pattern: "*.{bai}"
ontologies:
- edam: "http://edamontology.org/format_2572"
- - meta2:
type: map
description: |
Groovy Map containing sample information
- bed:
type: file
description: bed file
pattern: "*.{bed}"
ontologies:
- edam: "http://edamontology.org/format_3586" # bed12
- mode:
type: string
description: Analysis mode can be region, window, base
Expand Down
33 changes: 31 additions & 2 deletions modules/nf-core/sambamba/depth/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ nextflow_process {
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true)
]
input[1] = 'base'
input[1] = [[], []]
input[2] = 'base'

"""
}
Expand All @@ -34,6 +35,33 @@ nextflow_process {
}
}

test("test-sambamba-depth-with-region-bed") {

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true)
]
input[1] = [
[ id:'test2' ], // meta2 map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed', checkIfExists: true)
]
input[2] = 'region'

"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}
}

test("test-sambamba-depth-stub") {

Expand All @@ -47,7 +75,8 @@ nextflow_process {
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true)
]
input[1] = 'base'
input[1] = [[], []]
input[2] = 'base'

"""
}
Expand Down
43 changes: 39 additions & 4 deletions modules/nf-core/sambamba/depth/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,39 @@
{
"test-sambamba-depth-with-region-bed": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test.bed:md5,e312edd2c0a9f63b833b5a8913952ba6"
]
],
"1": [
"versions.yml:md5,6e2f38cc3306b1ea59da275d9de28d57"
],
"bed": [
[
{
"id": "test",
"single_end": false
},
"test.bed:md5,e312edd2c0a9f63b833b5a8913952ba6"
]
],
"versions": [
"versions.yml:md5,6e2f38cc3306b1ea59da275d9de28d57"
]
}
],
"meta": {
"nf-test": "0.9.3",
"nextflow": "25.10.0"
},
"timestamp": "2025-12-03T15:57:58.097957"
},
"test-sambamba-depth": {
"content": [
{
Expand Down Expand Up @@ -29,10 +64,10 @@
}
],
"meta": {
"nf-test": "0.9.2",
"nf-test": "0.9.3",
"nextflow": "25.10.0"
},
"timestamp": "2025-11-12T15:12:13.586918"
"timestamp": "2025-12-03T15:57:42.031913"
},
"test-sambamba-depth-stub": {
"content": [
Expand Down Expand Up @@ -64,9 +99,9 @@
}
],
"meta": {
"nf-test": "0.9.2",
"nf-test": "0.9.3",
"nextflow": "25.10.0"
},
"timestamp": "2025-11-12T15:12:29.380779"
"timestamp": "2025-12-03T15:58:13.647811"
}
}
Loading