Conversation
6 documentation files (zero publishDir references remain):
- docs/en/docs/side_quests/essential_scripting_patterns.md - Removed publishDir from GENERATE_REPORT code block
- docs/en/docs/side_quests/metadata.md - Removed publishDir from COWPY code block
- docs/en/docs/side_quests/dev_environment.md - Removed publishDir from FASTQC code block, changed search example from
publishDir to container
- docs/en/docs/side_quests/debugging.md - Removed publishDir from all 3 processes in corrected workflow, added
publish:/output {} blocks
- docs/en/docs/side_quests/nf-test.md - Removed publishDir from both processes, added publish:/output {} blocks
- docs/en/docs/side_quests/working_with_files.md - Rewrote section 6 to use output {} block pattern; updated process output
to emit full meta; updated sections 6.1, 6.2.2, 6.4, Takeaway, and Summary
~25 script files (zero publishDir references remain):
- workflows_of_workflows: 6 module files (removed publishDir), 1 main.nf (added publish/output)
- essential_scripting_patterns: 2 module files (removed publishDir), 1 main.nf (added publish/output)
- metadata: 3 module files (removed publishDir), 2 main.nf files (added publish/output)
- ide_features: 5 script files (removed publishDir from all, added publish/output to both workflow files)
- debugging: 2 workflow files (removed publishDir, added publish/output)
- nf-test: 1 main.nf (removed publishDir, added publish/output)
- working_with_files: 2 module files (removed publishDir, changed output to emit full meta), 1 main.nf (added publish/output
with dynamic path closure)
✅ Deploy Preview for nextflow-training ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Nextflow linting complete! ✅ 175 files had no errors View formatting changes
|
| The `tag` directive uses closure syntax (`{ ... }`) because it references input variables (`meta`) that aren't available until the process runs. | ||
| The closure defers evaluation until runtime. |
There was a problem hiding this comment.
Slightly off-topic -- with the v2 parser you don't need the closure here anymore, it's optional. If this guide is assuming the v2 parser, then it should be safe to remove the closure
But you might still want to have a note about the fact that the closure used to be needed
There was a problem hiding this comment.
This one is still open. The docs and module still use tag { meta.id } (closure syntax) and the docs include a note defending the closure. With the v2 parser, tag meta.id works without braces. @vdauwera - do you want to update this to drop the closure and adjust the note, or leave as-is for now?
There was a problem hiding this comment.
Whatever you think is best, I don't have a strong opinion about it. Maybe leave as is and refine later, in the interest of getting this out?
|
I think that concludes my review. Main two points are:
Aside from that, I left some extra thoughts about best practices. Feel free to take them or leave them Hopefully you can just throw my general suggestions into a spec and let the AI update all of the code examples for you 😄 |
Thanks @bentsherman, this is super helpful! |
Move directory/mode from output {} blocks to nextflow.config files,
declare all published outputs in output {} blocks, use variable
assignments instead of .out in publish blocks, and use tuple()/
assignment over []/.set {} for type-checker compatibility.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The publish: block added by this PR requires a main: label in the workflow block. Without it, the workflow body is not recognized. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…l_lines Section 4.2 Before/After blocks showed cpus values (4:2) that were never introduced in section 4.1 (which set 2:1). Aligned all section 4.2 blocks to use the same 2:1 values. Also fixed the docker command example (--cpu-shares 4096 -> 2048) and OOM output (--thread 2 -> 1) to match, and corrected an off-by-one hl_lines attribute on the FASTP script fix. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Added main: label to starter main.nf and all docs code blocks showing
the workflow body. Added publish:/output {} blocks to the docs code
blocks in sections 3.2.3 and 3.3.3 so cowpy outputs land in results/.
Also fixed the Before block in 3.2.3 to match the actual After from
3.2.2 (was showing different code than the learner would have).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Split the old section 3.2.3 into two steps: 3.2.3 sets up the
publish:/output {} blocks with a channel.empty() placeholder, and
3.2.4 adds the actual COWPY call and wires up the real output. This
keeps the output mechanism distinct from the main teaching point
(calling a process with meta map data).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Instead of a dedicated sub-step to add the output mechanism, the starter
main.nf now ships with main:, publish: (using channel.empty() placeholder),
and output {} already in place. Learners just update the publish target
from channel.empty() to COWPY.out when they call the process, mirroring
how publishDir was previously baked into the module.
Also trimmed sections 1.1-1.2 code blocks to show only the main: body,
avoiding boilerplate that would distract from the teaching points.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1. Essential Scripting Patterns
2. Metadata
Scripts: Removed publishDir from modules/cowpy.nf in starter, solution/3.2, and solution/3.3. Added publish:/output {} to both solution main.nf files, publishing to results/.
Docs: Removed publishDir line from the COWPY process code block. No narrative changes needed.
3. Dev Environment + IDE Features
Scripts: Removed publishDir from basic_workflow.nf, modules/fastqc.nf, modules/star.nf, modules/utils.nf (MULTIQC and CUSTOM_DUMPSOFTWAREVERSIONS), and complex_workflow.nf (TRIM_GALORE and FEATURECOUNTS). Added publish:/output {} to both basic_workflow.nf and complex_workflow.nf. Added fastqc, trimmed, and alignments to the RNASEQ_PIPELINE named workflow's emit: section so the entry workflow can publish them.
Docs: Removed publishDir from the "Before" code block showing the inline FASTQC process. Changed the project-wide search example from searching for publishDir to searching for container.
4. Debugging
Scripts: Removed publishDir from all three processes in both buggy_workflow.nf (starter with bugs intact) and solutions/buggy_workflow.nf. Added publish:/output {} to both, publishing to processed/, heavy/, and files/ subdirectories under params.output.
Docs: Updated the "Complete Corrected Workflow" solution code block to match: removed publishDir from all three processes, added publish:/output {} blocks.
5. nf-test
Scripts: Removed publishDir from both sayHello and convertToUpper processes. Added publish:/output {} publishing to results/. Test assertions checking $launchDir/results/ are unchanged since the output directory is still results/.
Docs: Updated the expandable workflow code block to match. No changes to test assertion code or prose about "published to a directory called results/".
6. Workflows of Workflows
7. Working with Files
Scripts: Removed publishDir from modules/analyze_reads.nf (starter and solution). Changed process output from val(meta.id) to val(meta) so the output block can use metadata for dynamic paths. Added publish:/output {} to solution main.nf with a path closure: { meta, file -> "${meta.type}/${meta.id}/${meta.replicate}" }.
Docs (most extensive changes):