|
| 1 | +nextflow_process { |
| 2 | + |
| 3 | + name "Test Process METHURATOR_GTESTIMATOR" |
| 4 | + script "../main.nf" |
| 5 | + process "METHURATOR_GTESTIMATOR" |
| 6 | + config './nextflow.config' |
| 7 | + |
| 8 | + tag "modules" |
| 9 | + tag "modules_nfcore" |
| 10 | + tag "methurator" |
| 11 | + tag "methurator/gtestimator" |
| 12 | + |
| 13 | + test("Run methurator gt-estimator on paired-end methylated [bam] | sarscov2 genome [fasta]") { |
| 14 | + |
| 15 | + when { |
| 16 | + params { |
| 17 | + module_args = '--t-max 10 --minimum-coverage 1 --compute_ci' |
| 18 | + } |
| 19 | + |
| 20 | + process { |
| 21 | + """ |
| 22 | + input[0] = [ [ id:'test', single_end:false ], |
| 23 | + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam', checkIfExists: true), |
| 24 | + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam.bai', checkIfExists: true), |
| 25 | + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) |
| 26 | + ] |
| 27 | + """ |
| 28 | + } |
| 29 | + } |
| 30 | + |
| 31 | + then { |
| 32 | + assertAll( |
| 33 | + { assert process.success }, |
| 34 | + { assert snapshot( |
| 35 | + // Avoid first 3 lines of the summary report as they contain the date and time of the run |
| 36 | + file(process.out.summary_report[0][1]).readLines()[3..10].join('\n').md5(), |
| 37 | + process.out.findAll { key, val -> key.startsWith('versions') } |
| 38 | + ).match()} |
| 39 | + ) |
| 40 | + } |
| 41 | + } |
| 42 | + test("Run methurator gt-estimator on paired-end methylated [bam] | sarscov2 genome [fasta] - stub") { |
| 43 | + |
| 44 | + options "-stub" |
| 45 | + |
| 46 | + when { |
| 47 | + params { |
| 48 | + module_args = '--t-max 10 --minimum-coverage 1 --compute_ci' |
| 49 | + } |
| 50 | + process { |
| 51 | + """ |
| 52 | + input[0] = [ [ id:'test', single_end:false ], |
| 53 | + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam', checkIfExists: true), |
| 54 | + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam.bai', checkIfExists: true), |
| 55 | + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) |
| 56 | + ] |
| 57 | + """ |
| 58 | + } |
| 59 | + } |
| 60 | + |
| 61 | + then { |
| 62 | + assertAll( |
| 63 | + { assert process.success }, |
| 64 | + { assert snapshot(sanitizeOutput(process.out)).match() } |
| 65 | + ) |
| 66 | + } |
| 67 | + } |
| 68 | +} |
0 commit comments