diff --git a/modules/nf-core/happy/sompy/main.nf b/modules/nf-core/happy/sompy/main.nf index e0c34e262de..ba23fd16765 100644 --- a/modules/nf-core/happy/sompy/main.nf +++ b/modules/nf-core/happy/sompy/main.nf @@ -54,7 +54,7 @@ process HAPPY_SOMPY { """ stub: - def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" def VERSION = '0.3.14' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. """ touch ${prefix}.features.csv diff --git a/modules/nf-core/happy/sompy/meta.yml b/modules/nf-core/happy/sompy/meta.yml index 3dd2b911be8..8a04a601739 100644 --- a/modules/nf-core/happy/sompy/meta.yml +++ b/modules/nf-core/happy/sompy/meta.yml @@ -13,8 +13,7 @@ tools: homepage: "https://www.illumina.com/products/by-type/informatics-products/basespace-sequence-hub/apps/hap-py-benchmarking.html" documentation: "https://github.com/Illumina/hap.py/blob/master/doc/sompy.md" tool_dev_url: "https://github.com/Illumina/hap.py" - - licence: "['BSD-2-clause']" + licence: ["BSD-2-clause"] input: - meta: @@ -22,6 +21,31 @@ input: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] + - meta2: + type: map + description: | + Groovy Map containing fasta file information + e.g. [ id:'test2'] + - meta3: + type: map + description: | + Groovy Map containing fai file information + e.g. [ id:'test3'] + - meta4: + type: map + description: | + Groovy Map containing false_positives_bed file information + e.g. [ id:'test4'] + - meta5: + type: map + description: | + Groovy Map containing ambiguous_beds file information + e.g. [ id:'test5'] + - meta6: + type: map + description: | + Groovy Map containing bam file information + e.g. [ id:'test6'] - query_vcf: type: file description: VCF/GVCF file to query diff --git a/modules/nf-core/happy/sompy/tests/main.nf.test b/modules/nf-core/happy/sompy/tests/main.nf.test new file mode 100644 index 00000000000..f4919c73f7b --- /dev/null +++ b/modules/nf-core/happy/sompy/tests/main.nf.test @@ -0,0 +1,127 @@ +nextflow_process { + + name "Test Process HAPPY_SOMPY" + script "../main.nf" + process "HAPPY_SOMPY" + + tag "modules" + tag "modules_nfcore" + tag "happy" + tag "happy/sompy" + + test("homo_sapiens - vcf") { + config './nextflow.config' + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/paired_mutect2_calls/test_test2_paired_mutect2_calls.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed', checkIfExists: true), + [] + ] + input[1] = [ + [ id:'test2' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) + ] + input[2] = [ + [ id:'test3' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) + ] + input[3] = [[],[]] + input[4] = [[],[]] + input[5] = [[],[]] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.stats, + process.out.versions, + file(process.out.metrics[0][1]).name, + file(process.out.features[0][1]).name).match()} + ) + } + + } + test("homo_sapiens - vcf - bam") { + config './nextflow.config' + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/paired_mutect2_calls/test_test2_paired_mutect2_calls.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed', checkIfExists: true), + [] + ] + input[1] = [ + [ id:'test2' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) + ] + input[2] = [ + [ id:'test3' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) + ] + input[3] = [[],[]] + input[4] = [[],[]] + input[5] = [[ id:'test2' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.sorted.bam', checkIfExists: true)] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.stats, + process.out.versions, + file(process.out.metrics[0][1]).name, + file(process.out.features[0][1]).name).match()} + ) + } + + } + test("homo_sapiens - vcf - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/paired_mutect2_calls/test_test2_paired_mutect2_calls.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed', checkIfExists: true), + [] + ] + input[1] = [ + [ id:'test2' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) + ] + input[2] = [ + [ id:'test3' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) + ] + input[3] = [[],[]] + input[4] = [[],[]] + input[5] = [[],[]] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/happy/sompy/tests/main.nf.test.snap b/modules/nf-core/happy/sompy/tests/main.nf.test.snap new file mode 100644 index 00000000000..b6b25e6decf --- /dev/null +++ b/modules/nf-core/happy/sompy/tests/main.nf.test.snap @@ -0,0 +1,111 @@ +{ + "homo_sapiens - vcf": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.stats.csv:md5,8b35dd00bf7b5bd697a05d73fb8c0816" + ] + ], + [ + "versions.yml:md5,dda929752e25faa5e5dc8e82228980fc" + ], + "test.metrics.json", + "test.features.csv" + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-08-26T08:56:57.589412212" + }, + "homo_sapiens - vcf - bam": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.stats.csv:md5,5e9aae3e92641f1934c10fe88f250e59" + ] + ], + [ + "versions.yml:md5,dda929752e25faa5e5dc8e82228980fc" + ], + "test.metrics.json", + "test.features.csv" + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-08-26T08:57:13.752402851" + }, + "homo_sapiens - vcf - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.features.csv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test.metrics.json:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test" + }, + "test.stats.csv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + "versions.yml:md5,dda929752e25faa5e5dc8e82228980fc" + ], + "features": [ + [ + { + "id": "test" + }, + "test.features.csv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "metrics": [ + [ + { + "id": "test" + }, + "test.metrics.json:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "stats": [ + [ + { + "id": "test" + }, + "test.stats.csv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,dda929752e25faa5e5dc8e82228980fc" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-08-23T14:39:09.160343644" + } +} \ No newline at end of file diff --git a/modules/nf-core/happy/sompy/tests/nextflow.config b/modules/nf-core/happy/sompy/tests/nextflow.config new file mode 100644 index 00000000000..3a95dc4e6f3 --- /dev/null +++ b/modules/nf-core/happy/sompy/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: HAPPY_SOMPY { + ext.args = '--feature-table hcc.mutect.snv' + } +} diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index fe2e7f205b9..70adceeae6c 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -617,9 +617,6 @@ haplocheck: haplogrep2/classify: - modules/nf-core/haplogrep2/classify/** - tests/modules/nf-core/haplogrep2/classify/** -happy/sompy: - - modules/nf-core/happy/sompy/** - - tests/modules/nf-core/happy/sompy/** hicap: - modules/nf-core/hicap/** - tests/modules/nf-core/hicap/** diff --git a/tests/modules/nf-core/happy/sompy/main.nf b/tests/modules/nf-core/happy/sompy/main.nf deleted file mode 100644 index bec0ada84ba..00000000000 --- a/tests/modules/nf-core/happy/sompy/main.nf +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { HAPPY_SOMPY } from '../../../../../modules/nf-core/happy/sompy/main.nf' - -workflow test_sompy { - - input = [ - [ id:'test' ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_test2_paired_mutect2_calls_vcf_gz'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test2_haplotc_vcf_gz'], checkIfExists: true), - [], - [] - ] - - fasta = [ - [ id:'test1' ], - file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) - ] - fasta_fai = [ - [ id:'test1' ], - file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) - ] - - HAPPY_SOMPY ( - input, - fasta, - fasta_fai, - [[],[]], - [[],[]], - [[],[]] - ) -} -workflow test_sompy_bam { - - input = [ - [ id:'test' ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_test2_paired_mutect2_calls_vcf_gz'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test2_haplotc_vcf_gz'], checkIfExists: true), - [], - [] - ] - - fasta = [ - [ id:'test1' ], - file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) - ] - fasta_fai = [ - [ id:'test1' ], - file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) - ] - - bam = [ - [id:'test2'], - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_sorted_bam'], checkIfExists:true) - ] - - HAPPY_SOMPY ( - input, - fasta, - fasta_fai, - [[],[]], - [[],[]], - bam - ) -} diff --git a/tests/modules/nf-core/happy/sompy/nextflow.config b/tests/modules/nf-core/happy/sompy/nextflow.config deleted file mode 100644 index 32d6b83227b..00000000000 --- a/tests/modules/nf-core/happy/sompy/nextflow.config +++ /dev/null @@ -1,8 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - - withName: HAPPY_SOMPY { - ext.args = '--feature-table hcc.mutect.snv' - } -} diff --git a/tests/modules/nf-core/happy/sompy/test.yml b/tests/modules/nf-core/happy/sompy/test.yml deleted file mode 100644 index 6bde5712fb9..00000000000 --- a/tests/modules/nf-core/happy/sompy/test.yml +++ /dev/null @@ -1,25 +0,0 @@ -- name: happy sompy test_sompy - command: nextflow run ./tests/modules/nf-core/happy/sompy -entry test_sompy -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/happy/sompy/nextflow.config - tags: - - happy - - happy/sompy - files: - - path: output/happy/test.features.csv - md5sum: 34a8239e739edd5ea89be78b86262d4e - - path: output/happy/test.metrics.json - - path: output/happy/test.stats.csv - md5sum: 402dc827ee8ec5e155fc7ea47232963e - - path: output/happy/versions.yml - -- name: happy sompy test_sompy_bam - command: nextflow run ./tests/modules/nf-core/happy/sompy -entry test_sompy_bam -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/happy/sompy/nextflow.config - tags: - - happy - - happy/sompy - files: - - path: output/happy/test.features.csv - md5sum: 34a8239e739edd5ea89be78b86262d4e - - path: output/happy/test.metrics.json - - path: output/happy/test.stats.csv - md5sum: 72653d4fa9150f54395c37e2220b2468 - - path: output/happy/versions.yml