When defining multiple publishDir directives with different patterns in the configuration, files are not being published to their respective directories as expected. Instead, Nextflow considers only the last publishDir defined, leading to unintended behavior. This issue affects scenarios where multiple patterns are specified for different publish directories, and the desired outcome is for files to be correctly published according to their respective patterns and directories.
To address this issue, consider restructuring the publishDir definitions as nested lists within a single publishDir directive. This can be achieved by encapsulating each set of parameters for a specific directory as a nested list. Below is an example of how to modify the code:
When defining multiple publishDir directives with different patterns in the configuration, files are not being published to their respective directories as expected. Instead, Nextflow considers only the last publishDir defined, leading to unintended behavior. This issue affects scenarios where multiple patterns are specified for different publish directories, and the desired outcome is for files to be correctly published according to their respective patterns and directories.
Example of the old code block in the config:
Solution:
To address this issue, consider restructuring the publishDir definitions as nested lists within a single publishDir directive. This can be achieved by encapsulating each set of parameters for a specific directory as a nested list. Below is an example of how to modify the code: