diff --git a/modules/nf-core/stranger/environment.yml b/modules/nf-core/stranger/environment.yml index 78455053e2f..8ff526a24c5 100644 --- a/modules/nf-core/stranger/environment.yml +++ b/modules/nf-core/stranger/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::stranger=0.8.1 + - bioconda::stranger=0.9.0 diff --git a/modules/nf-core/stranger/main.nf b/modules/nf-core/stranger/main.nf index dd44bb99e4a..c72bf812741 100644 --- a/modules/nf-core/stranger/main.nf +++ b/modules/nf-core/stranger/main.nf @@ -4,8 +4,8 @@ process STRANGER { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/stranger:0.8.1--pyh5e36f6f_0': - 'biocontainers/stranger:0.8.1--pyh5e36f6f_0' }" + 'https://depot.galaxyproject.org/singularity/stranger:0.9.0--pyh7cba7a3_0': + 'biocontainers/stranger:0.9.0--pyh7cba7a3_0' }" input: tuple val(meta), path(vcf) @@ -37,7 +37,7 @@ process STRANGER { stub: def prefix = task.ext.prefix ?: "${meta.id}" """ - touch ${prefix}.vcf.gz + echo "" | gzip > ${prefix}.vcf.gz cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/stranger/tests/main.nf.test b/modules/nf-core/stranger/tests/main.nf.test new file mode 100644 index 00000000000..13c61f43fb2 --- /dev/null +++ b/modules/nf-core/stranger/tests/main.nf.test @@ -0,0 +1,82 @@ +nextflow_process { + + name "Test Process STRANGER" + script "../main.nf" + process "STRANGER" + config "./nextflow.config" + + tag "modules" + tag "modules_nfcore" + tag "stranger" + tag "expansionhunter" + + setup { + run("EXPANSIONHUNTER") { + script "../../expansionhunter/main.nf" + process { + """ + input[0] = [ + [ id:'test' ], // 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:'fasta'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ] + input[2] = [ + [id:'fai'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) + ] + input[3] = [ + [id:'catalogue'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/loci/repeat_expansions.json', checkIfExists: true) + ] + """ + } + } + } + + test("homo_sapiens - vcf, repeat_catalogue") { + + when { + process { + """ + input[0] = EXPANSIONHUNTER.out.vcf + input[1] = [ + [id:'catalogue'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/loci/repeat_expansions.json', checkIfExists: true) + ] + """ + } + } + + then { + assert process.success + assert snapshot(process.out).match() + } + + } + + test("homo_sapiens - vcf, repeat_catalogue - stub") { + + options "-stub" + + when { + process { + """ + input[0] = EXPANSIONHUNTER.out.vcf + input[1] = [ + [id:'catalogue'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/loci/repeat_expansions.json', checkIfExists: true) + ] + """ + } + } + + then { + assert process.success + assert snapshot(process.out).match() + } + } +} diff --git a/modules/nf-core/stranger/tests/main.nf.test.snap b/modules/nf-core/stranger/tests/main.nf.test.snap new file mode 100644 index 00000000000..353f6dd70cd --- /dev/null +++ b/modules/nf-core/stranger/tests/main.nf.test.snap @@ -0,0 +1,68 @@ +{ + "homo_sapiens - vcf, repeat_catalogue - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "stranger.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + "versions.yml:md5,369e472eaaf24bf7d154b41bc731ac50" + ], + "vcf": [ + [ + { + "id": "test" + }, + "stranger.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,369e472eaaf24bf7d154b41bc731ac50" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-24T06:58:08.232701026" + }, + "homo_sapiens - vcf, repeat_catalogue": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "stranger.vcf.gz:md5,bce108ecdcff045eebd6cf831be9b5a8" + ] + ], + "1": [ + "versions.yml:md5,369e472eaaf24bf7d154b41bc731ac50" + ], + "vcf": [ + [ + { + "id": "test" + }, + "stranger.vcf.gz:md5,bce108ecdcff045eebd6cf831be9b5a8" + ] + ], + "versions": [ + "versions.yml:md5,369e472eaaf24bf7d154b41bc731ac50" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-24T06:57:54.749238699" + } +} \ No newline at end of file diff --git a/modules/nf-core/stranger/tests/nextflow.config b/modules/nf-core/stranger/tests/nextflow.config new file mode 100644 index 00000000000..98459330fdc --- /dev/null +++ b/modules/nf-core/stranger/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: 'STRANGER' { + ext.prefix = "stranger" + } + } diff --git a/modules/nf-core/stranger/tests/tags.yml b/modules/nf-core/stranger/tests/tags.yml new file mode 100644 index 00000000000..6d11ef42f32 --- /dev/null +++ b/modules/nf-core/stranger/tests/tags.yml @@ -0,0 +1,2 @@ +stranger: + - "modules/nf-core/stranger/**" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index c2747db3c96..c97bb15bdf2 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -1642,9 +1642,6 @@ stecfinder: stitch: - modules/nf-core/stitch/** - tests/modules/nf-core/stitch/** -stranger: - - modules/nf-core/stranger/** - - tests/modules/nf-core/stranger/** subworkflows/align_bowtie2: - subworkflows/nf-core/align_bowtie2/** - tests/subworkflows/nf-core/align_bowtie2/** diff --git a/tests/modules/nf-core/stranger/main.nf b/tests/modules/nf-core/stranger/main.nf deleted file mode 100644 index a7352ca7b0a..00000000000 --- a/tests/modules/nf-core/stranger/main.nf +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { EXPANSIONHUNTER } from '../../../../modules/nf-core/expansionhunter/main.nf' -include { STRANGER } from '../../../../modules/nf-core/stranger/main.nf' - - -input = [ [ id:'test', gender:'male' ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true), - ] -fasta = [[id:'fasta'],file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)] -fai = [[id:'fasta'],file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true)] -variant_catalog = [[id:'catalogue'],file(params.test_data['homo_sapiens']['genome']['repeat_expansions'], checkIfExists: true)] - - -workflow test_stranger { - EXPANSIONHUNTER ( input, fasta, fai, variant_catalog ) - STRANGER ( EXPANSIONHUNTER.out.vcf, variant_catalog ) -} - -workflow test_stranger_without_optional_variant_catalog { - EXPANSIONHUNTER ( input, fasta, fai, variant_catalog ) - STRANGER ( EXPANSIONHUNTER.out.vcf, [[],[]] ) -} - -workflow test_stranger_without_optional_variant_catalog_stubs { - EXPANSIONHUNTER ( input, fasta, fai, variant_catalog ) - STRANGER ( EXPANSIONHUNTER.out.vcf, [[],[]] ) -} diff --git a/tests/modules/nf-core/stranger/nextflow.config b/tests/modules/nf-core/stranger/nextflow.config deleted file mode 100644 index 2fb67ca9f92..00000000000 --- a/tests/modules/nf-core/stranger/nextflow.config +++ /dev/null @@ -1,9 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - - withName: '.*STRANGER' { - ext.prefix = 'stranger' - } - -} diff --git a/tests/modules/nf-core/stranger/test.yml b/tests/modules/nf-core/stranger/test.yml deleted file mode 100644 index 439303f6399..00000000000 --- a/tests/modules/nf-core/stranger/test.yml +++ /dev/null @@ -1,27 +0,0 @@ -- name: stranger test_stranger - command: nextflow run ./tests/modules/nf-core/stranger -entry test_stranger -c ./tests/config/nextflow.config - tags: - - stranger - files: - - path: output/stranger/stranger.vcf.gz - md5sum: 68b0ca1319851134ffa8793a4704dc11 - - path: output/stranger/versions.yml - md5sum: 5ec35fd835fb1be50bc3e7c004310fc0 - -- name: stranger test_stranger_without_optional_variant_catalog - command: nextflow run ./tests/modules/nf-core/stranger -entry test_stranger_without_optional_variant_catalog -c ./tests/config/nextflow.config - tags: - - stranger - files: - - path: output/stranger/stranger.vcf.gz - md5sum: bbe15159195681d5c18596d3ad85c78f - - path: output/stranger/versions.yml - md5sum: 8558542a007e90ea5dcdceed3f12585d - -- name: stranger test_stranger_without_optional_variant_catalog_stubs - command: nextflow run ./tests/modules/nf-core/stranger -entry test_stranger_without_optional_variant_catalog -c ./tests/config/nextflow.config -stub-run - tags: - - stranger - files: - - path: output/stranger/stranger.vcf.gz - - path: output/stranger/versions.yml