Skip to content

Feature request: Allow introspection of workflow.output parameters #6514

@dvg-p4

Description

@dvg-p4

New feature

Allow introspecting the workflow.output.* parameters within the workflow itself

Use case

This would allow mainly allow printing info messages to the user and conditionally checking validity of output paths and modes, e.g.:

if (workflow.output.enabled) {
   if (file(workflow.outputDir).exists()) {
     if (params.clobber) {
       log.warn "Overwriting existing output" 
     } else {
       error "${workflow.outputDir} already exists, use clobber = true to overwrite"
     }
  }
  log.info "${workflow.output.mode}ing output files to ${workflow.outputDir}"
} else {
  log.info "Leaving output in nextflow workDir ${workflow.workDir}"
}

Suggested implementation

Add the config options for workflow.output to the workflow metadata object accessible within the workflow itself, as sketched out above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions