nextflow icon indicating copy to clipboard operation
nextflow copied to clipboard

Request to enable dynamic `cache` directive

Open robsyme opened this issue 1 month ago • 10 comments

New feature

It would be helpful to be able to set the cache directive via a closure.

Usage scenario

It would be sometimes helpful to force a re-run of a specific task (in cases where the outputs are corrupted, for example). For users that don't have access to the run workdir, it would be helpful to set the following configuration:

process {
  withName: MyProcess {
    cache = { task.tag != "mytag" }
  }
}

At the moment, this closure is not evaluated, and is simply compared directly do the available options, and we get the warning:

WARN: Unknown cache mode: Script_a35edbdc3426f6a0$_runScript_closure2$_closure5@30922f8d

Suggest implementation

Something in ProcessConfig, I suppose :D

robsyme avatar May 22 '24 19:05 robsyme