diff --git a/modules/nf-core/gatk4/splitintervals/tests/main.nf.test b/modules/nf-core/gatk4/splitintervals/tests/main.nf.test new file mode 100644 index 00000000000..26c20f88f2f --- /dev/null +++ b/modules/nf-core/gatk4/splitintervals/tests/main.nf.test @@ -0,0 +1,109 @@ + +nextflow_process { + + name "Test Process GATK4_SPLITINTERVALS" + script "../main.nf" + process "GATK4_SPLITINTERVALS" + config "./nextflow.config" + + tag "modules" + tag "modules_nfcore" + tag "gatk4" + tag "gatk4/splitintervals" + + test("test-gatk4-splitintervals-bed") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.multi_intervals.bed', checkIfExists: true) + ] + input[1] = [ [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ] + input[2] = [ [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) + ] + input[3] = [ [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.dict', checkIfExists: true) + ] + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("test-gatk4-splitintervals-intervals") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.interval_list', checkIfExists: true) + ] + input[1] = [ [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ] + input[2] = [ [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) + ] + input[3] = [ [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.dict', checkIfExists: true) + ] + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("test-gatk4-splitintervals-intervals-stub") { + + options '-stub' + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.interval_list', checkIfExists: true) + ] + input[1] = [ [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ] + input[2] = [ [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) + ] + input[3] = [ [ id:'genome' ], // meta map + 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/splitintervals/tests/main.nf.test.snap b/modules/nf-core/gatk4/splitintervals/tests/main.nf.test.snap new file mode 100644 index 00000000000..d055a8737d1 --- /dev/null +++ b/modules/nf-core/gatk4/splitintervals/tests/main.nf.test.snap @@ -0,0 +1,119 @@ +{ + "test-gatk4-splitintervals-intervals": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + [ + "0000-scattered.interval_list:md5,ebd6b34a335efc6732ff541936c6d2d5", + "0001-scattered.interval_list:md5,9459b0e124fa84ec1e64ac4615bc9af7" + ] + ] + ], + "1": [ + "versions.yml:md5,384addd364fb36fdac7593eba22fcdb7" + ], + "split_intervals": [ + [ + { + "id": "test" + }, + [ + "0000-scattered.interval_list:md5,ebd6b34a335efc6732ff541936c6d2d5", + "0001-scattered.interval_list:md5,9459b0e124fa84ec1e64ac4615bc9af7" + ] + ] + ], + "versions": [ + "versions.yml:md5,384addd364fb36fdac7593eba22fcdb7" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.4" + }, + "timestamp": "2024-08-26T11:06:41.633105" + }, + "test-gatk4-splitintervals-bed": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + [ + "0000-scattered.interval_list:md5,c8d6b19e7a92535b6ce9608eae558faa", + "0001-scattered.interval_list:md5,b1877ad96aec308906594c50ebbe3ded" + ] + ] + ], + "1": [ + "versions.yml:md5,384addd364fb36fdac7593eba22fcdb7" + ], + "split_intervals": [ + [ + { + "id": "test" + }, + [ + "0000-scattered.interval_list:md5,c8d6b19e7a92535b6ce9608eae558faa", + "0001-scattered.interval_list:md5,b1877ad96aec308906594c50ebbe3ded" + ] + ] + ], + "versions": [ + "versions.yml:md5,384addd364fb36fdac7593eba22fcdb7" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.4" + }, + "timestamp": "2024-08-26T11:06:28.504041" + }, + "test-gatk4-splitintervals-intervals-stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + [ + "0000-scattered.interval_list:md5,d41d8cd98f00b204e9800998ecf8427e", + "0001-scattered.interval_list:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "1": [ + "versions.yml:md5,384addd364fb36fdac7593eba22fcdb7" + ], + "split_intervals": [ + [ + { + "id": "test" + }, + [ + "0000-scattered.interval_list:md5,d41d8cd98f00b204e9800998ecf8427e", + "0001-scattered.interval_list:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "versions": [ + "versions.yml:md5,384addd364fb36fdac7593eba22fcdb7" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.4" + }, + "timestamp": "2024-08-27T10:56:46.243594" + } +} \ No newline at end of file diff --git a/modules/nf-core/gatk4/splitintervals/tests/nextflow.config b/modules/nf-core/gatk4/splitintervals/tests/nextflow.config new file mode 100644 index 00000000000..18f7dda02be --- /dev/null +++ b/modules/nf-core/gatk4/splitintervals/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: GATK4_SPLITINTERVALS { + ext.args = "--scatter-count 2" + } +} \ No newline at end of file diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 3813618c44c..c3e3f775334 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -398,9 +398,6 @@ gatk4/sitedepthtobaf: gatk4/splitcram: - modules/nf-core/gatk4/splitcram/** - tests/modules/nf-core/gatk4/splitcram/** -gatk4/splitintervals: - - modules/nf-core/gatk4/splitintervals/** - - tests/modules/nf-core/gatk4/splitintervals/** gatk4/variantrecalibrator: - modules/nf-core/gatk4/variantrecalibrator/** - tests/modules/nf-core/gatk4/variantrecalibrator/** diff --git a/tests/modules/nf-core/gatk4/splitintervals/main.nf b/tests/modules/nf-core/gatk4/splitintervals/main.nf deleted file mode 100644 index 2a42cecd8d3..00000000000 --- a/tests/modules/nf-core/gatk4/splitintervals/main.nf +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { GATK4_SPLITINTERVALS } from '../../../../../modules/nf-core/gatk4/splitintervals/main.nf' - -workflow test_gatk4_splitintervals_bed { - - input = [ - [ id:'test' ], // meta map - file(params.test_data['homo_sapiens']['genome']['genome_multi_interval_bed'], checkIfExists: true) - ] - - fasta = [ [ id:'genome' ], // meta map - file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) - ] - fai = [ [ id:'genome' ], // meta map - file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) - ] - dict = [ [ id:'genome' ], // meta map - file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true) - ] - - GATK4_SPLITINTERVALS ( input, fasta, fai, dict) -} - -workflow test_gatk4_splitintervals_intervals { - - input = [ - [ id:'test' ], // meta map - file(params.test_data['homo_sapiens']['genome']['genome_interval_list'], checkIfExists: true) - ] - - fasta = [ [ id:'genome' ], // meta map - file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) - ] - fai = [ [ id:'genome' ], // meta map - file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) - ] - dict = [ [ id:'genome' ], // meta map - file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true) - ] - - GATK4_SPLITINTERVALS ( input, fasta, fai, dict) -} diff --git a/tests/modules/nf-core/gatk4/splitintervals/nextflow.config b/tests/modules/nf-core/gatk4/splitintervals/nextflow.config deleted file mode 100644 index 10fda96c12a..00000000000 --- a/tests/modules/nf-core/gatk4/splitintervals/nextflow.config +++ /dev/null @@ -1,9 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - - - withName: GATK4_SPLITINTERVALS { - ext.args = "--scatter-count 2" - } -} \ No newline at end of file diff --git a/tests/modules/nf-core/gatk4/splitintervals/test.yml b/tests/modules/nf-core/gatk4/splitintervals/test.yml deleted file mode 100644 index c50af18e501..00000000000 --- a/tests/modules/nf-core/gatk4/splitintervals/test.yml +++ /dev/null @@ -1,33 +0,0 @@ -- name: gatk4 splitintervals test_gatk4_splitintervals_bed - command: nextflow run ./tests/modules/nf-core/gatk4/splitintervals -entry test_gatk4_splitintervals_bed -c ./tests/config/nextflow.config - tags: - - gatk4/splitintervals - - gatk4 - files: - - path: output/gatk4/test/0000-scattered.interval_list - md5sum: c8d6b19e7a92535b6ce9608eae558faa - - path: output/gatk4/test/0001-scattered.interval_list - md5sum: b1877ad96aec308906594c50ebbe3ded - - path: output/gatk4/versions.yml - -- name: gatk4 splitintervals test_gatk4_splitintervals_intervals - command: nextflow run ./tests/modules/nf-core/gatk4/splitintervals -entry test_gatk4_splitintervals_intervals -c ./tests/config/nextflow.config - tags: - - gatk4/splitintervals - - gatk4 - files: - - path: output/gatk4/test/0000-scattered.interval_list - md5sum: ebd6b34a335efc6732ff541936c6d2d5 - - path: output/gatk4/test/0001-scattered.interval_list - md5sum: 9459b0e124fa84ec1e64ac4615bc9af7 - - path: output/gatk4/versions.yml - -- name: gatk4 splitintervals test_gatk4_splitintervals_intervals_stub - command: nextflow run ./tests/modules/nf-core/gatk4/splitintervals -entry test_gatk4_splitintervals_intervals -c ./tests/config/nextflow.config -stub - tags: - - gatk4/splitintervals - - gatk4 - files: - - path: output/gatk4/test/0000-scattered.interval_list - - path: output/gatk4/test/0001-scattered.interval_list - - path: output/gatk4/versions.yml