From 91a84f951358143e93dc9e03470db4e6a4a7105c Mon Sep 17 00:00:00 2001 From: Felix Lenner <52530259+fellen31@users.noreply.github.com> Date: Mon, 28 Oct 2024 09:42:04 +0100 Subject: [PATCH] Bump genmod and add stub tests (#6846) Co-authored-by: Sateesh_Peri <33637490+sateeshperi@users.noreply.github.com> --- .../nf-core/genmod/annotate/environment.yml | 2 +- modules/nf-core/genmod/annotate/main.nf | 6 +-- .../genmod/annotate/tests/main.nf.test | 31 +++++++++++- .../genmod/annotate/tests/main.nf.test.snap | 50 +++++++++++++++++++ .../nf-core/genmod/compound/environment.yml | 2 +- modules/nf-core/genmod/compound/main.nf | 6 +-- .../genmod/compound/tests/main.nf.test | 31 +++++++++++- .../genmod/compound/tests/main.nf.test.snap | 50 +++++++++++++++++++ modules/nf-core/genmod/models/environment.yml | 2 +- modules/nf-core/genmod/models/main.nf | 6 +-- .../nf-core/genmod/models/tests/main.nf.test | 32 +++++++++++- .../genmod/models/tests/main.nf.test.snap | 50 +++++++++++++++++++ modules/nf-core/genmod/score/environment.yml | 2 +- modules/nf-core/genmod/score/main.nf | 6 +-- .../nf-core/genmod/score/tests/main.nf.test | 33 +++++++++++- .../genmod/score/tests/main.nf.test.snap | 50 +++++++++++++++++++ 16 files changed, 335 insertions(+), 24 deletions(-) create mode 100644 modules/nf-core/genmod/annotate/tests/main.nf.test.snap create mode 100644 modules/nf-core/genmod/compound/tests/main.nf.test.snap create mode 100644 modules/nf-core/genmod/models/tests/main.nf.test.snap create mode 100644 modules/nf-core/genmod/score/tests/main.nf.test.snap diff --git a/modules/nf-core/genmod/annotate/environment.yml b/modules/nf-core/genmod/annotate/environment.yml index bbc3fd973a9..227ee89204f 100644 --- a/modules/nf-core/genmod/annotate/environment.yml +++ b/modules/nf-core/genmod/annotate/environment.yml @@ -2,4 +2,4 @@ channels: - conda-forge - bioconda dependencies: - - bioconda::genmod=3.8.3 + - bioconda::genmod=3.9 diff --git a/modules/nf-core/genmod/annotate/main.nf b/modules/nf-core/genmod/annotate/main.nf index 033caa9ae93..0b8b232de83 100644 --- a/modules/nf-core/genmod/annotate/main.nf +++ b/modules/nf-core/genmod/annotate/main.nf @@ -4,15 +4,15 @@ process GENMOD_ANNOTATE { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/genmod:3.8.3--pyhdfd78af_0': - 'biocontainers/genmod:3.8.3--pyhdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/genmod:3.9--pyhdfd78af_0': + 'biocontainers/genmod:3.9--pyhdfd78af_0' }" input: tuple val(meta), path(input_vcf) output: tuple val(meta), path("*_annotate.vcf"), emit: vcf - path "versions.yml" , emit: versions + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/genmod/annotate/tests/main.nf.test b/modules/nf-core/genmod/annotate/tests/main.nf.test index d17ebc9ea96..a4b3fccba92 100644 --- a/modules/nf-core/genmod/annotate/tests/main.nf.test +++ b/modules/nf-core/genmod/annotate/tests/main.nf.test @@ -24,8 +24,35 @@ nextflow_process { then { assertAll( - {assert process.success}, - {assert path(process.out.vcf.get(0).get(1)).readLines().contains("##fileformat=VCFv4.2")} + { assert process.success }, + { assert snapshot( + process.out.versions, + path(process.out.vcf.get(0).get(1)).vcf.summary, + ).match() } + ) + } + + } + + test("genmod_annotate - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/genmod.vcf.gz', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } ) } diff --git a/modules/nf-core/genmod/annotate/tests/main.nf.test.snap b/modules/nf-core/genmod/annotate/tests/main.nf.test.snap new file mode 100644 index 00000000000..402b5c01cf1 --- /dev/null +++ b/modules/nf-core/genmod/annotate/tests/main.nf.test.snap @@ -0,0 +1,50 @@ +{ + "genmod_annotate": { + "content": [ + [ + "versions.yml:md5,6ce3597967a536ab027d02f75d02056c" + ], + "VcfFile [chromosomes=[1], sampleCount=3, variantCount=57, phased=false, phasedAutodetect=false]" + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-25T11:44:57.176895794" + }, + "genmod_annotate - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_annotate.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,6ce3597967a536ab027d02f75d02056c" + ], + "vcf": [ + [ + { + "id": "test", + "single_end": false + }, + "test_annotate.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,6ce3597967a536ab027d02f75d02056c" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-25T11:49:16.409331019" + } +} \ No newline at end of file diff --git a/modules/nf-core/genmod/compound/environment.yml b/modules/nf-core/genmod/compound/environment.yml index bbc3fd973a9..227ee89204f 100644 --- a/modules/nf-core/genmod/compound/environment.yml +++ b/modules/nf-core/genmod/compound/environment.yml @@ -2,4 +2,4 @@ channels: - conda-forge - bioconda dependencies: - - bioconda::genmod=3.8.3 + - bioconda::genmod=3.9 diff --git a/modules/nf-core/genmod/compound/main.nf b/modules/nf-core/genmod/compound/main.nf index 4831da855fa..ca6a22a1994 100644 --- a/modules/nf-core/genmod/compound/main.nf +++ b/modules/nf-core/genmod/compound/main.nf @@ -4,15 +4,15 @@ process GENMOD_COMPOUND { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/genmod:3.8.3--pyhdfd78af_0': - 'biocontainers/genmod:3.8.3--pyhdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/genmod:3.9--pyhdfd78af_0': + 'biocontainers/genmod:3.9--pyhdfd78af_0' }" input: tuple val(meta), path(input_vcf) output: tuple val(meta), path("*_compound.vcf"), emit: vcf - path "versions.yml" , emit: versions + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/genmod/compound/tests/main.nf.test b/modules/nf-core/genmod/compound/tests/main.nf.test index 43ed9f0dcf0..4c667c17373 100644 --- a/modules/nf-core/genmod/compound/tests/main.nf.test +++ b/modules/nf-core/genmod/compound/tests/main.nf.test @@ -23,8 +23,35 @@ nextflow_process { then { assertAll( - {assert process.success}, - {assert path(process.out.vcf.get(0).get(1)).readLines().contains("##fileformat=VCFv4.2")} + { assert process.success }, + { assert snapshot( + process.out.versions, + path(process.out.vcf.get(0).get(1)).vcf.summary, + ).match() } + ) + } + + } + + test("genmod_compound - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/genmod_compound.vcf', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } ) } diff --git a/modules/nf-core/genmod/compound/tests/main.nf.test.snap b/modules/nf-core/genmod/compound/tests/main.nf.test.snap new file mode 100644 index 00000000000..b114cc3310c --- /dev/null +++ b/modules/nf-core/genmod/compound/tests/main.nf.test.snap @@ -0,0 +1,50 @@ +{ + "genmod_compound": { + "content": [ + [ + "versions.yml:md5,822fb501a48a6f8c28ba8f678d27ba2e" + ], + "VcfFile [chromosomes=[MT], sampleCount=3, variantCount=22, phased=false, phasedAutodetect=false]" + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-25T11:49:41.417545149" + }, + "genmod_compound - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_compound.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,822fb501a48a6f8c28ba8f678d27ba2e" + ], + "vcf": [ + [ + { + "id": "test", + "single_end": false + }, + "test_compound.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,822fb501a48a6f8c28ba8f678d27ba2e" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-25T11:49:48.678803012" + } +} \ No newline at end of file diff --git a/modules/nf-core/genmod/models/environment.yml b/modules/nf-core/genmod/models/environment.yml index bbc3fd973a9..227ee89204f 100644 --- a/modules/nf-core/genmod/models/environment.yml +++ b/modules/nf-core/genmod/models/environment.yml @@ -2,4 +2,4 @@ channels: - conda-forge - bioconda dependencies: - - bioconda::genmod=3.8.3 + - bioconda::genmod=3.9 diff --git a/modules/nf-core/genmod/models/main.nf b/modules/nf-core/genmod/models/main.nf index 90c1fd48233..ff71b660fb5 100644 --- a/modules/nf-core/genmod/models/main.nf +++ b/modules/nf-core/genmod/models/main.nf @@ -4,8 +4,8 @@ process GENMOD_MODELS { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/genmod:3.8.3--pyhdfd78af_0': - 'biocontainers/genmod:3.8.3--pyhdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/genmod:3.9--pyhdfd78af_0': + 'biocontainers/genmod:3.9--pyhdfd78af_0' }" input: tuple val(meta), path(input_vcf) @@ -14,7 +14,7 @@ process GENMOD_MODELS { output: tuple val(meta), path("*_models.vcf"), emit: vcf - path "versions.yml" , emit: versions + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/genmod/models/tests/main.nf.test b/modules/nf-core/genmod/models/tests/main.nf.test index 9eba8dd5231..afa85dfc626 100644 --- a/modules/nf-core/genmod/models/tests/main.nf.test +++ b/modules/nf-core/genmod/models/tests/main.nf.test @@ -25,11 +25,39 @@ nextflow_process { then { assertAll( - {assert process.success}, - {assert path(process.out.vcf.get(0).get(1)).readLines().contains("##fileformat=VCFv4.2")} + { assert process.success }, + { assert snapshot( + process.out.versions, + path(process.out.vcf.get(0).get(1)).vcf.summary, + ).match() } ) } } + test("genmod_models - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/test_annotate.vcf.gz', checkIfExists: true) + ] + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/ped/justhusky.ped', checkIfExists: true) + input[2] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } } diff --git a/modules/nf-core/genmod/models/tests/main.nf.test.snap b/modules/nf-core/genmod/models/tests/main.nf.test.snap new file mode 100644 index 00000000000..7484a7fd0f9 --- /dev/null +++ b/modules/nf-core/genmod/models/tests/main.nf.test.snap @@ -0,0 +1,50 @@ +{ + "genmod_models - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_models.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,10442b1602069000967f51837d7b5b63" + ], + "vcf": [ + [ + { + "id": "test", + "single_end": false + }, + "test_models.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,10442b1602069000967f51837d7b5b63" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-25T11:51:04.841425679" + }, + "genmod_models": { + "content": [ + [ + "versions.yml:md5,10442b1602069000967f51837d7b5b63" + ], + "VcfFile [chromosomes=[1], sampleCount=3, variantCount=57, phased=false, phasedAutodetect=false]" + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-25T11:49:56.642318737" + } +} \ No newline at end of file diff --git a/modules/nf-core/genmod/score/environment.yml b/modules/nf-core/genmod/score/environment.yml index bbc3fd973a9..227ee89204f 100644 --- a/modules/nf-core/genmod/score/environment.yml +++ b/modules/nf-core/genmod/score/environment.yml @@ -2,4 +2,4 @@ channels: - conda-forge - bioconda dependencies: - - bioconda::genmod=3.8.3 + - bioconda::genmod=3.9 diff --git a/modules/nf-core/genmod/score/main.nf b/modules/nf-core/genmod/score/main.nf index 522e05b6581..41d57bdc194 100644 --- a/modules/nf-core/genmod/score/main.nf +++ b/modules/nf-core/genmod/score/main.nf @@ -4,8 +4,8 @@ process GENMOD_SCORE { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/genmod:3.8.3--pyhdfd78af_0': - 'biocontainers/genmod:3.8.3--pyhdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/genmod:3.9--pyhdfd78af_0': + 'biocontainers/genmod:3.9--pyhdfd78af_0' }" input: tuple val(meta), path(input_vcf) @@ -14,7 +14,7 @@ process GENMOD_SCORE { output: tuple val(meta), path("*_score.vcf"), emit: vcf - path "versions.yml" , emit: versions + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/genmod/score/tests/main.nf.test b/modules/nf-core/genmod/score/tests/main.nf.test index 030ef6ba7f9..98c8f35ae2d 100644 --- a/modules/nf-core/genmod/score/tests/main.nf.test +++ b/modules/nf-core/genmod/score/tests/main.nf.test @@ -25,8 +25,37 @@ nextflow_process { then { assertAll( - {assert process.success}, - {assert path(process.out.vcf.get(0).get(1)).readLines().contains("##fileformat=VCFv4.2")} + { assert process.success }, + { assert snapshot( + process.out.versions, + path(process.out.vcf.get(0).get(1)).vcf.summary, + ).match() } + ) + } + + } + + test("genmod_score - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/test_models.vcf.gz', checkIfExists: true) + ] + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/ped/justhusky.ped', checkIfExists: true) + input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/genmod/svrank_model_-v1.8-.ini', checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } ) } diff --git a/modules/nf-core/genmod/score/tests/main.nf.test.snap b/modules/nf-core/genmod/score/tests/main.nf.test.snap new file mode 100644 index 00000000000..b484b8e12ae --- /dev/null +++ b/modules/nf-core/genmod/score/tests/main.nf.test.snap @@ -0,0 +1,50 @@ +{ + "genmod_score": { + "content": [ + [ + "versions.yml:md5,f310225b3c35456e84d52e2c400e2fd8" + ], + "VcfFile [chromosomes=[1], sampleCount=3, variantCount=57, phased=false, phasedAutodetect=false]" + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-25T11:50:12.03483811" + }, + "genmod_score - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_score.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,f310225b3c35456e84d52e2c400e2fd8" + ], + "vcf": [ + [ + { + "id": "test", + "single_end": false + }, + "test_score.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,f310225b3c35456e84d52e2c400e2fd8" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-25T11:50:19.675962486" + } +} \ No newline at end of file