How To Specify a Different publishDir
for Each Execution of a Process
#4358
Unanswered
jeffquinn-msk
asked this question in
Q&A
Replies: 2 comments 1 reply
-
You can either make the output file name different in each task execution (e.g. based on the task index or provide a custom id), or use the |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks for the quick response. So something like this would be a reasonable approach?
Resulting in:
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
This question is best asked via illustrative example. Assume this situation where we have process
CREATE_FILE
which creates an output file, a subworkflow that takes a single input, a number which is written to the file inCREATE_FILE
, and a top level workflow which callsSUBWORKFLOW
with a channel of numbers as input:The problem with this is:
publishDir
is constant with respect to the iteration through the channel, so each subsequent iteration clobbers the output from the previous iteration. The obvious solution would be to make thepublishDir
dynamic with respect to the iteration, but I cannot for the life of me figure out what the best mechanism is to do this. Please advise.Thanks,
Jeff
Beta Was this translation helpful? Give feedback.
All reactions