Skip to content
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

New config option: publishDir.basePath #3805

Closed
ewels opened this issue Mar 28, 2023 · 8 comments
Closed

New config option: publishDir.basePath #3805

ewels opened this issue Mar 28, 2023 · 8 comments
Labels

Comments

@ewels
Copy link
Member

ewels commented Mar 28, 2023

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

@bentsherman
Copy link
Member

Related to #2661

@stale

This comment was marked as outdated.

@stale stale bot added the stale label Sep 17, 2023
@ewels ewels removed the stale label Sep 17, 2023
@pditommaso
Copy link
Member

This has been solved by #3942. In a nutshell, relative paths are resolved against the path specified via NXF_FILE_ROOT env variable.

@ewels
Copy link
Member Author

ewels commented Sep 17, 2023

There's no way to set this from within the workflow though, right? We need to be able to set this with params.outdir in nf-core workflows.

@pditommaso
Copy link
Member

This may be a good candidate for nextflow.defaults planned setting #4186. Tho it should be verified if it's feasible.

@ewels
Copy link
Member Author

ewels commented Sep 17, 2023

Yeah, it's to prefix rather than overwrite 🤔

Copy link

stale bot commented Mar 17, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Mar 17, 2024
@bentsherman
Copy link
Member

This should be addressed by the workflow outputs DSL #4784 which removes the need to specify the base publish path many times

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants