Use `methods.setup_process_afterscript()` for process logs
nwiltsie opened this issue · 0 comments
We should incorporate the new methods.setup_process_afterscript()
from uclahs-cds/pipeline-Nextflow-config#64 into this pipeline.
Under the new method, log files are automatically saved to ${params.log_output_dir}/process-log/${task.ext.log_dir}${task.ext.log_dir_suffix}/
(no need to specify a publishDir
directive).
${task.ext.log_dir}
defaults to ${task.process.replace(':', '/')}
.
${task.ext.log_dir_suffix}
defaults to a blank string.
The key steps are:
- Add
methods.setup_process_afterscript()
tomethods.setup()
. - For each Nextflow process:
- Remove the
file ".command.*"
output
directive. - Add
ext log_dir { ... }
andext log_sur_suffix { ... }
directives, if appropriate. - Remove the
publishDir
directive withpattern: ".command.*"
.
- Remove the
This pipeline does some atypical configuration with params.workflow_log_output_dir
, but that can still be handled with ext log_dir
:
Current
Lines 74 to 76 in 772592a
pipeline-call-sSNV/module/somaticsniper-processes.nf
Lines 18 to 21 in 772592a
Updated
- publishDir path: "${params.workflow_log_output_dir}",
- mode: "copy",
- pattern: ".command.*",
- saveAs: { "${task.process.split(':')[-1]}/log${file(it).getName()}" }
+ ext log_dir { "SomaticSniper-${params.somaticsniper_version}/${task.process.split(':')[-1]}" }
See https://github.com/uclahs-cds/pipeline-recalibrate-BAM/pull/76/files for a full example.