Skip to content

Commit d873c67

Browse files
committed
Add autocycler module tests
1 parent 447c91c commit d873c67

File tree

12 files changed

+1556
-114
lines changed

12 files changed

+1556
-114
lines changed

modules/nf-core/autocycler/cluster/main.nf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ process AUTOCYCLER_CLUSTER {
4242
def prefix = task.ext.prefix ?: "${meta.id}"
4343
"""
4444
mkdir clustering/qc_pass/cluster_000 -p
45-
touch clustering.{newick,yaml,tsv}
46-
touch pairwise_distances.phylip
45+
touch clustering/clustering.{newick,yaml,tsv}
46+
touch clustering/pairwise_distances.phylip
4747
touch clustering/qc_pass/cluster_000/0_untrimmed.{gfa,yaml}
4848
4949
cat <<-END_VERSIONS > versions.yml

modules/nf-core/autocycler/cluster/tests/main.nf.test

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// TODO nf-core: Once you have added the required tests, please run the following command to build this file:
2-
// nf-core modules test autocycler/cluster
31
nextflow_process {
42

53
name "Test Process AUTOCYCLER_CLUSTER"
@@ -11,23 +9,29 @@ nextflow_process {
119
tag "autocycler"
1210
tag "autocycler/cluster"
1311

14-
// TODO nf-core: Change the test name preferably indicating the test-data and file-format used
15-
test("sarscov2 - bam") {
12+
test("sarscov2 - assembly - fasta") {
1613

17-
// TODO nf-core: If you are created a test for a chained module
18-
// (the module requires running more than one process to generate the required output)
19-
// add the 'setup' method here.
20-
// You can find more information about how to use a 'setup' method in the docs (https://nf-co.re/docs/contributing/modules#steps-for-creating-nf-test-for-chained-modules).
14+
setup {
15+
run("AUTOCYCLER_COMPRESS") {
16+
script "../../compress/main.nf"
17+
process {
18+
"""
19+
input[0] = [
20+
[ id:'test', single_end:false ], // meta map
21+
[
22+
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fasta/contigs.fasta', checkIfExists: true),
23+
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fasta/scaffolds.fasta', checkIfExists: true),
24+
] // assemblies
25+
]
26+
"""
27+
}
28+
}
29+
}
2130

2231
when {
2332
process {
2433
"""
25-
// TODO nf-core: define inputs of the process here. Example:
26-
27-
input[0] = [
28-
[ id:'test', single_end:false ], // meta map
29-
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true),
30-
]
34+
input[0] = AUTOCYCLER_COMPRESS.out.gfa
3135
"""
3236
}
3337
}
@@ -36,26 +40,21 @@ nextflow_process {
3640
assertAll(
3741
{ assert process.success },
3842
{ assert snapshot(process.out).match() }
39-
//TODO nf-core: Add all required assertions to verify the test output.
40-
// See https://nf-co.re/docs/contributing/tutorials/nf-test_assertions for more information and examples.
4143
)
4244
}
4345

4446
}
4547

46-
// TODO nf-core: Change the test name preferably indicating the test-data and file-format used but keep the " - stub" suffix.
47-
test("sarscov2 - bam - stub") {
48+
test("sarscov2 - assembly - fasta - stub") {
4849

4950
options "-stub"
5051

5152
when {
5253
process {
5354
"""
54-
// TODO nf-core: define inputs of the process here. Example:
55-
5655
input[0] = [
5756
[ id:'test', single_end:false ], // meta map
58-
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true),
57+
[]
5958
]
6059
"""
6160
}
@@ -65,7 +64,6 @@ nextflow_process {
6564
assertAll(
6665
{ assert process.success },
6766
{ assert snapshot(process.out).match() }
68-
//TODO nf-core: Add all required assertions to verify the test output.
6967
)
7068
}
7169

Lines changed: 276 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,276 @@
1+
{
2+
"sarscov2 - assembly - fasta - stub": {
3+
"content": [
4+
{
5+
"0": [
6+
[
7+
{
8+
"id": "test",
9+
"single_end": false
10+
},
11+
"0_untrimmed.gfa:md5,d41d8cd98f00b204e9800998ecf8427e"
12+
]
13+
],
14+
"1": [
15+
[
16+
{
17+
"id": "test",
18+
"single_end": false
19+
},
20+
"0_untrimmed.yaml:md5,d41d8cd98f00b204e9800998ecf8427e"
21+
]
22+
],
23+
"2": [
24+
[
25+
{
26+
"id": "test",
27+
"single_end": false
28+
},
29+
"clustering.newick:md5,d41d8cd98f00b204e9800998ecf8427e"
30+
]
31+
],
32+
"3": [
33+
[
34+
{
35+
"id": "test",
36+
"single_end": false
37+
},
38+
"clustering.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
39+
]
40+
],
41+
"4": [
42+
[
43+
{
44+
"id": "test",
45+
"single_end": false
46+
},
47+
"pairwise_distances.phylip:md5,d41d8cd98f00b204e9800998ecf8427e"
48+
]
49+
],
50+
"5": [
51+
[
52+
{
53+
"id": "test",
54+
"single_end": false
55+
},
56+
"clustering.yaml:md5,d41d8cd98f00b204e9800998ecf8427e"
57+
]
58+
],
59+
"6": [
60+
"versions.yml:md5,6c0bd1b1b590f56dd7fa72cc206acfe3"
61+
],
62+
"clusters": [
63+
[
64+
{
65+
"id": "test",
66+
"single_end": false
67+
},
68+
"0_untrimmed.gfa:md5,d41d8cd98f00b204e9800998ecf8427e"
69+
]
70+
],
71+
"clusterstats": [
72+
[
73+
{
74+
"id": "test",
75+
"single_end": false
76+
},
77+
"0_untrimmed.yaml:md5,d41d8cd98f00b204e9800998ecf8427e"
78+
]
79+
],
80+
"newick": [
81+
[
82+
{
83+
"id": "test",
84+
"single_end": false
85+
},
86+
"clustering.newick:md5,d41d8cd98f00b204e9800998ecf8427e"
87+
]
88+
],
89+
"pairwisedistances": [
90+
[
91+
{
92+
"id": "test",
93+
"single_end": false
94+
},
95+
"pairwise_distances.phylip:md5,d41d8cd98f00b204e9800998ecf8427e"
96+
]
97+
],
98+
"stats": [
99+
[
100+
{
101+
"id": "test",
102+
"single_end": false
103+
},
104+
"clustering.yaml:md5,d41d8cd98f00b204e9800998ecf8427e"
105+
]
106+
],
107+
"tsv": [
108+
[
109+
{
110+
"id": "test",
111+
"single_end": false
112+
},
113+
"clustering.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
114+
]
115+
],
116+
"versions": [
117+
"versions.yml:md5,6c0bd1b1b590f56dd7fa72cc206acfe3"
118+
]
119+
}
120+
],
121+
"meta": {
122+
"nf-test": "0.9.2",
123+
"nextflow": "25.04.4"
124+
},
125+
"timestamp": "2025-10-28T10:44:36.312554184"
126+
},
127+
"sarscov2 - assembly - fasta": {
128+
"content": [
129+
{
130+
"0": [
131+
[
132+
{
133+
"id": "test",
134+
"single_end": false
135+
},
136+
[
137+
"1_untrimmed.gfa:md5,73912628f3a2c2d066bc36d14c7229b9",
138+
"1_untrimmed.gfa:md5,719a197598d0f1499dccbbfe77ece24f",
139+
"1_untrimmed.gfa:md5,8313fd7f1ab97e957ed1ee4bb20b655d",
140+
"1_untrimmed.gfa:md5,6296117f3fca264d84ada14f778a23a6",
141+
"1_untrimmed.gfa:md5,224d8fe4f6350f9e3c5b69c5078e3059"
142+
]
143+
]
144+
],
145+
"1": [
146+
[
147+
{
148+
"id": "test",
149+
"single_end": false
150+
},
151+
[
152+
"1_untrimmed.yaml:md5,6ac8ce32b804e839499e95279f3945db",
153+
"1_untrimmed.yaml:md5,44c31adc6f2f2bae83bb3f90d5fe4ab1",
154+
"1_untrimmed.yaml:md5,1b7a0a5583d9ba65a87546d11019213b",
155+
"1_untrimmed.yaml:md5,2a1657662c94f7fa22f8c3eac7cd0e42",
156+
"1_untrimmed.yaml:md5,2ee32f3c9b1bd21d702665f50c86a005"
157+
]
158+
]
159+
],
160+
"2": [
161+
[
162+
{
163+
"id": "test",
164+
"single_end": false
165+
},
166+
"clustering.newick:md5,c0a4ebfeba0c1bb289be9267933a0f37"
167+
]
168+
],
169+
"3": [
170+
[
171+
{
172+
"id": "test",
173+
"single_end": false
174+
},
175+
"clustering.tsv:md5,30f7a64acefcc55a1863ff306a2901ac"
176+
]
177+
],
178+
"4": [
179+
[
180+
{
181+
"id": "test",
182+
"single_end": false
183+
},
184+
"pairwise_distances.phylip:md5,7e266e6d2b0834c802de7909521e197e"
185+
]
186+
],
187+
"5": [
188+
[
189+
{
190+
"id": "test",
191+
"single_end": false
192+
},
193+
"clustering.yaml:md5,1e48271631555f4f7a989620d0d4db8c"
194+
]
195+
],
196+
"6": [
197+
"versions.yml:md5,6c0bd1b1b590f56dd7fa72cc206acfe3"
198+
],
199+
"clusters": [
200+
[
201+
{
202+
"id": "test",
203+
"single_end": false
204+
},
205+
[
206+
"1_untrimmed.gfa:md5,73912628f3a2c2d066bc36d14c7229b9",
207+
"1_untrimmed.gfa:md5,719a197598d0f1499dccbbfe77ece24f",
208+
"1_untrimmed.gfa:md5,8313fd7f1ab97e957ed1ee4bb20b655d",
209+
"1_untrimmed.gfa:md5,6296117f3fca264d84ada14f778a23a6",
210+
"1_untrimmed.gfa:md5,224d8fe4f6350f9e3c5b69c5078e3059"
211+
]
212+
]
213+
],
214+
"clusterstats": [
215+
[
216+
{
217+
"id": "test",
218+
"single_end": false
219+
},
220+
[
221+
"1_untrimmed.yaml:md5,6ac8ce32b804e839499e95279f3945db",
222+
"1_untrimmed.yaml:md5,44c31adc6f2f2bae83bb3f90d5fe4ab1",
223+
"1_untrimmed.yaml:md5,1b7a0a5583d9ba65a87546d11019213b",
224+
"1_untrimmed.yaml:md5,2a1657662c94f7fa22f8c3eac7cd0e42",
225+
"1_untrimmed.yaml:md5,2ee32f3c9b1bd21d702665f50c86a005"
226+
]
227+
]
228+
],
229+
"newick": [
230+
[
231+
{
232+
"id": "test",
233+
"single_end": false
234+
},
235+
"clustering.newick:md5,c0a4ebfeba0c1bb289be9267933a0f37"
236+
]
237+
],
238+
"pairwisedistances": [
239+
[
240+
{
241+
"id": "test",
242+
"single_end": false
243+
},
244+
"pairwise_distances.phylip:md5,7e266e6d2b0834c802de7909521e197e"
245+
]
246+
],
247+
"stats": [
248+
[
249+
{
250+
"id": "test",
251+
"single_end": false
252+
},
253+
"clustering.yaml:md5,1e48271631555f4f7a989620d0d4db8c"
254+
]
255+
],
256+
"tsv": [
257+
[
258+
{
259+
"id": "test",
260+
"single_end": false
261+
},
262+
"clustering.tsv:md5,30f7a64acefcc55a1863ff306a2901ac"
263+
]
264+
],
265+
"versions": [
266+
"versions.yml:md5,6c0bd1b1b590f56dd7fa72cc206acfe3"
267+
]
268+
}
269+
],
270+
"meta": {
271+
"nf-test": "0.9.2",
272+
"nextflow": "25.04.4"
273+
},
274+
"timestamp": "2025-10-28T10:43:46.382913621"
275+
}
276+
}

0 commit comments

Comments
 (0)