diff --git a/modules/nf-core/gatk4/collectreadcounts/tests/main.nf.test b/modules/nf-core/gatk4/collectreadcounts/tests/main.nf.test new file mode 100644 index 00000000000..0832cf85a24 --- /dev/null +++ b/modules/nf-core/gatk4/collectreadcounts/tests/main.nf.test @@ -0,0 +1,104 @@ + +nextflow_process { + + name "Test Process GATK4_COLLECTREADCOUNTS" + script "../main.nf" + process "GATK4_COLLECTREADCOUNTS" + + tag "modules" + tag "modules_nfcore" + tag "gatk4" + tag "gatk4/collectreadcounts" + + test("test-gatk4-collectreadcounts-hdf5") { + + config "./nextflow.hdf5.config" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // 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), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed', checkIfExists: true), + ] + input[1] = [[],[]] + input[2] = [[],[]] + input[3] = [[],[]] + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.hdf5[0][1]).name, + process.out.tsv, + ).match() + } + ) + } + } + + test("test-gatk4-collectreadcounts-tsv") { + + config "./nextflow.tsv.config" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // 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), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed', checkIfExists: true), + ] + input[1] = [[],[]] + input[2] = [[],[]] + input[3] = [[],[]] + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("test-gatk4-collectreadcounts-cram") { + + config "./nextflow.cram.config" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram.crai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed', checkIfExists: true), + ] + input[1] = [[id:'test'], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true)] + input[2] = [[id:'test'], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true)] + input[3] = [[id:'test'], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.dict', checkIfExists: true)] + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + +} diff --git a/modules/nf-core/gatk4/collectreadcounts/tests/main.nf.test.snap b/modules/nf-core/gatk4/collectreadcounts/tests/main.nf.test.snap new file mode 100644 index 00000000000..28a3a6e151b --- /dev/null +++ b/modules/nf-core/gatk4/collectreadcounts/tests/main.nf.test.snap @@ -0,0 +1,97 @@ +{ + "test-gatk4-collectreadcounts-cram": { + "content": [ + { + "0": [ + + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv:md5,d9a32039b7a84f5bb74e8382e5427670" + ] + ], + "2": [ + "versions.yml:md5,ebf23f4ab63948ba97df07035f8d2659" + ], + "hdf5": [ + + ], + "tsv": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv:md5,d9a32039b7a84f5bb74e8382e5427670" + ] + ], + "versions": [ + "versions.yml:md5,ebf23f4ab63948ba97df07035f8d2659" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.4" + }, + "timestamp": "2024-08-26T12:58:19.610687" + }, + "test-gatk4-collectreadcounts-hdf5": { + "content": [ + "test.hdf5", + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.4" + }, + "timestamp": "2024-08-26T13:02:48.607644" + }, + "test-gatk4-collectreadcounts-tsv": { + "content": [ + { + "0": [ + + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv:md5,8e45a6164916c303387f39f02ce45841" + ] + ], + "2": [ + "versions.yml:md5,ebf23f4ab63948ba97df07035f8d2659" + ], + "hdf5": [ + + ], + "tsv": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv:md5,8e45a6164916c303387f39f02ce45841" + ] + ], + "versions": [ + "versions.yml:md5,ebf23f4ab63948ba97df07035f8d2659" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.4" + }, + "timestamp": "2024-08-26T12:58:07.500024" + } +} \ No newline at end of file diff --git a/modules/nf-core/gatk4/collectreadcounts/tests/nextflow.cram.config b/modules/nf-core/gatk4/collectreadcounts/tests/nextflow.cram.config new file mode 100644 index 00000000000..682bdcad1e5 --- /dev/null +++ b/modules/nf-core/gatk4/collectreadcounts/tests/nextflow.cram.config @@ -0,0 +1,5 @@ +process { + withName: 'GATK4_COLLECTREADCOUNTS' { + ext.args = "--format TSV --interval-merging-rule OVERLAPPING_ONLY" + } +} diff --git a/modules/nf-core/gatk4/collectreadcounts/tests/nextflow.hdf5.config b/modules/nf-core/gatk4/collectreadcounts/tests/nextflow.hdf5.config new file mode 100644 index 00000000000..d6ca881b7e3 --- /dev/null +++ b/modules/nf-core/gatk4/collectreadcounts/tests/nextflow.hdf5.config @@ -0,0 +1,5 @@ +process { + withName: 'GATK4_COLLECTREADCOUNTS'{ + ext.args = "--interval-merging-rule OVERLAPPING_ONLY" + } +} diff --git a/modules/nf-core/gatk4/collectreadcounts/tests/nextflow.tsv.config b/modules/nf-core/gatk4/collectreadcounts/tests/nextflow.tsv.config new file mode 100644 index 00000000000..682bdcad1e5 --- /dev/null +++ b/modules/nf-core/gatk4/collectreadcounts/tests/nextflow.tsv.config @@ -0,0 +1,5 @@ +process { + withName: 'GATK4_COLLECTREADCOUNTS' { + ext.args = "--format TSV --interval-merging-rule OVERLAPPING_ONLY" + } +} diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 4aea9c2af1e..c8aecefd0bb 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -443,9 +443,6 @@ gatk4/calibratedragstrmodel: gatk4/cnnscorevariants: - modules/nf-core/gatk4/cnnscorevariants/** - tests/modules/nf-core/gatk4/cnnscorevariants/** -gatk4/collectreadcounts: - - modules/nf-core/gatk4/collectreadcounts/** - - tests/modules/nf-core/gatk4/collectreadcounts/** gatk4/collectsvevidence: - modules/nf-core/gatk4/collectsvevidence/** - tests/modules/nf-core/gatk4/collectsvevidence/** diff --git a/tests/modules/nf-core/gatk4/collectreadcounts/main.nf b/tests/modules/nf-core/gatk4/collectreadcounts/main.nf deleted file mode 100644 index 2ddc184a236..00000000000 --- a/tests/modules/nf-core/gatk4/collectreadcounts/main.nf +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { GATK4_COLLECTREADCOUNTS } from '../../../../../modules/nf-core/gatk4/collectreadcounts/main.nf' - -workflow test_gatk4_collectreadcounts_hdf5 { - - input = [ - [ id:'test', single_end:false ], // 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), - file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true), - ] - - fasta = [[],[]] - fai = [[],[]] - dict = [[],[]] - - GATK4_COLLECTREADCOUNTS ( input, fasta, fai, dict ) -} - -workflow test_gatk4_collectreadcounts_tsv { - - input = [ - [ id:'test', single_end:false ], // 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), - file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true), - ] - - fasta = [[],[]] - fai = [[],[]] - dict = [[],[]] - - GATK4_COLLECTREADCOUNTS ( input, fasta, fai, dict ) -} - -workflow test_gatk4_collectreadcounts_cram { - - input = [ - [ id:'test', single_end:false ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram_crai'], checkIfExists: true), - file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true), - ] - - fasta = [[id:'test'], file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)] - fai = [[id:'test'], file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true)] - dict = [[id:'test'], file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true)] - - GATK4_COLLECTREADCOUNTS ( input, fasta, fai, dict ) -} - diff --git a/tests/modules/nf-core/gatk4/collectreadcounts/nextflow.config b/tests/modules/nf-core/gatk4/collectreadcounts/nextflow.config deleted file mode 100644 index 3863bf92946..00000000000 --- a/tests/modules/nf-core/gatk4/collectreadcounts/nextflow.config +++ /dev/null @@ -1,17 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - - withName: 'test_gatk4_collectreadcounts_hdf5:GATK4_COLLECTREADCOUNTS'{ - ext.args = "--interval-merging-rule OVERLAPPING_ONLY" - } - - withName: 'test_gatk4_collectreadcounts_tsv:GATK4_COLLECTREADCOUNTS' { - ext.args = "--format TSV --interval-merging-rule OVERLAPPING_ONLY" - } - - withName: 'test_gatk4_collectreadcounts_cram:GATK4_COLLECTREADCOUNTS' { - ext.args = "--format TSV --interval-merging-rule OVERLAPPING_ONLY" - } - -} \ No newline at end of file diff --git a/tests/modules/nf-core/gatk4/collectreadcounts/test.yml b/tests/modules/nf-core/gatk4/collectreadcounts/test.yml deleted file mode 100644 index cc0f2106d3c..00000000000 --- a/tests/modules/nf-core/gatk4/collectreadcounts/test.yml +++ /dev/null @@ -1,54 +0,0 @@ -- name: gatk4 collectreadcounts test_gatk4_collectreadcounts_hdf5 - command: nextflow run ./tests/modules/nf-core/gatk4/collectreadcounts -entry test_gatk4_collectreadcounts_hdf5 -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/gatk4/collectreadcounts/nextflow.config - tags: - - gatk4/collectreadcounts - - gatk4 - files: - - path: output/gatk4/test.hdf5 - - path: output/gatk4/versions.yml - -- name: gatk4 collectreadcounts test_gatk4_collectreadcounts_tsv - command: nextflow run ./tests/modules/nf-core/gatk4/collectreadcounts -entry test_gatk4_collectreadcounts_tsv -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/gatk4/collectreadcounts/nextflow.config - tags: - - gatk4/collectreadcounts - - gatk4 - files: - - path: output/gatk4/test.tsv - md5sum: 8e45a6164916c303387f39f02ce45841 - - path: output/gatk4/versions.yml - -- name: gatk4 collectreadcounts test_gatk4_collectreadcounts_cram - command: nextflow run ./tests/modules/nf-core/gatk4/collectreadcounts -entry test_gatk4_collectreadcounts_cram -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/gatk4/collectreadcounts/nextflow.config - tags: - - gatk4/collectreadcounts - - gatk4 - files: - - path: output/gatk4/test.tsv - - path: output/gatk4/versions.yml - -- name: gatk4 collectreadcounts test_gatk4_collectreadcounts_hdf5_stub - command: nextflow run ./tests/modules/nf-core/gatk4/collectreadcounts -entry test_gatk4_collectreadcounts_hdf5 -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/gatk4/collectreadcounts/nextflow.config -stub - tags: - - gatk4/collectreadcounts - - gatk4 - files: - - path: output/gatk4/test.hdf5 - - path: output/gatk4/versions.yml - -- name: gatk4 collectreadcounts test_gatk4_collectreadcounts_tsv_stub - command: nextflow run ./tests/modules/nf-core/gatk4/collectreadcounts -entry test_gatk4_collectreadcounts_tsv -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/gatk4/collectreadcounts/nextflow.config -stub - tags: - - gatk4/collectreadcounts - - gatk4 - files: - - path: output/gatk4/test.tsv - - path: output/gatk4/versions.yml - -- name: gatk4 collectreadcounts test_gatk4_collectreadcounts_cram_stub - command: nextflow run ./tests/modules/nf-core/gatk4/collectreadcounts -entry test_gatk4_collectreadcounts_cram -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/gatk4/collectreadcounts/nextflow.config -stub - tags: - - gatk4/collectreadcounts - - gatk4 - files: - - path: output/gatk4/test.tsv - - path: output/gatk4/versions.yml