Skip to content

Commit af9a94e

Browse files
committed
Fix random seed by default and change test data
Use small cov2 readset for testing, set genome size very low to allow subsampling
1 parent 1407e31 commit af9a94e

File tree

3 files changed

+49
-18
lines changed

3 files changed

+49
-18
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ process AUTOCYCLER_SUBSAMPLE {
2222
script:
2323
def args = task.ext.args ?: ''
2424
prefix = task.ext.prefix ?: "${meta.id}"
25+
// fix random seed for reproducibility if not specified in command line
26+
if (!(args ==~ /.*--seed.*/)) {args += " --seed 42"}
2527
"""
2628
autocycler subsample \\
2729
$args \\

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

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ nextflow_process {
33
name "Test Process AUTOCYCLER_SUBSAMPLE"
44
script "../main.nf"
55
process "AUTOCYCLER_SUBSAMPLE"
6-
config "./nextflow.config"
76

87
tag "modules"
98
tag "modules_nfcore"
@@ -13,16 +12,13 @@ nextflow_process {
1312
test("Pseudomonas_fluorescens - fastq_gz") {
1413

1514
when {
16-
params{
17-
module_args = '--seed 1234'
18-
}
1915
process {
2016
"""
2117
input[0] = [
2218
[ id:'test', single_end:false ], // meta map
23-
file('https://github.com/nf-core/test-datasets/raw/refs/heads/bacass/nanopore/subset15000.fq.gz', checkIfExists: true), // reads
19+
file(params.modules_testdata_base_path + 'genomics/sarscov2/nanopore/fastq/test.fastq.gz', checkIfExists: true), // reads
2420
]
25-
input[1] = 30000 // genome size
21+
input[1] = 300 // set genome size very small to get sufficient depth
2622
"""
2723
}
2824
}
@@ -41,9 +37,6 @@ nextflow_process {
4137
options "-stub"
4238

4339
when {
44-
params{
45-
module_args = ''
46-
}
4740
process {
4841
"""
4942
input[0] = [
@@ -58,6 +51,7 @@ nextflow_process {
5851
then {
5952
assertAll(
6053
{ assert process.success },
54+
{ assert snapshot(process.out).match() }
6155
)
6256
}
6357

modules/nf-core/autocycler/subsample/tests/main.nf.test.snap

Lines changed: 44 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
"single_end": false
1010
},
1111
[
12-
"sample_01.fastq.gz:md5,b1cc8c9ee163474d67d7889e25e4e0ae",
13-
"sample_02.fastq.gz:md5,c3124b6b062158d41e822a9ff16df988",
14-
"sample_03.fastq.gz:md5,3f2db5a32a4a0cfdbb5a58b5a81f3a92",
15-
"sample_04.fastq.gz:md5,28c99f7e4565924229a980500c185802"
12+
"sample_01.fastq.gz:md5,7a9ac52d5071893300808fc11091bdbb",
13+
"sample_02.fastq.gz:md5,e1e73dc1f31aa8b30834286d13ab500a",
14+
"sample_03.fastq.gz:md5,e5cead9b5bbdf541062423065a5b6f51",
15+
"sample_04.fastq.gz:md5,312cb2589411da99ecfd50392e999cdc"
1616
]
1717
]
1818
],
@@ -26,10 +26,10 @@
2626
"single_end": false
2727
},
2828
[
29-
"sample_01.fastq.gz:md5,b1cc8c9ee163474d67d7889e25e4e0ae",
30-
"sample_02.fastq.gz:md5,c3124b6b062158d41e822a9ff16df988",
31-
"sample_03.fastq.gz:md5,3f2db5a32a4a0cfdbb5a58b5a81f3a92",
32-
"sample_04.fastq.gz:md5,28c99f7e4565924229a980500c185802"
29+
"sample_01.fastq.gz:md5,7a9ac52d5071893300808fc11091bdbb",
30+
"sample_02.fastq.gz:md5,e1e73dc1f31aa8b30834286d13ab500a",
31+
"sample_03.fastq.gz:md5,e5cead9b5bbdf541062423065a5b6f51",
32+
"sample_04.fastq.gz:md5,312cb2589411da99ecfd50392e999cdc"
3333
]
3434
]
3535
],
@@ -42,6 +42,41 @@
4242
"nf-test": "0.9.2",
4343
"nextflow": "25.04.4"
4444
},
45-
"timestamp": "2025-10-27T17:18:38.77396493"
45+
"timestamp": "2025-10-29T08:36:17.505206711"
46+
},
47+
"Pseudomonas_fluorescens - fastq_gz - stub": {
48+
"content": [
49+
{
50+
"0": [
51+
[
52+
{
53+
"id": "test",
54+
"single_end": false
55+
},
56+
"sample_00.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
57+
]
58+
],
59+
"1": [
60+
"versions.yml:md5,0abfe90f7bd1d54716b236993073b514"
61+
],
62+
"subsampled_reads": [
63+
[
64+
{
65+
"id": "test",
66+
"single_end": false
67+
},
68+
"sample_00.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
69+
]
70+
],
71+
"versions": [
72+
"versions.yml:md5,0abfe90f7bd1d54716b236993073b514"
73+
]
74+
}
75+
],
76+
"meta": {
77+
"nf-test": "0.9.2",
78+
"nextflow": "25.04.4"
79+
},
80+
"timestamp": "2025-10-29T08:07:36.406154106"
4681
}
4782
}

0 commit comments

Comments
 (0)