|
| 1 | +nextflow_process { |
| 2 | + |
| 3 | + name "Test Process DEACON_FILTER" |
| 4 | + script "../main.nf" |
| 5 | + process "DEACON_FILTER" |
| 6 | + |
| 7 | + tag "modules" |
| 8 | + tag "modules_nfcore" |
| 9 | + tag "deacon" |
| 10 | + tag "deacon/filter" |
| 11 | + tag "deacon/index" |
| 12 | + |
| 13 | + test("sarscov2 - fastq - single-end") { |
| 14 | + |
| 15 | + setup { |
| 16 | + run("DEACON_INDEX") { |
| 17 | + script "../../index/main.nf" |
| 18 | + process { |
| 19 | + """ |
| 20 | + input[0] = [ |
| 21 | + [ id:'test', single_end:true ], // meta map |
| 22 | + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) |
| 23 | + ] |
| 24 | + """ |
| 25 | + } |
| 26 | + } |
| 27 | + } |
| 28 | + |
| 29 | + when { |
| 30 | + process { |
| 31 | + """ |
| 32 | + filter_fastq_ch = Channel.of( |
| 33 | + [ |
| 34 | + [ id:'test', single_end:true ], // meta map |
| 35 | + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) |
| 36 | + ] |
| 37 | + ) |
| 38 | + input[0] = DEACON_INDEX.out.index.join(filter_fastq_ch) |
| 39 | + """ |
| 40 | + } |
| 41 | + } |
| 42 | + |
| 43 | + then { |
| 44 | + assertAll( |
| 45 | + { assert process.success }, |
| 46 | + { assert snapshot( |
| 47 | + file(process.out.log[0][1]).name, |
| 48 | + process.out.fastq_filtered, |
| 49 | + process.out.versions.collect { path(it).yaml } |
| 50 | + ).match()} |
| 51 | + ) |
| 52 | + } |
| 53 | + |
| 54 | + } |
| 55 | + |
| 56 | + test("sarscov2 - fastq - paired-end") { |
| 57 | + |
| 58 | + setup { |
| 59 | + run("DEACON_INDEX") { |
| 60 | + script "../../index/main.nf" |
| 61 | + process { |
| 62 | + """ |
| 63 | + input[0] = [ |
| 64 | + [ id:'test', single_end:false ], // meta map |
| 65 | + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) |
| 66 | + ] |
| 67 | + """ |
| 68 | + } |
| 69 | + } |
| 70 | + } |
| 71 | + |
| 72 | + when { |
| 73 | + process { |
| 74 | + """ |
| 75 | + filter_fastq_ch = Channel.of( |
| 76 | + [ |
| 77 | + [ id:'test', single_end:false ], // meta map |
| 78 | + [ |
| 79 | + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), |
| 80 | + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) |
| 81 | + ] |
| 82 | + ] |
| 83 | + ) |
| 84 | + input[0] = DEACON_INDEX.out.index.join(filter_fastq_ch) |
| 85 | + """ |
| 86 | + } |
| 87 | + } |
| 88 | + |
| 89 | + then { |
| 90 | + assertAll( |
| 91 | + { assert process.success }, |
| 92 | + { assert snapshot( |
| 93 | + file(process.out.log[0][1]).name, |
| 94 | + process.out.fastq_filtered |
| 95 | + ).match()}, |
| 96 | + { assert snapshot(process.out.versions).match("versions") } |
| 97 | + ) |
| 98 | + } |
| 99 | + |
| 100 | + } |
| 101 | + |
| 102 | + test("sarscov2 - fastq - single-end - stub") { |
| 103 | + |
| 104 | + options "-stub" |
| 105 | + |
| 106 | + setup { |
| 107 | + run("DEACON_INDEX") { |
| 108 | + script "../../index/main.nf" |
| 109 | + process { |
| 110 | + """ |
| 111 | + input[0] = [ |
| 112 | + [ id:'test', single_end:true ], // meta map |
| 113 | + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) |
| 114 | + ] |
| 115 | + """ |
| 116 | + } |
| 117 | + } |
| 118 | + } |
| 119 | + |
| 120 | + when { |
| 121 | + process { |
| 122 | + """ |
| 123 | + filter_fastq_ch = Channel.of( |
| 124 | + [ |
| 125 | + [ id:'test', single_end:true ], // meta map |
| 126 | + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), |
| 127 | + ] |
| 128 | + ) |
| 129 | + input[0] = DEACON_INDEX.out.index.join(filter_fastq_ch) |
| 130 | + """ |
| 131 | + } |
| 132 | + } |
| 133 | + |
| 134 | + then { |
| 135 | + assertAll( |
| 136 | + { assert process.success }, |
| 137 | + { assert snapshot( |
| 138 | + process.out, |
| 139 | + process.out.versions.collect { path(it).yaml } |
| 140 | + ).match()} |
| 141 | + ) |
| 142 | + } |
| 143 | + } |
| 144 | + |
| 145 | +} |
0 commit comments