Skip to content

New config option: publishDir.basePath #3805

@ewels

Description

@ewels

New feature

In @nf-core we prefix every publishDir path with params.outdir. For example, to modify the example in the docs:

publishDir "${params.outdir}/data/chunks"

Without this, Nextflow will spit published results into the launch directory, which I think is generally agreed to be a bad idea in most cases (overwriting / ephemeral storage). But to follow best practices of not doing this, the pipeline code needs this arbitrary variable interpolation.

It would be nice to have a new config attribute for publishDir called something like basePath, which would default to the launch directory (existing behaviour) but if set, works for the entire pipeline run.

This would remove quite a lot of boilerplate code and make it easier for people working with non-nf-core pipelines which don't use this convention.

Could also have this as a command-line flag to easily change at run time, similar to -work-dir (-publish-dir?)

Suggest implementation

  • Config: publishDir.basePath
  • Command line: -publish-dir

If provided, prefix this string to the path in PublishDir.groovy

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions