From f5691c89c3670e6b93efda70113209300945e504 Mon Sep 17 00:00:00 2001
From: Laurent Modolo <laurent.modolo@ens-lyon.fr>
Date: Thu, 15 Apr 2021 11:04:25 +0200
Subject: [PATCH] picard: add publishDir option

---
 src/nf_modules/picard/main.nf | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/nf_modules/picard/main.nf b/src/nf_modules/picard/main.nf
index ec8572ac..0d385805 100644
--- a/src/nf_modules/picard/main.nf
+++ b/src/nf_modules/picard/main.nf
@@ -2,10 +2,14 @@ version = "2.18.11"
 container_url = "lbmc/picard:${version}"
 
 params.mark_duplicate = "VALIDATION_STRINGENCY=LENIENT REMOVE_DUPLICATES=true"
+params.mark_duplicate_out = ""
 process mark_duplicate {
   container = "${container_url}"
   label "big_mem_mono_cpus"
   tag "$file_id"
+  if (params.mark_duplicate_out != "") {
+    publishDir "results/${params.mark_duplicate_out}", mode: 'copy'
+  }
 
   input:
     tuple val(file_id), path(bam)
@@ -26,10 +30,14 @@ PicardCommandLine MarkDuplicates \
 }
 
 params.index_fasta = ""
+params.index_fasta_out = ""
 process index_fasta {
   container = "${container_url}"
   label "big_mem_mono_cpus"
   tag "$file_id"
+  if (params.index_fasta_out != "") {
+    publishDir "results/${params.index_fasta_out}", mode: 'copy'
+  }
 
   input:
     tuple val(file_id), path(fasta)
@@ -46,10 +54,14 @@ PicardCommandLine CreateSequenceDictionary \
 }
 
 params.index_bam = ""
+params.index_bam_out = ""
 process index_bam {
   container = "${container_url}"
   label "big_mem_mono_cpus"
   tag "$file_id"
+  if (params.index_bam_out != "") {
+    publishDir "results/${params.index_bam_out}", mode: 'copy'
+  }
 
   input:
     tuple val(file_id), path(bam)
-- 
GitLab