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
13 changes: 7 additions & 6 deletions modules/nf-core/verifybamid/verifybamid2/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ process VERIFYBAMID_VERIFYBAMID2 {
label 'process_low'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/verifybamid2:2.0.1--hbb20b25_6' :
'biocontainers/verifybamid2:2.0.1--h19d48f6_8' }"
container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container
? 'https://depot.galaxyproject.org/singularity/verifybamid2:2.0.1--hbb20b25_6'
: 'biocontainers/verifybamid2:2.0.1--h19d48f6_8'}"

input:
tuple val(meta), path(bam), path(bai)
Expand Down Expand Up @@ -36,12 +36,13 @@ process VERIFYBAMID_VERIFYBAMID2 {
"--SVDPrefix ${svd_ud.baseName}" : "--UDPath ${svd_ud} --MeanPath ${svd_mu} --BedPath ${svd_bed}"
def refvcf_args = "${refvcf}".endsWith(".vcf") ? "--RefVCF ${refvcf}" : ""

def reference_args = ("$references".endsWith('.fasta')) ?
"--Reference ${references}" : ''
def reference_args = "${references}".matches(/.+((fasta)|(fa)|(fna))(\.gz)*$/)
? "--Reference ${references}"
: ''

"""
verifybamid2 \\
--NumThread $task.cpus \\
--NumThread ${task.cpus} \\
${svd_args} \\
${bam_file} \\
${refvcf_args} \\
Expand Down
59 changes: 59 additions & 0 deletions modules/nf-core/verifybamid/verifybamid2/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ nextflow_process {
}
}


test("Should run with panel input") {
config "./nextflow.config"

Expand Down Expand Up @@ -177,4 +178,62 @@ nextflow_process {
)
}
}

test("Should run with alternative .fa reference input -stub") {
config "./nextflow.config"

when {
process {
"""
input[0] = [ [ id:'test', single_end:false ],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam'),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam.bai') ]
input[1] = [ [], [], [] ]
input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf')
input[3] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genomeGRCh38_chr21_22.fa.gz')
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(
file(process.out.log[0][1]).name,
process.out.bed,
process.out.mu,
process.out.self_sm,
process.out.ancestry,
process.out.versions,
file(process.out.ud[0][1]).name
).match() }
)
}
}

test("Should run with alternative .fa reference input") {
config "./nextflow.config"

options "-stub"

when {
process {
"""
input[0] = [ [ id:'test', single_end:false ],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam'),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam.bai') ]
input[1] = [ [], [], [] ]
input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf')
input[3] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genomeGRCh38_chr21_22.fa.gz')
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}
}
}
151 changes: 151 additions & 0 deletions modules/nf-core/verifybamid/verifybamid2/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,42 @@
{
"Should run with alternative .fa reference input -stub": {
"content": [
"test.log",
[
[
{
"id": "test",
"single_end": false
},
"test.genome.vcf.bed:md5,47106c764019ee359b1936410e2efa1e"
]
],
[
[
{
"id": "test",
"single_end": false
},
"test.genome.vcf.mu:md5,0810db02af2a176fa5ddc0f404911b66"
]
],
[

],
[

],
[
"versions.yml:md5,199f2e02b570926d6a249055c917c6b1"
],
"test.genome.vcf.UD"
],
"meta": {
"nf-test": "0.9.3",
"nextflow": "25.10.0"
},
"timestamp": "2025-12-12T12:09:25.523364"
},
"Should run with panel input": {
"content": [
"test.log",
Expand Down Expand Up @@ -238,6 +276,119 @@
},
"timestamp": "2025-05-05T16:45:57.687144464"
},
"Should run with alternative .fa reference input": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test.log:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [

],
"2": [
[
{
"id": "test",
"single_end": false
},
"test.bed:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"3": [
[
{
"id": "test",
"single_end": false
},
"test.mu:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"4": [
[
{
"id": "test",
"single_end": false
},
"test.selfSM:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"5": [
[
{
"id": "test",
"single_end": false
},
"test.Ancestry:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"6": [
"versions.yml:md5,199f2e02b570926d6a249055c917c6b1"
],
"ancestry": [
[
{
"id": "test",
"single_end": false
},
"test.Ancestry:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"bed": [
[
{
"id": "test",
"single_end": false
},
"test.bed:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"log": [
[
{
"id": "test",
"single_end": false
},
"test.log:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"mu": [
[
{
"id": "test",
"single_end": false
},
"test.mu:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"self_sm": [
[
{
"id": "test",
"single_end": false
},
"test.selfSM:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"ud": [

],
"versions": [
"versions.yml:md5,199f2e02b570926d6a249055c917c6b1"
]
}
],
"meta": {
"nf-test": "0.9.3",
"nextflow": "25.10.0"
},
"timestamp": "2025-12-12T12:28:45.106596"
},
"Should run with SVD input": {
"content": [
{
Expand Down
Loading