PublishDir outside process definition #3173
-
Is it possible to define the published output of a process outside the process itself? E.g. something like this:
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
You could include the process from a module and overwrite the parameters. FIles: .
├── main.nf
└── module.nf main.nf params.publishDir="asdf"
include { p } from './module'
include { p as p2 } from './module' params(publishDir: "qwer")
def getPath(){
"foobar"
}
include { p as p3 } from './module' params(publishDir: getPath())
workflow{
p()
println p.dump()
// > ... processName=p ... publishDir:[[path:asdf]]]...
p2()
println p2.dump()
// > ... processName=p2 ... publishDir:[[path:qwer]]]...
p3()
println p3.dump()
// > ... processName=p3 ... publishDir:[[path:foobar]]]...
} module.nf process p{
publishDir params.publishDir
"""
"""
} |
Beta Was this translation helpful? Give feedback.
-
This should be the accepted answer. Way simpler process PROCESS_X {
publishDir '/process/dir'
input:
val publishDir
script:
task.publishDir = publishDir
"""
"""
}
workflow {
PROCESS_X([[path:"/argument/dir", pattern:"*.log", mode:"copy"]])
} |
Beta Was this translation helpful? Give feedback.
-
See #1540 for related discussion about making a |
Beta Was this translation helpful? Give feedback.
You could include the process from a module and overwrite the parameters.
FIles:
. ├── main.nf └── module.nf
main.nf
module.nf
Docs