diff --git a/modules/nf-core/picard/collectwgsmetrics/tests/main.nf.test b/modules/nf-core/picard/collectwgsmetrics/tests/main.nf.test new file mode 100644 index 00000000000..a3984566dcd --- /dev/null +++ b/modules/nf-core/picard/collectwgsmetrics/tests/main.nf.test @@ -0,0 +1,83 @@ + +nextflow_process { + + name "Test Process PICARD_COLLECTWGSMETRICS" + script "../main.nf" + process "PICARD_COLLECTWGSMETRICS" + + tag "modules" + tag "modules_nfcore" + tag "picard" + tag "picard/collectwgsmetrics" + + test("test-picard-collectwgsmetrics") { + + when { + process { + """ + input[0] = [ [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true), + ] + input[1] = [ + [id:'genome'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + input[2] = [ + [id:'genome'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true) + ] + input[3] = [] + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.metrics[0][1]).text.contains('coverage high_quality_coverage_count'), + process.out.versions + ).match() + } + ) + } + } + + test("test-picard-collectwgsmetrics-with-interval") { + + when { + process { + """ + input[0] = [ [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + [] + ] + input[1] = [ + [id:'genome'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + input[2] = [ + [id:'genome'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true) + ] + input[3] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/picard/baits.interval_list', checkIfExists: true) + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.metrics[0][1]).text.contains('coverage high_quality_coverage_count'), + process.out.versions + ).match() + } + ) + } + } + +} diff --git a/modules/nf-core/picard/collectwgsmetrics/tests/main.nf.test.snap b/modules/nf-core/picard/collectwgsmetrics/tests/main.nf.test.snap new file mode 100644 index 00000000000..f188382b038 --- /dev/null +++ b/modules/nf-core/picard/collectwgsmetrics/tests/main.nf.test.snap @@ -0,0 +1,28 @@ +{ + "test-picard-collectwgsmetrics-with-interval": { + "content": [ + true, + [ + "versions.yml:md5,06b5898fb06823b736c90e1dcebe75fe" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.4" + }, + "timestamp": "2024-08-23T11:02:46.301176" + }, + "test-picard-collectwgsmetrics": { + "content": [ + true, + [ + "versions.yml:md5,06b5898fb06823b736c90e1dcebe75fe" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.4" + }, + "timestamp": "2024-08-23T11:02:25.132069" + } +} \ No newline at end of file diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index b698856bbae..34b9f6903d5 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -1097,9 +1097,6 @@ picard/collectmultiplemetrics: picard/collectrnaseqmetrics: - modules/nf-core/picard/collectrnaseqmetrics/** - tests/modules/nf-core/picard/collectrnaseqmetrics/** -picard/collectwgsmetrics: - - modules/nf-core/picard/collectwgsmetrics/** - - tests/modules/nf-core/picard/collectwgsmetrics/** picard/fastqtosam: - modules/nf-core/picard/fastqtosam/** - tests/modules/nf-core/picard/fastqtosam/** diff --git a/tests/modules/nf-core/picard/collectwgsmetrics/main.nf b/tests/modules/nf-core/picard/collectwgsmetrics/main.nf deleted file mode 100644 index c1c8dd9dcec..00000000000 --- a/tests/modules/nf-core/picard/collectwgsmetrics/main.nf +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { PICARD_COLLECTWGSMETRICS } from '../../../../../modules/nf-core/picard/collectwgsmetrics/main.nf' - -//Test without an interval list file -workflow test_picard_collectwgsmetrics { - input = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true), - ] - fasta = [ - [id:'genome'], - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - ] - fai = [ - [id:'genome'], - file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true) - ] - PICARD_COLLECTWGSMETRICS ( input, fasta, fai, [] ) -} - -//Test with an interval list file -workflow test_picard_collectwgsmetrics_with_interval { - input = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), - [] - ] - fasta = [ - [id:'genome'], - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) - ] - fai = [ - [id:'genome'], - file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true) - ] - intervallist = file(params.test_data['sarscov2']['genome']['baits_interval_list'], checkIfExists: true) - - PICARD_COLLECTWGSMETRICS ( input, fasta, fai, intervallist ) -} diff --git a/tests/modules/nf-core/picard/collectwgsmetrics/nextflow.config b/tests/modules/nf-core/picard/collectwgsmetrics/nextflow.config deleted file mode 100644 index 8730f1c4b93..00000000000 --- a/tests/modules/nf-core/picard/collectwgsmetrics/nextflow.config +++ /dev/null @@ -1,5 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - -} diff --git a/tests/modules/nf-core/picard/collectwgsmetrics/test.yml b/tests/modules/nf-core/picard/collectwgsmetrics/test.yml deleted file mode 100644 index 4237e3c4fdb..00000000000 --- a/tests/modules/nf-core/picard/collectwgsmetrics/test.yml +++ /dev/null @@ -1,15 +0,0 @@ -- name: picard collectwgsmetrics test_picard_collectwgsmetrics - command: nextflow run ./tests/modules/nf-core/picard/collectwgsmetrics -entry test_picard_collectwgsmetrics -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/picard/collectwgsmetrics/nextflow.config - tags: - - picard/collectwgsmetrics - - picard - files: - - path: output/picard/test.CollectWgsMetrics.coverage_metrics - -- name: picard collectwgsmetrics test_picard_collectwgsmetrics_with_interval - command: nextflow run ./tests/modules/nf-core/picard/collectwgsmetrics -entry test_picard_collectwgsmetrics_with_interval -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/picard/collectwgsmetrics/nextflow.config - tags: - - picard/collectwgsmetrics - - picard - files: - - path: output/picard/test.CollectWgsMetrics.coverage_metrics