diff --git a/modules/nf-core/paragraph/vcf2paragraph/environment.yml b/modules/nf-core/paragraph/vcf2paragraph/environment.yml index 407d53d9c9c..4071e82f9b3 100644 --- a/modules/nf-core/paragraph/vcf2paragraph/environment.yml +++ b/modules/nf-core/paragraph/vcf2paragraph/environment.yml @@ -1,7 +1,10 @@ name: paragraph_vcf2paragraph + channels: - conda-forge - bioconda - defaults + dependencies: + - bioconda::htslib=1.10.2 - bioconda::paragraph=2.3 diff --git a/modules/nf-core/paragraph/vcf2paragraph/main.nf b/modules/nf-core/paragraph/vcf2paragraph/main.nf index f8efd94ee29..f9f30ebb4e5 100644 --- a/modules/nf-core/paragraph/vcf2paragraph/main.nf +++ b/modules/nf-core/paragraph/vcf2paragraph/main.nf @@ -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}": diff --git a/modules/nf-core/paragraph/vcf2paragraph/meta.yml b/modules/nf-core/paragraph/vcf2paragraph/meta.yml index ab40b5023e5..c60991218c9 100644 --- a/modules/nf-core/paragraph/vcf2paragraph/meta.yml +++ b/modules/nf-core/paragraph/vcf2paragraph/meta.yml @@ -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 diff --git a/modules/nf-core/paragraph/vcf2paragraph/tests/main.nf.test b/modules/nf-core/paragraph/vcf2paragraph/tests/main.nf.test new file mode 100644 index 00000000000..16741305401 --- /dev/null +++ b/modules/nf-core/paragraph/vcf2paragraph/tests/main.nf.test @@ -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() } + ) + } + } + +} diff --git a/modules/nf-core/paragraph/vcf2paragraph/tests/main.nf.test.snap b/modules/nf-core/paragraph/vcf2paragraph/tests/main.nf.test.snap new file mode 100644 index 00000000000..63c8f7f1d77 --- /dev/null +++ b/modules/nf-core/paragraph/vcf2paragraph/tests/main.nf.test.snap @@ -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" + } +} \ No newline at end of file diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 9b4f5b9624b..311170863c5 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -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/** diff --git a/tests/modules/nf-core/paragraph/vcf2paragraph/main.nf b/tests/modules/nf-core/paragraph/vcf2paragraph/main.nf deleted file mode 100644 index 5af197460f4..00000000000 --- a/tests/modules/nf-core/paragraph/vcf2paragraph/main.nf +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { PARAGRAPH_VCF2PARAGRAPH } from '../../../../../modules/nf-core/paragraph/vcf2paragraph/main.nf' - -workflow test_paragraph_vcf2paragraph { - - input = [ - [ id:'test', single_end:false ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_haplotc_cnn_vcf_gz'], checkIfExists: true) - ] - - fasta = [[], file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)] - - PARAGRAPH_VCF2PARAGRAPH ( - input, - fasta - ) -} diff --git a/tests/modules/nf-core/paragraph/vcf2paragraph/nextflow.config b/tests/modules/nf-core/paragraph/vcf2paragraph/nextflow.config deleted file mode 100644 index 50f50a7a357..00000000000 --- a/tests/modules/nf-core/paragraph/vcf2paragraph/nextflow.config +++ /dev/null @@ -1,5 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - -} \ No newline at end of file diff --git a/tests/modules/nf-core/paragraph/vcf2paragraph/test.yml b/tests/modules/nf-core/paragraph/vcf2paragraph/test.yml deleted file mode 100644 index a4460066f59..00000000000 --- a/tests/modules/nf-core/paragraph/vcf2paragraph/test.yml +++ /dev/null @@ -1,9 +0,0 @@ -- name: paragraph vcf2paragraph test_paragraph_vcf2paragraph - command: nextflow run ./tests/modules/nf-core/paragraph/vcf2paragraph -entry test_paragraph_vcf2paragraph -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/paragraph/vcf2paragraph/nextflow.config - tags: - - paragraph/vcf2paragraph - - paragraph - files: - - path: output/paragraph/test.json.gz - md5sum: 4c7e676cb114a03c290668163bdc886a - - path: output/paragraph/versions.yml