@@ -8,39 +8,84 @@ nextflow_process {
88 tag "modules_nfcore"
99 tag "crispresso2"
1010
11- test("crispresso2 - single_end") {
11+ config "./nextflow.config"
1212
13- config "./single_end.config"
13+ test("crispresso2 - single_end - auto") {
1414
1515 when {
16+ params {
17+ module_args = "--suppress_plots --auto"
18+ }
1619 process {
1720 """
1821 input[0] = [
1922 [ id:'test', single_end:true ],
2023 file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true)
2124 ]
25+ input[1] = []
26+ input[2] = []
2227 """
2328 }
2429 }
2530
2631 then {
27- assertAll(
32+ def html_out = process.out.html[0][1]
33+ def htmls = html_out instanceof List ? html_out : [html_out]
34+ assertAll(
2835 { assert process.success },
2936 { assert snapshot(
3037 process.out.results[0][1].size(),
31- file(process.out. html[0][1] ).name,
38+ htmls.collect{ html -> file(html).name }.sort() ,
3239 process.out.txt[0][1].size(),
3340 process.out.findAll { key, val -> key.startsWith("versions")}
3441 ).match() },
3542 )
3643 }
3744 }
3845
39- test("crispresso2 - paired_end") {
46+ test("crispresso2 - paired_end - auto ") {
4047
41- config "./paired_end.config"
48+ when {
49+ params {
50+ // fastp argument added due to https://github.com/pinellolab/CRISPResso2/issues/648
51+ module_args = "--suppress_plots --auto --fastp_command 'fastp --merged_out /dev/stdout'"
52+ }
53+ process {
54+ """
55+ input[0] = [
56+ [ id:'paired_test', single_end:false ],
57+ [
58+ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true),
59+ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true)
60+ ]
61+ ]
62+ input[1] = []
63+ input[2] = []
64+ """
65+ }
66+ }
67+
68+ then {
69+ def html_out = process.out.html[0][1]
70+ def htmls = html_out instanceof List ? html_out : [html_out]
71+ assertAll(
72+ { assert process.success },
73+ { assert snapshot(
74+ process.out.results[0][1].size(),
75+ htmls.collect{ html -> file(html).name }.sort(),
76+ process.out.txt[0][1].size(),
77+ process.out.findAll { key, val -> key.startsWith("versions")}
78+ ).match() },
79+ )
80+ }
81+ }
82+
83+ test("crispresso2 - paired_end - amplicon string") {
4284
4385 when {
86+ params {
87+ module_args = "--suppress_plots"
88+ }
4489 process {
4590 """
4691 input[0] = [
@@ -50,44 +95,93 @@ nextflow_process {
5095 file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true)
5196 ]
5297 ]
98+ input[1] = "CCTGTTGTCTATGTGATAGACGTGCCACATGCTTTTCCACTGCTTCAGACACTTATGCCTGTTGGCATCATTCTATTGGATTTGATTACGTCTATAATCCGTTTATGATTGATGTTCAACAATGGGGTTTTACAGGTAACCTACAAAGCA"
99+ input[2] = []
53100 """
54101 }
55102 }
56103
57104 then {
105+ def html_out = process.out.html[0][1]
106+ def htmls = html_out instanceof List ? html_out : [html_out]
58107 assertAll(
59108 { assert process.success },
60109 { assert snapshot(
61110 process.out.results[0][1].size(),
62- process.out.html[0][1] .collect{ html -> file(html).name }.sort(),
111+ htmls .collect{ html -> file(html).name }.sort(),
63112 process.out.txt[0][1].size(),
64113 process.out.findAll { key, val -> key.startsWith("versions")}
65114 ).match() },
66115 )
67116 }
68117 }
69118
70- test("crispresso2 - nhej_analysis ") {
119+ test("crispresso2 - paired_end - amplicon file ") {
71120
72- config "./nhej.config"
121+ when {
122+ params {
123+ module_args = "--suppress_plots"
124+ }
125+ process {
126+ """
127+ input[0] = [
128+ [ id:'paired_test', single_end:false ],
129+ [
130+ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true),
131+ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true)
132+ ]
133+ ]
134+ input[1] = []
135+ input[2] = file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fasta/amplicon.txt', checkIfExists: true)
136+ """
137+ }
138+ }
139+
140+ then {
141+ def html_out = process.out.html[0][1]
142+ def htmls = html_out instanceof List ? html_out : [html_out]
143+ assertAll(
144+ { assert process.success },
145+ { assert snapshot(
146+ process.out.results[0][1].size(),
147+ htmls.collect{ html -> file(html).name }.sort(),
148+ process.out.txt[0][1].size(),
149+ process.out.findAll { key, val -> key.startsWith("versions")}
150+ ).match() },
151+ )
152+ }
153+ }
154+
155+ test("crispresso2 - single_end - stub") {
156+
157+ options '-stub'
73158
74159 when {
160+ params {
161+ module_args = ""
162+ }
75163 process {
76164 """
77165 input[0] = [
78- [ id:'nhej_test ', single_end:true ],
166+ [ id:'test ', single_end:true ],
79167 file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true)
80168 ]
169+ input[1] = []
170+ input[2] = []
81171 """
82172 }
83173 }
84174
85175 then {
176+ def html_out = process.out.html[0][1]
177+ def htmls = html_out instanceof List ? html_out : [html_out]
178+ def results_out = process.out.results[0][1]
179+ def results_size = results_out instanceof List ? results_out.size() : file(results_out).list().size()
86180 assertAll(
87181 { assert process.success },
88182 { assert snapshot(
89- process.out.results[0][1].size() ,
90- file(process.out. html[0][1] ).name,
183+ results_size ,
184+ htmls.collect{ html -> file(html).name }.sort() ,
91185 process.out.txt[0][1].size(),
92186 process.out.findAll { key, val -> key.startsWith("versions")}
93187 ).match() },
0 commit comments