nextflow-io / nextflow-io/nextflow

docs on using closure for `path` param in publishDir

Open
#6,048 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

lang/config stale
Dominant language
Groovy
Stars
3.5k
Forks
811
Avg merge
2d 11h
Merged PRs (30d)
61

Description

New feature

The publishDir docs do not state that a closure is needed for the path parameter if a nextflow parameter is used.

My case:

profiles {
    dev {
        params {
            outdir_prefix     = 'tmp/results'
        }
}

process{
    withName: 'STAR_map' {
        publishDir = [
            mode: 'copy',
            overwrite: true,
            path: { params.outdir_prefix },
            pattern: '*'
        ]
    }
}

Without the closure ({ params.outdir_prefix }), I get the error:

Target path for directive publishDir cannot be null

It took quite a bit of time to figure out that a closure is needed.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the publishDir documentation section linked in the issue and review the provided configuration example showing params.outdir_prefix. Update the documentation to explain when the path parameter requires a closure, using the reported null-target-path behavior as context; done means users can find this guidance there.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.