-
Notifications
You must be signed in to change notification settings - Fork 254
Update Hello Nextflow training to use new output syntax (Nextflow 25.10.0) #685
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…10.0)
This commit modernizes the Hello Nextflow training materials to teach the new
`publish:` and `output {}` syntax introduced in Nextflow 24.04+ and finalized
in 25.10.0, while maintaining context about the legacy `publishDir` directive.
## Changes
### Documentation (6 files)
- Updated all English lesson files to teach workflow outputs as primary approach
- Added new section explaining workflow outputs vs legacy publishDir
- Updated all version strings from 25.04.3 to 25.10.0 (34 occurrences)
- Fixed output path from `path 'results'` to `path '.'` to avoid nested directories
- Corrected default publish mode documentation (symlinks, not copies)
### Example Scripts (3 files)
- Migrated hello-world.nf, hello-channels.nf, hello-workflow.nf
- Added `publish:` sections to workflows
- Added `output {}` blocks with correct path syntax
- Removed all `publishDir` directives from processes
### Solution Files (14 workflow + 5 module files)
- Updated all solution workflows to use new output syntax
- Removed `publishDir` from all module files
- Ensured all solutions follow modern Nextflow patterns
### Devcontainer Configs (3 files)
- Updated NXF_VER from 25.04.3 to 25.10.0 in all devcontainer configs
- Ensures consistent Nextflow version across development environments
## Testing
- ✅ Tested hello-world.nf: outputs published correctly
- ✅ Tested hello-channels.nf: single greeting published
- ✅ Tested hello-workflow.nf: multiple outputs published correctly
- All tests passed with Nextflow 25.10.0
## Benefits
- Students learn modern Nextflow syntax first
- Clear migration path shown from legacy to new syntax
- Centralized output management at workflow level
- Aligned with Nextflow's future direction
- All examples tested and verified working
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
✅ Deploy Preview for nextflow-training ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Section 4.1.3 was showing sayHello() without assigning to ch_output, which was inconsistent with the workflow outputs pattern taught in section 3.1. Updated both 'After' and 'Before' code blocks to include ch_output assignment for consistency. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Updated code examples to consistently show ch_output assignment when calling sayHello(), maintaining consistency with the pattern taught in lesson 01 section 3.1. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Enhanced the explanation in section 1.6 to clearly explain WHY we switch from using sayHello.out notation to named channel assignments (ch_hello, ch_upper). This helps students understand that named channels are needed for the publish section and are generally cleaner when working with workflow outputs. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Updated hello-modules-4.nf and hello-containers-2.nf to use consistent
workflow patterns:
- Changed from .out notation to named channel assignments
- Added publish: and output {} blocks
- Ensures all solution files follow the same pattern as teaching materials
Tested: hello-modules-4.nf runs successfully and publishes outputs correctly
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
Added main: sections to all workflows that have publish: blocks to comply with Nextflow linter requirements. This affects: - Documentation examples in 01_hello_world.md and 03_hello_workflow.md - Main example scripts: hello-channels.nf, hello-workflow.nf - All solution files in 1-hello-world, 2-hello-channels, 3-hello-workflow, 4-hello-modules, and 5-hello-containers directories The hello-world.nf starter file remains unchanged as it represents the initial state before students add publishing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Reframed the publishDir explanation to introduce it as legacy syntax that readers will encounter when working with existing pipelines, rather than assuming prior knowledge. The new structure: 1. Introduces publishDir as the older approach 2. Shows code example and explains what it does 3. Contrasts with modern workflow outputs approach 4. Emphasizes importance of understanding both for legacy code This helps learners understand publishDir when they encounter it in existing Nextflow pipelines and nf-core modules. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
…riables Remove intermediate variables (ch_output, ch_hello, ch_upper, ch_collected) across all Hello Nextflow parts (1-6) for consistency and cleaner code. Changes by part: Part 1 (Hello World): - Remove ch_output intermediate variable from solutions - Use direct .out syntax: greetings = sayHello.out - Add note about workflow.output.mode = 'copy' configuration Part 2 (Hello Channels): - Fix documentation showing incorrect ch_output usage - Add missing main: sections to code examples - Remove intermediate variables from all 4 solution files - Replace $it with explicit variable names per docs guidance - Clean up leftover greetings_array variable Part 3 (Hello Workflow): - Fix incorrect documentation explanation about intermediate variables - Remove ch_hello, ch_upper, ch_collected from all solutions - Use .out syntax: sayHello.out, convertToUpper.out, collectGreetings.out - Use named outputs: collectGreetings.out.outfile, collectGreetings.out.count - Update hello-modules.nf starter to match Part 3 final state Part 4 (Hello Modules): - Remove intermediate variables from all 3 solution files - Use consistent .out syntax throughout Part 5 (Hello Containers): - Remove intermediate variables including ch_cowpy - Use .out syntax: cowpy.out Part 6 (Hello Config): - No workflow code changes needed (config-only) Unified approach: - Processes called without assignment: sayHello(greeting_ch) - Direct .out usage in publish: processName.out - Named outputs: processName.out.name - Consistent main: and publish: structure - Modern workflow outputs (no publishDir in starters) Fixes consistency issues across 22 files (3 docs, 19 code files) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Add missing publish: blocks to code examples in sections 2.3.1, 2.4.1, 2.4.2, 3.2.2, and 4.2 that were previously showing incomplete workflow code (ending with }). Section 4.2 changes: - Update heading: "Report the output and update publishing" - Add explanation about updating publish block with named output - Highlight line 10 (collected = collectGreetings.out.outfile) - Shows progression from publishing just greetings/uppercase to including the collected output using the named output syntax All code examples now consistently show the full workflow structure with main: and publish: sections throughout the progression. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Update section 0 (Warmup): - Show complete initial config file with both docker.enabled and workflow.output.mode settings - Add explanation of workflow.output.mode: 'copy' vs 'symlink' - Make connection to Part 5 (docker) and publishing covered in Part 1 Update section 1.1: - Include workflow.output.mode in both Before/After config examples - Maintains consistency as students modify config throughout tutorial This completes the loop: - Part 1: Mentions workflow.output.mode is configured (forward reference) - Part 6: Shows and explains the actual config setting 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
|
|
||
| output { | ||
| greetings { | ||
| path '.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question -- My understanding is that you can just leave the curly braces empty (ie greetings { } ) unless you wanted to override or customize the output location, is that correct? If so, are you specifying path '.' to show explicitly how one would write the path to modify the location?
Asking because I'm trying to decide what to do for the nf4science template; and unless there's a reason to do otherwise I'd like that to be consistent with how we teach it in Hello.
Summary
This PR modernizes the Hello Nextflow training materials to teach the new
publish:andoutput {}syntax (finalized in Nextflow 25.10.0) as the primary approach, while maintaining context about the legacypublishDirdirective.Changes Overview
📚 Documentation Updates (6 English lesson files)
publish:andoutput {}as the primary methodpublishDirfor understanding existing codebasespath 'results'topath '.'to avoid nested directories🔧 Example Scripts (3 files)
hello-world.nf,hello-channels.nf,hello-workflow.nfto new syntaxpublish:sections andoutput {}blockspublishDirdirectives✅ Solution Files (19 files total)
publishDirdirectives removed🐳 Devcontainer Configs (3 files)
NXF_VERto25.10.0across all environmentsTesting
All example scripts have been tested and verified working:
Benefits
Files Modified
Total: 31 files modified
Breaking Changes
None - this only affects training materials, not production code.
Related Documentation
🤖 Generated with Claude Code