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

Added nf-test for paragraph/vcf2paragraph #6448

Merged
merged 3 commits into from
Aug 30, 2024
Merged
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
3 changes: 3 additions & 0 deletions modules/nf-core/paragraph/vcf2paragraph/environment.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
name: paragraph_vcf2paragraph

channels:
- conda-forge
- bioconda
- defaults

dependencies:
- bioconda::htslib=1.10.2
- bioconda::paragraph=2.3
2 changes: 1 addition & 1 deletion modules/nf-core/paragraph/vcf2paragraph/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ process PARAGRAPH_VCF2PARAGRAPH {
def VERSION = '2.3' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.

"""
touch ${prefix}.json.gz
echo | gzip > ${prefix}.json.gz

cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
2 changes: 1 addition & 1 deletion modules/nf-core/paragraph/vcf2paragraph/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ tools:
documentation: "https://github.com/Illumina/paragraph"
tool_dev_url: "https://github.com/Illumina/paragraph"
doi: "10.1101/635011"
licence: "['Apache License 2.0']"
licence: ["Apache License 2.0"]
input:
- meta:
type: map
Expand Down
64 changes: 64 additions & 0 deletions modules/nf-core/paragraph/vcf2paragraph/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@

nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "paragraph"
tag "paragraph/vcf2paragraph"

test("test-paragraph-vcf2paragraph") {

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test_haplotcaller.cnn.vcf.gz', checkIfExists: true)
]
input[1] = [ [], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) ]

"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(
process.out.graph,
process.out.versions,
file(process.out.versions[0]).readLines().collect { it.trim() } // Trap to catch conda version mismatches
).match()
}
)
}
}

test("test-paragraph-vcf2paragraph-stub") {
options '-stub'
when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test_haplotcaller.cnn.vcf.gz', checkIfExists: true)
]
input[1] = [ [], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) ]

"""
}
}

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

}
63 changes: 63 additions & 0 deletions modules/nf-core/paragraph/vcf2paragraph/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"test-paragraph-vcf2paragraph": {
"content": [
[
[
{
"id": "test",
"single_end": false
},
"test.json.gz:md5,68dce3f3713b691f9ab45744500871bf"
]
],
[
"versions.yml:md5,a7024dd35463d16da31df17264fdad6d"
],
[
"\"PARAGRAPH_VCF2PARAGRAPH\":",
"paragraph: 2.3",
"bgzip: 1.10.2"
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.4"
},
"timestamp": "2024-08-30T10:55:01.125722"
},
"test-paragraph-vcf2paragraph-stub": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test.json.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
],
"1": [
"versions.yml:md5,a7024dd35463d16da31df17264fdad6d"
],
"graph": [
[
{
"id": "test",
"single_end": false
},
"test.json.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
],
"versions": [
"versions.yml:md5,a7024dd35463d16da31df17264fdad6d"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.4"
},
"timestamp": "2024-08-29T16:42:34.344697"
}
}
3 changes: 0 additions & 3 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -716,9 +716,6 @@ paragraph/idxdepth:
paragraph/multigrmpy:
- modules/nf-core/paragraph/multigrmpy/**
- tests/modules/nf-core/paragraph/multigrmpy/**
paragraph/vcf2paragraph:
- modules/nf-core/paragraph/vcf2paragraph/**
- tests/modules/nf-core/paragraph/vcf2paragraph/**
pbbam/pbmerge:
- modules/nf-core/pbbam/pbmerge/**
- tests/modules/nf-core/pbbam/pbmerge/**
Expand Down
20 changes: 0 additions & 20 deletions tests/modules/nf-core/paragraph/vcf2paragraph/main.nf

This file was deleted.

5 changes: 0 additions & 5 deletions tests/modules/nf-core/paragraph/vcf2paragraph/nextflow.config

This file was deleted.

9 changes: 0 additions & 9 deletions tests/modules/nf-core/paragraph/vcf2paragraph/test.yml

This file was deleted.

Loading