|
| 1 | +nextflow_pipeline { |
| 2 | + |
| 3 | + name "Test pipeline with dummy UMI settings" |
| 4 | + script "../main.nf" |
| 5 | + |
| 6 | + test("Params: --aligner hisat2 --umi_dedup_tool 'umicollapse'") { |
| 7 | + |
| 8 | + when { |
| 9 | + params { |
| 10 | + with_umi = true |
| 11 | + umitools_extract_method = "regex" |
| 12 | + umitools_bc_pattern = "^(?P<umi_1>CGA.{8}){s<=2}.*" |
| 13 | + umitools_dedup_stats = true |
| 14 | + skip_bbsplit = true |
| 15 | + umi_dedup_tool = 'umicollapse' |
| 16 | + aligner = 'hisat2' |
| 17 | + outdir = "$outputDir" |
| 18 | + } |
| 19 | + } |
| 20 | + |
| 21 | + then { |
| 22 | + // stable_name: All files + folders in ${params.outdir}/ with a stable name |
| 23 | + def stable_name = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}']) |
| 24 | + // stable_path: All files in ${params.outdir}/ with stable content |
| 25 | + def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore') |
| 26 | + assertAll( |
| 27 | + { assert workflow.success}, |
| 28 | + { assert snapshot( |
| 29 | + // Number of successful tasks |
| 30 | + workflow.trace.succeeded().size(), |
| 31 | + // pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions |
| 32 | + removeNextflowVersion("$outputDir/pipeline_info/nf_core_rnaseq_software_mqc_versions.yml"), |
| 33 | + // All stable path name, with a relative path |
| 34 | + stable_name, |
| 35 | + // All files with stable contents |
| 36 | + stable_path |
| 37 | + ).match() } |
| 38 | + ) |
| 39 | + } |
| 40 | + } |
| 41 | + |
| 42 | + test("--umi_dedup_tool 'umitools'") { |
| 43 | + |
| 44 | + when { |
| 45 | + params { |
| 46 | + with_umi = true |
| 47 | + umitools_extract_method = "regex" |
| 48 | + umitools_bc_pattern = "^(?P<umi_1>CGA.{8}){s<=2}.*" |
| 49 | + umitools_dedup_stats = true |
| 50 | + skip_bbsplit = true |
| 51 | + outdir = "$outputDir" |
| 52 | + } |
| 53 | + } |
| 54 | + |
| 55 | + then { |
| 56 | + // stable_name: All files + folders in ${params.outdir}/ with a stable name |
| 57 | + def stable_name = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}']) |
| 58 | + // stable_path: All files in ${params.outdir}/ with stable content |
| 59 | + def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore') |
| 60 | + assertAll( |
| 61 | + { assert workflow.success}, |
| 62 | + { assert snapshot( |
| 63 | + // Number of successful tasks |
| 64 | + workflow.trace.succeeded().size(), |
| 65 | + // pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions |
| 66 | + removeNextflowVersion("$outputDir/pipeline_info/nf_core_rnaseq_software_mqc_versions.yml"), |
| 67 | + // All stable path name, with a relative path |
| 68 | + stable_name, |
| 69 | + // All files with stable contents |
| 70 | + stable_path |
| 71 | + ).match() } |
| 72 | + ) |
| 73 | + } |
| 74 | + } |
| 75 | + |
| 76 | + test("--umi_dedup_tool 'umitools - stub") { |
| 77 | + |
| 78 | + options "-stub" |
| 79 | + |
| 80 | + when { |
| 81 | + params { |
| 82 | + with_umi = true |
| 83 | + umitools_extract_method = "regex" |
| 84 | + umitools_bc_pattern = "^(?P<umi_1>CGA.{8}){s<=2}.*" |
| 85 | + umitools_dedup_stats = true |
| 86 | + outdir = "$outputDir" |
| 87 | + } |
| 88 | + } |
| 89 | + |
| 90 | + then { |
| 91 | + // stable_name: All files + folders in ${params.outdir}/ with a stable name |
| 92 | + def stable_name = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}']) |
| 93 | + // stable_path: All files in ${params.outdir}/ with stable content |
| 94 | + def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore') |
| 95 | + assertAll( |
| 96 | + { assert workflow.success}, |
| 97 | + { assert snapshot( |
| 98 | + // Number of successful tasks |
| 99 | + workflow.trace.succeeded().size(), |
| 100 | + // pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions |
| 101 | + removeNextflowVersion("$outputDir/pipeline_info/nf_core_rnaseq_software_mqc_versions.yml"), |
| 102 | + // All stable path name, with a relative path |
| 103 | + stable_name, |
| 104 | + // All files with stable contents |
| 105 | + stable_path |
| 106 | + ).match() } |
| 107 | + ) |
| 108 | + } |
| 109 | + } |
| 110 | +} |
0 commit comments