Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add stub and test to lofreq/indelqual #5941

Merged
merged 14 commits into from
Jul 19, 2024
12 changes: 12 additions & 0 deletions modules/nf-core/lofreq/indelqual/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,16 @@ process LOFREQ_INDELQUAL {
lofreq: \$(echo \$(lofreq version 2>&1) | sed 's/^version: //; s/ *commit.*\$//')
END_VERSIONS
"""

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.bam

cat <<-END_VERSIONS > versions.yml
"${task.process}":
lofreq: \$(echo \$(lofreq version 2>&1) | sed 's/^version: //; s/ *commit.*\$//')
END_VERSIONS
"""
}
3 changes: 3 additions & 0 deletions modules/nf-core/lofreq/indelqual/meta.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: lofreq_indelqual
description: Inserts indel qualities in a BAM file
keywords:
- variant calling
- variants
- bam
- indel
- qualities
Expand Down Expand Up @@ -40,5 +42,6 @@ output:
pattern: "*.{bam}"
authors:
- "@kaurravneet4123"
- "@krannich479"
maintainers:
- "@kaurravneet4123"
64 changes: 64 additions & 0 deletions modules/nf-core/lofreq/indelqual/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
nextflow_process {

name "Test Process LOFREQ_INDELQUAL"
script "../main.nf"
process "LOFREQ_INDELQUAL"

tag "modules"
tag "modules_nfcore"
tag "lofreq"
tag "lofreq/indelqual"

test("sarscov2 - bam, fasta") {

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true)
]
input[1] = [
file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
]
Krannich479 marked this conversation as resolved.
Show resolved Hide resolved
"""
}
}

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

}

test("sarscov2 - bam, fasta - stub") {
Krannich479 marked this conversation as resolved.
Show resolved Hide resolved

options "-stub"

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true)
]
input[1] = [
file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
]
"""
}
}

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

}

}
Loading