Skip to content

Commit 2e0ae2f

Browse files
EladH1claudepinin4fjords
authored
feat(subworkflows/fastq_qc_trim_filter_setstrandedness): emit reads_raw, reads_pre_bbsplit (#12103)
* feat(subworkflows/fastq_qc_trim_filter_setstrandedness): emit reads_raw and reads_pre_bbsplit channel snapshots Add two new emit channels for pipelines that need reads at different preprocessing stages: - reads_raw: snapshot of reads before adapter trimming (useful for contaminant screening comparison at the raw-read stage) - reads_pre_bbsplit: snapshot after trimming but before BBSplit/rRNA removal Both channels are zero-cost aliases (no copying or re-processing) and do not affect any existing outputs or behavior. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Update subworkflows/nf-core/fastq_qc_trim_filter_setstrandedness/main.nf Co-authored-by: Jonathan Manning <pininforthefjords@gmail.com> * Update subworkflows/nf-core/fastq_qc_trim_filter_setstrandedness/main.nf Co-authored-by: Jonathan Manning <pininforthefjords@gmail.com> * Update subworkflows/nf-core/fastq_qc_trim_filter_setstrandedness/main.nf Co-authored-by: Jonathan Manning <pininforthefjords@gmail.com> * Update subworkflows/nf-core/fastq_qc_trim_filter_setstrandedness/meta.yml Co-authored-by: Jonathan Manning <pininforthefjords@gmail.com> * Update subworkflows/nf-core/fastq_qc_trim_filter_setstrandedness/meta.yml Co-authored-by: Jonathan Manning <pininforthefjords@gmail.com> * feat(subworkflows/fastq_qc_trim_filter_setstrandedness): emit reads_raw and reads_pre_bbsplit channel snapshots Rename outputs to match per-stage naming convention: - reads_raw -> reads_cat (snapshot after CAT_FASTQ, before trimming) - reads_pre_bbsplit -> reads_trimmed (snapshot after trimming, before BBSplit/rRNA removal) Add intermediate_reads snapshot assertions to all 5 test cases using the linesGzip/md5 pattern, with unique per-test snapshot IDs to avoid collisions. Regenerate snapshots. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: Jonathan Manning <pininforthefjords@gmail.com>
1 parent 429d56a commit 2e0ae2f

4 files changed

Lines changed: 237 additions & 18 deletions

File tree

subworkflows/nf-core/fastq_qc_trim_filter_setstrandedness/main.nf

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,8 @@ workflow FASTQ_QC_TRIM_FILTER_SETSTRANDEDNESS {
189189
ch_filtered_reads = ch_filtered_reads.join(FQ_LINT.out.lint.map { meta, _lint -> meta })
190190
}
191191

192+
ch_reads_cat = ch_filtered_reads
193+
192194
//
193195
// SUBWORKFLOW: Read QC, extract UMI and trim adapters with TrimGalore!
194196
//
@@ -291,6 +293,8 @@ workflow FASTQ_QC_TRIM_FILTER_SETSTRANDEDNESS {
291293
ch_filtered_reads = ch_filtered_reads.join(FQ_LINT_AFTER_TRIMMING.out.lint.map { meta, _lint -> meta })
292294
}
293295

296+
ch_reads_trimmed = ch_filtered_reads
297+
294298
//
295299
// MODULE: Remove genome contaminant reads
296300
//
@@ -426,9 +430,11 @@ workflow FASTQ_QC_TRIM_FILTER_SETSTRANDEDNESS {
426430
.map { row -> [row[0], row.drop(1).findAll { f -> f != null }.collectMany { e -> (e instanceof List) ? e : [e] }] }
427431

428432
emit:
429-
reads = ch_strand_inferred_fastq
430-
trim_read_count = ch_trim_read_count
431-
multiqc_files = ch_multiqc_files.transpose()
433+
reads = ch_strand_inferred_fastq
434+
reads_cat = ch_reads_cat
435+
reads_trimmed = ch_reads_trimmed
436+
trim_read_count = ch_trim_read_count
437+
multiqc_files = ch_multiqc_files.transpose()
432438

433439
// Individual outputs for workflow outputs
434440
lint_log_raw = ch_lint_log_raw

subworkflows/nf-core/fastq_qc_trim_filter_setstrandedness/meta.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,26 @@ output:
174174
type: file
175175
description: Preprocessed FastQ files
176176
pattern: "*.{fq,fastq},{,.gz}"
177+
- reads_cat:
178+
description: Channel snapshot of reads before adapter trimming
179+
structure:
180+
- meta:
181+
type: map
182+
description: Groovy Map containing sample information
183+
- reads:
184+
type: file
185+
description: Pre-trimming FastQ files
186+
pattern: "*.{fq,fastq},{,.gz}"
187+
- reads_trimmed:
188+
description: Channel snapshot of reads after adapter trimming but before BBSplit/rRNA removal
189+
structure:
190+
- meta:
191+
type: map
192+
description: Groovy Map containing sample information
193+
- reads:
194+
type: file
195+
description: Trimmed FastQ files prior to BBSplit/rRNA removal
196+
pattern: "*.{fq,fastq},{,.gz}"
177197
- multiqc_files:
178198
description: MultiQC-compatible output files from tools used in preprocessing
179199
structure:

subworkflows/nf-core/fastq_qc_trim_filter_setstrandedness/tests/main.nf.test

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,11 @@ nextflow_workflow {
130130
file(workflow.out.fastqc_filtered_html[0][1][1]).name,
131131
file(workflow.out.fastqc_filtered_zip[0][1][0]).name,
132132
file(workflow.out.fastqc_filtered_zip[0][1][1]).name,
133-
).match() }
133+
).match() },
134+
{ assert snapshot(
135+
workflow.out.reads_cat.collect { meta, reads -> [meta, [reads].flatten().collect { f -> path(f).linesGzip.join('\n').md5() }] },
136+
workflow.out.reads_trimmed.collect { meta, reads -> [meta, [reads].flatten().collect { f -> path(f).linesGzip.join('\n').md5() }] },
137+
).match("intermediate_reads_pe_fastp_sortmerna") }
134138
)
135139
}
136140
}
@@ -223,7 +227,11 @@ nextflow_workflow {
223227
file(workflow.out.fastqc_filtered_html[0][1][1]).name,
224228
file(workflow.out.fastqc_filtered_zip[0][1][0]).name,
225229
file(workflow.out.fastqc_filtered_zip[0][1][1]).name,
226-
).match() }
230+
).match() },
231+
{ assert snapshot(
232+
workflow.out.reads_cat.collect { meta, reads -> [meta, [reads].flatten().collect { f -> path(f).linesGzip.join('\n').md5() }] },
233+
workflow.out.reads_trimmed.collect { meta, reads -> [meta, [reads].flatten().collect { f -> path(f).linesGzip.join('\n').md5() }] },
234+
).match("intermediate_reads_pe_fastp_ribodetector") }
227235
)
228236
}
229237
}
@@ -316,7 +324,11 @@ nextflow_workflow {
316324
file(workflow.out.fastqc_filtered_html[0][1][1]).name,
317325
file(workflow.out.fastqc_filtered_zip[0][1][0]).name,
318326
file(workflow.out.fastqc_filtered_zip[0][1][1]).name,
319-
).match() }
327+
).match() },
328+
{ assert snapshot(
329+
workflow.out.reads_cat.collect { meta, reads -> [meta, [reads].flatten().collect { f -> path(f).linesGzip.join('\n').md5() }] },
330+
workflow.out.reads_trimmed.collect { meta, reads -> [meta, [reads].flatten().collect { f -> path(f).linesGzip.join('\n').md5() }] },
331+
).match("intermediate_reads_pe_trimgalore_sortmerna") }
320332
)
321333
}
322334
}
@@ -413,7 +425,11 @@ nextflow_workflow {
413425
file(workflow.out.fastqc_filtered_html[0][1][1]).name,
414426
file(workflow.out.fastqc_filtered_zip[0][1][0]).name,
415427
file(workflow.out.fastqc_filtered_zip[0][1][1]).name,
416-
).match() }
428+
).match() },
429+
{ assert snapshot(
430+
workflow.out.reads_cat.collect { meta, reads -> [meta, [reads].flatten().collect { f -> path(f).linesGzip.join('\n').md5() }] },
431+
workflow.out.reads_trimmed.collect { meta, reads -> [meta, [reads].flatten().collect { f -> path(f).linesGzip.join('\n').md5() }] },
432+
).match("intermediate_reads_pe_fastp_bowtie2") }
417433
)
418434
}
419435
}
@@ -590,7 +606,11 @@ nextflow_workflow {
590606
processed_ribo_removal_lint_report.md5(),
591607
file(workflow.out.fastqc_filtered_html[0][1]).name,
592608
file(workflow.out.fastqc_filtered_zip[0][1]).name,
593-
).match() }
609+
).match() },
610+
{ assert snapshot(
611+
workflow.out.reads_cat.collect { meta, reads -> [meta, [reads].flatten().collect { f -> path(f).linesGzip.join('\n').md5() }] },
612+
workflow.out.reads_trimmed.collect { meta, reads -> [meta, [reads].flatten().collect { f -> path(f).linesGzip.join('\n').md5() }] },
613+
).match("intermediate_reads_se_fastp_bowtie2") }
594614
)
595615
}
596616
}

