You need to store the outputs of a process to a directory giving files a name of your choice.
The publishDir allows you to store the process outputs in a directory of your choice.
Specify the saveAs
parameter to give each file a name of your choice proving
a custom rule as a closure.
process foo {
publishDir 'results', saveAs: { filename -> "foo_$filename" }
output:
file '*.txt'
'''
touch this.txt
touch that.txt
'''
}
The same pattern can be used to store specific files in separate directories depending the actual name.
process foo {
publishDir 'results', saveAs: { filename -> filename.endsWith(".zip") ? "zips/$filename" : filename }
output:
file '*'
'''
touch this.txt
touch that.zip
'''
}
Tip
|
Relative paths are resolved against the publishDir store path. Use an absolute path
to store files in a directory outside the publishDir store path.
|