Skip to content

Commit c973b08

Browse files
pinin4fjordsclaude
andcommitted
Move publishDir configuration details to note box
Reorganize section 1.2.2 to present benefits first, then move the default publishDir configuration details into a note box with a link to nf-core documentation. This improves readability and flow. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 21936bf commit c973b08

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

docs/hello_nf-core/04_make_module.md

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -202,28 +202,32 @@ For output publishing, nf-core pipelines centralize control at the workflow leve
202202
Currently, our `cowpy` module has `publishDir 'results', mode: 'copy'` which hardcodes the output location.
203203
In nf-core pipelines, publishing is instead configured in `conf/modules.config`.
204204

205-
The nf-core template includes a **default publishDir configuration** that applies to all processes:
206-
207-
```groovy
208-
process {
209-
publishDir = [
210-
path: { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" },
211-
mode: params.publish_dir_mode,
212-
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
213-
]
214-
}
215-
```
216-
217-
This default automatically publishes outputs to `${params.outdir}/<process_name>/` for every process.
218-
Individual processes can customize their publishing using `withName:` blocks in the same config file.
219-
220205
Benefits of this approach:
221206

222207
- **Single source of truth**: All publishing configuration lives in `modules.config`
223208
- **Useful default**: Processes work out-of-the-box without per-module configuration
224209
- **Easy customization**: Override publishing behavior in config, not in module code
225210
- **Portable modules**: Modules don't hardcode output locations
226211

212+
!!! note "Default publishDir configuration"
213+
214+
The nf-core template includes a default publishDir configuration that applies to all processes:
215+
216+
```groovy
217+
process {
218+
publishDir = [
219+
path: { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" },
220+
mode: params.publish_dir_mode,
221+
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
222+
]
223+
}
224+
```
225+
226+
This default automatically publishes outputs to `${params.outdir}/<process_name>/` for every process.
227+
Individual processes can customize their publishing using `withName:` blocks in the same config file.
228+
229+
For more details, see the [nf-core modules specifications](https://nf-co.re/docs/guidelines/components/modules).
230+
227231
#### 1.2.3. Update the module
228232

229233
Now let's update the cowpy module to use `ext.args` and remove the local `publishDir`.

0 commit comments

Comments
 (0)