subworkflows/nf-core/fastq_qc_trim_filter_setstrandedness/tests/main.nf.test.snap

Lines changed: 183 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,74 @@
11
{
2+
"intermediate_reads_pe_fastp_sortmerna": {
3+
"content": [
4+
[
5+
[
6+
{
7+
"id": "test",
8+
"single_end": false,
9+
"strandedness": "auto"
10+
},
11+
[
12+
"ffed109b6c4b5c3060502031cd0d3e34",
13+
"2d99ab920b1c5c8a662587c2c7f00b0c"
14+
]
15+
]
16+
],
17+
[
18+
[
19+
{
20+
"id": "test",
21+
"single_end": false,
22+
"strandedness": "auto"
23+
},
24+
[
25+
"6cec1ab71e8e7a3cb5a3651ccdfca4cc",
26+
"cdd8f57890d22e1feaf16847907814b4"
27+
]
28+
]
29+
]
30+
],
31+
"timestamp": "2026-06-19T16:02:55.544629327",
32+
"meta": {
33+
"nf-test": "0.9.5",
34+
"nextflow": "26.04.3"
35+
}
36+
},
37+
"intermediate_reads_pe_fastp_ribodetector": {
38+
"content": [
39+
[
40+
[
41+
{
42+
"id": "test",
43+
"single_end": false,
44+
"strandedness": "auto"
45+
},
46+
[
47+
"ffed109b6c4b5c3060502031cd0d3e34",
48+
"2d99ab920b1c5c8a662587c2c7f00b0c"
49+
]
50+
]
51+
],
52+
[
53+
[
54+
{
55+
"id": "test",
56+
"single_end": false,
57+
"strandedness": "auto"
58+
},
59+
[
60+
"6cec1ab71e8e7a3cb5a3651ccdfca4cc",
61+
"cdd8f57890d22e1feaf16847907814b4"
62+
]
63+
]
64+
]
65+
],
66+
"timestamp": "2026-06-19T16:03:10.159183083",
67+
"meta": {
68+
"nf-test": "0.9.5",
69+
"nextflow": "26.04.3"
70+
}
71+
},
272
"homo_sapiens paired-end [fastq] fastp sortmerna": {
373
"content": [
474
"427d190cd40caeff5e2bd1967a21facb",
@@ -9,11 +79,11 @@
979
"test_1_fastqc.zip",
1080
"test_2_fastqc.zip"
1181
],
82+
"timestamp": "2026-02-12T09:05:53.923664771",
1283
"meta": {
1384
"nf-test": "0.9.3",
1485
"nextflow": "25.10.3"
15-
},
16-
"timestamp": "2026-02-12T09:05:53.923664771"
86+
}
1787
},
1888
"homo_sapiens paired-end [fastq] fastp ribodetector": {
1989
"content": [
@@ -25,11 +95,11 @@
2595
"test_1_fastqc.zip",
2696
"test_2_fastqc.zip"
2797
],
98+
"timestamp": "2026-02-12T09:06:16.903127796",
2899
"meta": {
29100
"nf-test": "0.9.3",
30101
"nextflow": "25.10.3"
31-
},
32-
"timestamp": "2026-02-12T09:06:16.903127796"
102+
}
33103
},
34104
"homo_sapiens paired-end [fastq] trimgalore sortmerna": {
35105
"content": [
@@ -41,11 +111,44 @@
41111
"test_1_fastqc.zip",
42112
"test_2_fastqc.zip"
43113
],
114+
"timestamp": "2026-02-12T09:06:33.867211398",
44115
"meta": {
45116
"nf-test": "0.9.3",
46117
"nextflow": "25.10.3"
47-
},
48-
"timestamp": "2026-02-12T09:06:33.867211398"
118+
}
119+
},
120+
"intermediate_reads_se_fastp_bowtie2": {
121+
"content": [
122+
[
123+
[
124+
{
125+
"id": "test_se",
126+
"single_end": true,
127+
"strandedness": "auto"
128+
},
129+
[
130+
"ffed109b6c4b5c3060502031cd0d3e34"
131+
]
132+
]
133+
],
134+
[
135+
[
136+
{
137+
"id": "test_se",
138+
"single_end": true,
139+
"strandedness": "auto"
140+
},
141+
[
142+
"12e1b4209d11758c5b2fb7137d25b177"
143+
]
144+
]
145+
]
146+
],
147+
"timestamp": "2026-06-19T16:03:50.943448586",
148+
"meta": {
149+
"nf-test": "0.9.5",
150+
"nextflow": "26.04.3"
151+
}
49152
},
50153
"homo_sapiens paired-end [fastq] fastp bowtie2": {
51154
"content": [
@@ -57,11 +160,11 @@
57160
"test_1_fastqc.zip",
58161
"test_2_fastqc.zip"
59162
],
163+
"timestamp": "2026-02-12T09:06:51.756578633",
60164
"meta": {
61165
"nf-test": "0.9.3",
62166
"nextflow": "25.10.3"
63-
},
64-
"timestamp": "2026-02-12T09:06:51.756578633"
167+
}
65168
},
66169
"homo_sapiens single-end [fastq] fastp bowtie2": {
67170
"content": [
@@ -70,10 +173,80 @@
70173
"test_se_fastqc.html",
71174
"test_se_fastqc.zip"
72175
],
176+
"timestamp": "2026-02-12T09:07:08.160495752",
73177
"meta": {
74178
"nf-test": "0.9.3",
75179
"nextflow": "25.10.3"
76-
},
77-
"timestamp": "2026-02-12T09:07:08.160495752"
180+
}
181+
},
182+
"intermediate_reads_pe_trimgalore_sortmerna": {
183+
"content": [
184+
[
185+
[
186+
{
187+
"id": "test",
188+
"single_end": false,
189+
"strandedness": "auto"
190+
},
191+
[
192+
"ffed109b6c4b5c3060502031cd0d3e34",
193+
"2d99ab920b1c5c8a662587c2c7f00b0c"
194+
]
195+
]
196+
],
197+
[
198+
[
199+
{
200+
"id": "test",
201+
"single_end": false,
202+
"strandedness": "auto"
203+
},
204+
[
205+
"6e0e10876e08a623089186c46e76237c",
206+
"9691a013fd8fe30c816aedf9f9e32884"
207+
]
208+
]
209+
]
210+
],
211+
"timestamp": "2026-06-19T16:03:22.222307759",
212+
"meta": {
213+
"nf-test": "0.9.5",
214+
"nextflow": "26.04.3"
215+
}
216+
},
217+
"intermediate_reads_pe_fastp_bowtie2": {
218+
"content": [
219+
[
220+
[
221+
{
222+
"id": "test",
223+
"single_end": false,
224+
"strandedness": "auto"
225+
},
226+
[
227+
"ffed109b6c4b5c3060502031cd0d3e34",
228+
"2d99ab920b1c5c8a662587c2c7f00b0c"
229+
]
230+
]
231+
],
232+
[
233+
[
234+
{
235+
"id": "test",
236+
"single_end": false,
237+
"strandedness": "auto"
238+
},
239+
[
240+
"6cec1ab71e8e7a3cb5a3651ccdfca4cc",
241+
"cdd8f57890d22e1feaf16847907814b4"
242+
]
243+
]
244+
]
245+
],
246+
"timestamp": "2026-06-19T16:03:34.579973861",
247+
"meta": {
248+
"nf-test": "0.9.5",
249+
"nextflow": "26.04.3"
250+
}
78251
}
79252
}

0 commit comments

Comments
 (0)