From fe5c75ac152e7728d5affa80b329d81b9712f73a Mon Sep 17 00:00:00 2001 From: maxulysse Date: Tue, 29 Oct 2024 09:05:11 +0100 Subject: [PATCH] snpeff --- tests/annotation-snpeff.nf.test | 75 ++++++++++ tests/annotation-snpeff.nf.test.snap | 197 +++++++++++++++++++++++++++ tests/config/pytesttags.yml | 9 -- tests/test_annotation_snpeff.yml | 27 ---- 4 files changed, 272 insertions(+), 36 deletions(-) create mode 100644 tests/annotation-snpeff.nf.test create mode 100644 tests/annotation-snpeff.nf.test.snap delete mode 100644 tests/test_annotation_snpeff.yml diff --git a/tests/annotation-snpeff.nf.test b/tests/annotation-snpeff.nf.test new file mode 100644 index 0000000000..611710a84c --- /dev/null +++ b/tests/annotation-snpeff.nf.test @@ -0,0 +1,75 @@ +nextflow_pipeline { + + name "Test pipeline" + script "../main.nf" + tag "pipeline" + tag "pipeline_sarek" + + test("Run with profile test | --tools snpeff --download_cache") { + + when { + params { + modules_testdata_base_path = 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/' + outdir = "$outputDir" + input = "${projectDir}/tests/csv/3.0/vcf_single.csv" + step = 'annotate' + download_cache = true + tools = 'snpeff' + } + } + + then { + // stable_name: All files + folders in ${params.outdir}/ with a stable name + def stable_name = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}']) + // stable_path: All files in ${params.outdir}/ with stable content + def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore') + assertAll( + { assert workflow.success}, + { assert snapshot( + // Number of successful tasks + workflow.trace.succeeded().size(), + // pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions + removeNextflowVersion("$outputDir/pipeline_info/nf_core_sarek_software_mqc_versions.yml"), + // All stable path name, with a relative path + stable_name, + // All files with stable contents + stable_path + ).match() } + ) + } + } + + test("Run with profile test | --tools snpeff") { + + when { + params { + modules_testdata_base_path = 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/' + outdir = "$outputDir" + input = "${projectDir}/tests/csv/3.0/vcf_single.csv" + step = 'annotate' + snpeff_cache = 's3://annotation-cache/snpeff_cache/' + tools = 'snpeff' + } + } + + then { + // stable_name: All files + folders in ${params.outdir}/ with a stable name + def stable_name = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}']) + // stable_path: All files in ${params.outdir}/ with stable content + def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore') + assertAll( + { assert workflow.success}, + { assert snapshot( + // Number of successful tasks + workflow.trace.succeeded().size(), + // pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions + removeNextflowVersion("$outputDir/pipeline_info/nf_core_sarek_software_mqc_versions.yml"), + // All stable path name, with a relative path + stable_name, + // All files with stable contents + stable_path + ).match() } + ) + } + } +} diff --git a/tests/annotation-snpeff.nf.test.snap b/tests/annotation-snpeff.nf.test.snap new file mode 100644 index 0000000000..84a9016c92 --- /dev/null +++ b/tests/annotation-snpeff.nf.test.snap @@ -0,0 +1,197 @@ +{ + "Run with profile test | --tools snpeff --download_cache": { + "content": [ + 4, + { + "SNPEFF_SNPEFF": { + "snpeff": "5.1d" + }, + "TABIX_BGZIPTABIX": { + "tabix": 1.2 + }, + "Workflow": { + "nf-core/sarek": "v3.5.0dev" + } + }, + [ + "annotation", + "annotation/test", + "annotation/test/test_snpEff.ann.vcf.gz", + "annotation/test/test_snpEff.ann.vcf.gz.tbi", + "cache", + "cache/snpeff_cache", + "cache/snpeff_cache/WBcel235.105", + "cache/snpeff_cache/WBcel235.105/sequence.I.bin", + "cache/snpeff_cache/WBcel235.105/sequence.II.bin", + "cache/snpeff_cache/WBcel235.105/sequence.III.bin", + "cache/snpeff_cache/WBcel235.105/sequence.IV.bin", + "cache/snpeff_cache/WBcel235.105/sequence.V.bin", + "cache/snpeff_cache/WBcel235.105/sequence.X.bin", + "cache/snpeff_cache/WBcel235.105/sequence.bin", + "cache/snpeff_cache/WBcel235.105/snpEffectPredictor.bin", + "cache/versions.yml", + "csv", + "multiqc", + "multiqc/multiqc_data", + "multiqc/multiqc_data/multiqc.log", + "multiqc/multiqc_data/multiqc_citations.txt", + "multiqc/multiqc_data/multiqc_data.json", + "multiqc/multiqc_data/multiqc_general_stats.txt", + "multiqc/multiqc_data/multiqc_snpeff.txt", + "multiqc/multiqc_data/multiqc_software_versions.txt", + "multiqc/multiqc_data/multiqc_sources.txt", + "multiqc/multiqc_data/snpeff_effects.txt", + "multiqc/multiqc_data/snpeff_qualities.txt", + "multiqc/multiqc_data/snpeff_variant_effects_region.txt", + "multiqc/multiqc_plots", + "multiqc/multiqc_plots/pdf", + "multiqc/multiqc_plots/pdf/general_stats_table.pdf", + "multiqc/multiqc_plots/pdf/snpeff_effects-cnt.pdf", + "multiqc/multiqc_plots/pdf/snpeff_effects-pct.pdf", + "multiqc/multiqc_plots/pdf/snpeff_qualities.pdf", + "multiqc/multiqc_plots/pdf/snpeff_variant_effects_region-cnt.pdf", + "multiqc/multiqc_plots/pdf/snpeff_variant_effects_region-log.pdf", + "multiqc/multiqc_plots/pdf/snpeff_variant_effects_region-pct-log.pdf", + "multiqc/multiqc_plots/pdf/snpeff_variant_effects_region-pct.pdf", + "multiqc/multiqc_plots/png", + "multiqc/multiqc_plots/png/general_stats_table.png", + "multiqc/multiqc_plots/png/snpeff_effects-cnt.png", + "multiqc/multiqc_plots/png/snpeff_effects-pct.png", + "multiqc/multiqc_plots/png/snpeff_qualities.png", + "multiqc/multiqc_plots/png/snpeff_variant_effects_region-cnt.png", + "multiqc/multiqc_plots/png/snpeff_variant_effects_region-log.png", + "multiqc/multiqc_plots/png/snpeff_variant_effects_region-pct-log.png", + "multiqc/multiqc_plots/png/snpeff_variant_effects_region-pct.png", + "multiqc/multiqc_plots/svg", + "multiqc/multiqc_plots/svg/general_stats_table.svg", + "multiqc/multiqc_plots/svg/snpeff_effects-cnt.svg", + "multiqc/multiqc_plots/svg/snpeff_effects-pct.svg", + "multiqc/multiqc_plots/svg/snpeff_qualities.svg", + "multiqc/multiqc_plots/svg/snpeff_variant_effects_region-cnt.svg", + "multiqc/multiqc_plots/svg/snpeff_variant_effects_region-log.svg", + "multiqc/multiqc_plots/svg/snpeff_variant_effects_region-pct-log.svg", + "multiqc/multiqc_plots/svg/snpeff_variant_effects_region-pct.svg", + "multiqc/multiqc_report.html", + "pipeline_info", + "pipeline_info/nf_core_sarek_software_mqc_versions.yml", + "reports", + "reports/snpeff", + "reports/snpeff/test", + "reports/snpeff/test/snpEff_summary.html", + "reports/snpeff/test/test_snpEff.csv", + "reports/snpeff/test/test_snpEff.genes.txt" + ], + [ + "sequence.I.bin:md5,2fd1694bd91cf7952cbad8cfed161e53", + "sequence.II.bin:md5,bacedbdea89508e108223767fa260a4c", + "sequence.III.bin:md5,444118a9fb9d0a03c37e86094d8e52a9", + "sequence.IV.bin:md5,ff756628faa0b71cd65495668c3d82b5", + "sequence.V.bin:md5,d6ad5476162ac45829f719dd4ee3f4e7", + "sequence.X.bin:md5,b79bec6cc8f96b8373dac56bab5d0a6c", + "sequence.bin:md5,ec2bc2ae81755ab90fcf1848bc7ce41f", + "snpEffectPredictor.bin:md5,1d99251d0405f0a42913ed8b5b2c2fa7", + "versions.yml:md5,e9698b9ccf3bb151631d1e07fbae8397", + "multiqc_citations.txt:md5,47e39f5f5f05da6bc38d13aa81fe8b6e", + "multiqc_snpeff.txt:md5,03a2b1c461cb6e5cccac64033a2f6526", + "snpeff_effects.txt:md5,3c5e9a1c191b77c781dc4d033b1dd1f7", + "snpeff_qualities.txt:md5,4c059b4e8bf0a64940ad1d6e30efd3a6", + "snpeff_variant_effects_region.txt:md5,05efd324edadced17ba3cd2b7714af57", + "snpEff_summary.html:md5,b0658aa728db5acfb5fae433d411f06a", + "test_snpEff.csv:md5,d6ca9f83555aa18445d565692b5ee8c2", + "test_snpEff.genes.txt:md5,130536bf0237d7f3f746d32aaa32840a" + ] + ], + "meta": { + "nf-test": "0.9.1", + "nextflow": "24.10.0" + }, + "timestamp": "2024-10-29T09:02:01.062023" + }, + "Run with profile test | --tools snpeff": { + "content": [ + 3, + { + "SNPEFF_SNPEFF": { + "snpeff": "5.1d" + }, + "TABIX_BGZIPTABIX": { + "tabix": 1.2 + }, + "Workflow": { + "nf-core/sarek": "v3.5.0dev" + } + }, + [ + "annotation", + "annotation/test", + "annotation/test/test_snpEff.ann.vcf.gz", + "annotation/test/test_snpEff.ann.vcf.gz.tbi", + "csv", + "multiqc", + "multiqc/multiqc_data", + "multiqc/multiqc_data/multiqc.log", + "multiqc/multiqc_data/multiqc_citations.txt", + "multiqc/multiqc_data/multiqc_data.json", + "multiqc/multiqc_data/multiqc_general_stats.txt", + "multiqc/multiqc_data/multiqc_snpeff.txt", + "multiqc/multiqc_data/multiqc_software_versions.txt", + "multiqc/multiqc_data/multiqc_sources.txt", + "multiqc/multiqc_data/snpeff_effects.txt", + "multiqc/multiqc_data/snpeff_qualities.txt", + "multiqc/multiqc_data/snpeff_variant_effects_region.txt", + "multiqc/multiqc_plots", + "multiqc/multiqc_plots/pdf", + "multiqc/multiqc_plots/pdf/general_stats_table.pdf", + "multiqc/multiqc_plots/pdf/snpeff_effects-cnt.pdf", + "multiqc/multiqc_plots/pdf/snpeff_effects-pct.pdf", + "multiqc/multiqc_plots/pdf/snpeff_qualities.pdf", + "multiqc/multiqc_plots/pdf/snpeff_variant_effects_region-cnt.pdf", + "multiqc/multiqc_plots/pdf/snpeff_variant_effects_region-log.pdf", + "multiqc/multiqc_plots/pdf/snpeff_variant_effects_region-pct-log.pdf", + "multiqc/multiqc_plots/pdf/snpeff_variant_effects_region-pct.pdf", + "multiqc/multiqc_plots/png", + "multiqc/multiqc_plots/png/general_stats_table.png", + "multiqc/multiqc_plots/png/snpeff_effects-cnt.png", + "multiqc/multiqc_plots/png/snpeff_effects-pct.png", + "multiqc/multiqc_plots/png/snpeff_qualities.png", + "multiqc/multiqc_plots/png/snpeff_variant_effects_region-cnt.png", + "multiqc/multiqc_plots/png/snpeff_variant_effects_region-log.png", + "multiqc/multiqc_plots/png/snpeff_variant_effects_region-pct-log.png", + "multiqc/multiqc_plots/png/snpeff_variant_effects_region-pct.png", + "multiqc/multiqc_plots/svg", + "multiqc/multiqc_plots/svg/general_stats_table.svg", + "multiqc/multiqc_plots/svg/snpeff_effects-cnt.svg", + "multiqc/multiqc_plots/svg/snpeff_effects-pct.svg", + "multiqc/multiqc_plots/svg/snpeff_qualities.svg", + "multiqc/multiqc_plots/svg/snpeff_variant_effects_region-cnt.svg", + "multiqc/multiqc_plots/svg/snpeff_variant_effects_region-log.svg", + "multiqc/multiqc_plots/svg/snpeff_variant_effects_region-pct-log.svg", + "multiqc/multiqc_plots/svg/snpeff_variant_effects_region-pct.svg", + "multiqc/multiqc_report.html", + "pipeline_info", + "pipeline_info/nf_core_sarek_software_mqc_versions.yml", + "reports", + "reports/snpeff", + "reports/snpeff/test", + "reports/snpeff/test/snpEff_summary.html", + "reports/snpeff/test/test_snpEff.csv", + "reports/snpeff/test/test_snpEff.genes.txt" + ], + [ + "multiqc_citations.txt:md5,47e39f5f5f05da6bc38d13aa81fe8b6e", + "multiqc_snpeff.txt:md5,03a2b1c461cb6e5cccac64033a2f6526", + "snpeff_effects.txt:md5,3c5e9a1c191b77c781dc4d033b1dd1f7", + "snpeff_qualities.txt:md5,4c059b4e8bf0a64940ad1d6e30efd3a6", + "snpeff_variant_effects_region.txt:md5,05efd324edadced17ba3cd2b7714af57", + "snpEff_summary.html:md5,990f2f24d5f37d177bca479706135be7", + "test_snpEff.csv:md5,f077b95576c7d137a2fd1d096aa5434c", + "test_snpEff.genes.txt:md5,130536bf0237d7f3f746d32aaa32840a" + ] + ], + "meta": { + "nf-test": "0.9.1", + "nextflow": "24.10.0" + }, + "timestamp": "2024-10-29T09:04:02.127501" + } +} \ No newline at end of file diff --git a/tests/config/pytesttags.yml b/tests/config/pytesttags.yml index ea3d450128..e1cf0eb7f5 100644 --- a/tests/config/pytesttags.yml +++ b/tests/config/pytesttags.yml @@ -461,15 +461,6 @@ merge: - tests/csv/3.0/vcf_single.csv - tests/test_annotation_merge.yml -## snpeff -snpeff: - - conf/modules/annotate.config - - modules/nf-core/snpeff/snpeff/** - - modules/nf-core/tabix/bgziptabix/** - - subworkflows/nf-core/vcf_annotate_snpeff/** - - tests/csv/3.0/vcf_single.csv - - tests/test_annotation_snpeff.yml - ## bcfann bcfann: - conf/modules/annotate.config diff --git a/tests/test_annotation_snpeff.yml b/tests/test_annotation_snpeff.yml deleted file mode 100644 index 5ad71d0664..0000000000 --- a/tests/test_annotation_snpeff.yml +++ /dev/null @@ -1,27 +0,0 @@ -- name: Run snpEff - command: nextflow run main.nf -profile test,annotation --tools snpeff --outdir results --download_cache - tags: - - annotation - - snpeff - files: - - path: results/annotation/test/test_snpEff.ann.vcf.gz - # binary changes md5sums on reruns - - path: results/annotation/test/test_snpEff.ann.vcf.gz.tbi - # binary changes md5sums on reruns - - path: results/multiqc - - path: results/reports/snpeff/test/snpEff_summary.html - contains: [" Genome total length ", " 100,286,402 ", " MT192765.1 "] - - path: results/reports/snpeff/test/test_snpEff.csv - contains: - [ - "Values , 50,100", - "Count , 1,8", - "Reference , 0", - "Het , 1", - "Hom , 8", - "Missing , 0", - "MT192765.1, Position,0,1", - "MT192765.1,Count,0,0", - ] - - path: results/reports/snpeff/test/test_snpEff.genes.txt - md5sum: 130536bf0237d7f3f746d32aaa32840a