diff --git a/.gitignore b/.gitignore index 21d3f112..0471e3fd 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,7 @@ testing/ testing* *.pyc null/ +# nf-test specific +.nf-test/ +nf-test_* +.nf-test.log* \ No newline at end of file diff --git a/nf-test.config b/nf-test.config new file mode 100644 index 00000000..e86a25ba --- /dev/null +++ b/nf-test.config @@ -0,0 +1,8 @@ +config { + + testsDir "tests" + workDir ".nf-test" + profile "test" + +} + diff --git a/tests/modules/local/amber/main.nf.test b/tests/modules/local/amber/main.nf.test new file mode 100644 index 00000000..e8e3657d --- /dev/null +++ b/tests/modules/local/amber/main.nf.test @@ -0,0 +1,50 @@ +nextflow_process { + + name "Test Process AMBER" + script "modules/local/amber/main.nf" + process "AMBER" + + test("AMBER testing") { + + when { + params { + + publish_dir_mode = "symlink" + // test_reference_data = 'https://raw.githubusercontent.com/nf-core/test-datasets/oncoanalyser/reference_data/hmftools/5.34_38--2/dna_pipeline/copy_number/' + test_sample_data = 'https://raw.githubusercontent.com/nf-core/test-datasets/oncoanalyser/sample_data/simulated_reads/wgts/markdups_bam/' + + } + + process { + """ + // define inputs of the process here. Example: + // input[0] = file("test-file.txt") + + input[0] = [ + [id: 'test', + tumor_id: 'tumor_test', + normal_id: 'normal_test' + ], + + file(params.test_sample_data + 'subject_a.tumor.dna.bwa-mem2_2.2.1.markdups.bam', checkIfExists: true), + file(params.test_sample_data + 'subject_a.normal.dna.bwa-mem2_2.2.1.markdups.bam', checkIfExists: true), + file(params.test_sample_data + 'subject_a.tumor.dna.bwa-mem2_2.2.1.markdups.bam.bai', checkIfExists: true), + file(params.test_sample_data + 'subject_a.normal.dna.bwa-mem2_2.2.1.markdups.bam.bai', checkIfExists: true), + + ] + input[1] = 38 + // input[2] = file(params.test_reference_data + 'AmberGermlineSites.38.tsv.gz', checkIfExists: true) + input[2] = file("https://raw.githubusercontent.com/nf-core/test-datasets/oncoanalyser/reference_data/hmftools/5.34_38--2/dna_pipeline/copy_number/AmberGermlineSites.38.tsv.gz") + input[3] = [] + """ + } + } + + then { + assert process.success + assert snapshot(process.out).match() + } + + } + +} diff --git a/tests/modules/local/amber/main.nf.test.snap b/tests/modules/local/amber/main.nf.test.snap new file mode 100644 index 00000000..a30d1459 --- /dev/null +++ b/tests/modules/local/amber/main.nf.test.snap @@ -0,0 +1,61 @@ +{ + "AMBER testing": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "tumor_id": "tumor_test", + "normal_id": "normal_test" + }, + [ + "amber.version:md5,94a3ca487cc956f9eadb8de364c27b1d", + "normal_test.amber.homozygousregion.tsv:md5,d21abd62a26119eaf01ea8d1f66b9f05", + "normal_test.amber.snp.vcf.gz:md5,44f59e7c11b3b348f647e0251732acc6", + "normal_test.amber.snp.vcf.gz.tbi:md5,e4caffcadff308826156914dd6b43484", + "tumor_test.amber.baf.pcf:md5,d4015414e9ccf00ab02c818a2a99a939", + "tumor_test.amber.baf.tsv.gz:md5,7c6921d6c7742598b3e8b3f7fe8fea8d", + "tumor_test.amber.contamination.tsv:md5,6fb3d29cc2c879b1db07cc8581a8fb70", + "tumor_test.amber.contamination.vcf.gz:md5,5562d1e335c40ff733bbf751e37e541c", + "tumor_test.amber.contamination.vcf.gz.tbi:md5,a359216fecd8b0a3eada28dc683300a1", + "tumor_test.amber.qc:md5,9c502425aa5e1bf23569e1f60a32dcf1" + ] + ] + ], + "1": [ + "versions.yml:md5,f5846f28a6cd7391cccfc28a96892710" + ], + "amber_dir": [ + [ + { + "id": "test", + "tumor_id": "tumor_test", + "normal_id": "normal_test" + }, + [ + "amber.version:md5,94a3ca487cc956f9eadb8de364c27b1d", + "normal_test.amber.homozygousregion.tsv:md5,d21abd62a26119eaf01ea8d1f66b9f05", + "normal_test.amber.snp.vcf.gz:md5,44f59e7c11b3b348f647e0251732acc6", + "normal_test.amber.snp.vcf.gz.tbi:md5,e4caffcadff308826156914dd6b43484", + "tumor_test.amber.baf.pcf:md5,d4015414e9ccf00ab02c818a2a99a939", + "tumor_test.amber.baf.tsv.gz:md5,7c6921d6c7742598b3e8b3f7fe8fea8d", + "tumor_test.amber.contamination.tsv:md5,6fb3d29cc2c879b1db07cc8581a8fb70", + "tumor_test.amber.contamination.vcf.gz:md5,5562d1e335c40ff733bbf751e37e541c", + "tumor_test.amber.contamination.vcf.gz.tbi:md5,a359216fecd8b0a3eada28dc683300a1", + "tumor_test.amber.qc:md5,9c502425aa5e1bf23569e1f60a32dcf1" + ] + ] + ], + "versions": [ + "versions.yml:md5,f5846f28a6cd7391cccfc28a96892710" + ] + } + ], + "meta": { + "nf-test": "0.9.1", + "nextflow": "24.10.0" + }, + "timestamp": "2024-11-12T12:39:04.36170114" + } +} \ No newline at end of file diff --git a/tests/nextflow.config b/tests/nextflow.config new file mode 100644 index 00000000..c19b1ad0 --- /dev/null +++ b/tests/nextflow.config @@ -0,0 +1,5 @@ +/* +======================================================================================== + Nextflow config file for running tests +======================================================================================== +*/