From a27d714c5cf61dfd36ec73c003972ec91809fbad Mon Sep 17 00:00:00 2001
From: Emmanuel Labaronne <emmanuel.labaronne@ens-lyon.fr>
Date: Fri, 25 Sep 2020 11:21:00 +0200
Subject: [PATCH] src/RNAseq.nf : add multiqc module

---
 src/RNAseq.config |  4 ++++
 src/RNAseq.nf     | 34 ++++++++++++++++++++++++++++++++--
 2 files changed, 36 insertions(+), 2 deletions(-)

diff --git a/src/RNAseq.config b/src/RNAseq.config
index c8f39d48..d15b85fd 100644
--- a/src/RNAseq.config
+++ b/src/RNAseq.config
@@ -104,6 +104,10 @@ profiles {
         container = "lbmc/htseq:0.11.2"
         cpus = 1
       }
+      withName: multiqc {
+        container = "ewels/multiqc:1.9"
+        cpus = 1
+      }
     }
   }
 }
diff --git a/src/RNAseq.nf b/src/RNAseq.nf
index 8022c44a..e96e2fe5 100644
--- a/src/RNAseq.nf
+++ b/src/RNAseq.nf
@@ -45,7 +45,7 @@ process fastqc_raw {
   set file_id, file(reads) from INPUT_FASTQC_RAW
 
   output:
-  set file_id, "*.{html,zip}" into OUTPUT_FASTQC_RAW
+  file "*_fastqc.{html,zip}" into OUTPUT_FASTQC_RAW
 
   when:
   params.do_fastqc
@@ -104,7 +104,7 @@ process fastqc_cut {
   set file_id, file(reads) from CUTADAPT_OUTPUT_FASTQC
 
   output:
-  set file_id, "*.{html,zip}" into OUTPUT_FASTQC_CUT
+  file "*.{html,zip}" into OUTPUT_FASTQC_CUT
 
   when:
   params.do_fastqc
@@ -265,6 +265,9 @@ if (! params.do_dedup) {
   HISAT_ALIGNED_DEDUP.into{DEDUP_GENOME}
 }
 
+
+
+
 /*                   HTseq
 
 process sort_bam {
@@ -349,3 +352,30 @@ bash ${script} -b ${bam} \
 """
 }
 */
+
+/* MultiQC */
+
+
+process multiqc {
+  tag "multiqc"
+  publishDir "${params.output}/multiqc", mode: 'copy'
+
+  input:
+  file ('fastqc/*') from OUTPUT_FASTQC_RAW.collect().ifEmpty([])
+  file ('*') from CUTADAPT_LOG.collect().ifEmpty([])
+  file ('fastqc/*') from OUTPUT_FASTQC_CUT.collect().ifEmpty([])
+  file ('*') from FILTER_LOG.collect().ifEmpty([])
+  file ('fastqc/*') from OUTPUT_FASTQC_FILTER.collect().ifEmpty([])
+  file ('*') from HISAT_LOG.collect().ifEmpty([])
+  file ('fastqc/*') from OUTPUT_FASTQC_GENOME.collect().ifEmpty([])
+
+
+  output:
+  file "multiqc_report.html" into multiqc_report
+  file "multiqc_data"
+
+  script:
+"""
+multiqc ./
+"""
+}
-- 
GitLab