From 22c5ebabae5e83ce9ac51281665ff391d8c3791c Mon Sep 17 00:00:00 2001
From: Jules Sabban <jules.sabban@inrae.fr>
Date: Wed, 6 Oct 2021 16:05:36 +0200
Subject: [PATCH 1/4] #4 Add workflow and subworflows files

---
 sub-workflows/local/core.nf   | 0
 sub-workflows/local/report.nf | 0
 workflow/techno_qc.nf         | 0
 3 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 sub-workflows/local/core.nf
 create mode 100644 sub-workflows/local/report.nf
 create mode 100644 workflow/techno_qc.nf

diff --git a/sub-workflows/local/core.nf b/sub-workflows/local/core.nf
new file mode 100644
index 0000000..e69de29
diff --git a/sub-workflows/local/report.nf b/sub-workflows/local/report.nf
new file mode 100644
index 0000000..e69de29
diff --git a/workflow/techno_qc.nf b/workflow/techno_qc.nf
new file mode 100644
index 0000000..e69de29
-- 
GitLab


From ddd762fdc579b1145b3fe7272bdff869e6a9bf3d Mon Sep 17 00:00:00 2001
From: ckuchly <ckuchly@TLS-GPS-INF403.inra.local>
Date: Wed, 6 Oct 2021 16:28:07 +0200
Subject: [PATCH 2/4] #4 add modules and sub process for report wf

---
 .../local/{report.nf => modules_report.nf}    |  3 +++
 sub-workflows/local/report.nf                 |  0
 sub-workflows/local/wf_report.nf              | 19 +++++++++++++++++++
 3 files changed, 22 insertions(+)
 rename modules/local/{report.nf => modules_report.nf} (93%)
 delete mode 100644 sub-workflows/local/report.nf
 create mode 100644 sub-workflows/local/wf_report.nf

diff --git a/modules/local/report.nf b/modules/local/modules_report.nf
similarity index 93%
rename from modules/local/report.nf
rename to modules/local/modules_report.nf
index 39e720c..b8c01c1 100644
--- a/modules/local/report.nf
+++ b/modules/local/modules_report.nf
@@ -1,3 +1,6 @@
+#!/usr/bin/env nextflow
+
+nextflow.enable.dsl=2
 
 process workflow_summary {
   
diff --git a/sub-workflows/local/report.nf b/sub-workflows/local/report.nf
deleted file mode 100644
index e69de29..0000000
diff --git a/sub-workflows/local/wf_report.nf b/sub-workflows/local/wf_report.nf
new file mode 100644
index 0000000..bfddf4d
--- /dev/null
+++ b/sub-workflows/local/wf_report.nf
@@ -0,0 +1,19 @@
+#!/usr/bin/env nextflow
+
+nextflow.enable.dsl=2
+
+include {	workflow_summary; 
+			multiqc; 
+			output_documentation; } from './modules/local/modules_report.nf'
+
+workflow report {
+	take:
+		ch_output_docs
+		
+	main:
+	
+		workflow_summary()
+		//multiqc(ch_multiqc_config, fastqc.out.collect().ifEmpty([]), workflow_summary.out.collect())
+		output_documentation(ch_output_docs)
+	
+}
\ No newline at end of file
-- 
GitLab


From f11d75adc5bfd16a9c9c3449f2093ac432bd66f8 Mon Sep 17 00:00:00 2001
From: Jules Sabban <jules.sabban@inrae.fr>
Date: Wed, 6 Oct 2021 16:28:56 +0200
Subject: [PATCH 3/4] #4 write workflow

---
 main_tmp.nf           |  44 +++++++++
 workflow/techno_qc.nf | 224 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 268 insertions(+)
 create mode 100644 main_tmp.nf

diff --git a/main_tmp.nf b/main_tmp.nf
new file mode 100644
index 0000000..76b4761
--- /dev/null
+++ b/main_tmp.nf
@@ -0,0 +1,44 @@
+#!/usr/bin/env nextflow
+
+nextflow.enable.dsl = 2
+
+/*
+Copyright INRAE 2021
+
+This software is a computer program whose purpose is to
+analyze high-throughput sequencing data.
+You can use, modify and/ or redistribute the software under the terms
+of license (see the LICENSE file for more details).
+The software is distributed in the hope that it will be useful,
+but "AS IS" WITHOUT ANY WARRANTY OF ANY KIND.
+Users are therefore encouraged to test the software's suitability as regards
+their requirements in conditions enabling the security of their systems and/or data.
+The fact that you are presently reading this means that you have had knowledge
+of the license and that you accept its terms.
+This script is based on : 
+ - the nf-core guidelines . See https://nf-co.re/ for more information
+ - the Curie institute template https://github.com/bioinfo-pf-curie/geniac-template/
+
+*/
+
+/*
+========================================================================================
+    NAMED WORKFLOW FOR PIPELINE
+========================================================================================
+*/
+
+include { techno_qc } from './workflows/techno_qc.nf'
+
+workflow QC_ANALYSIS {
+    techno_qc()
+}
+
+/*
+========================================================================================
+    RUN ALL WORKFLOWS
+========================================================================================
+*/
+
+workflow {
+    QC_ANALYSIS()
+}
diff --git a/workflow/techno_qc.nf b/workflow/techno_qc.nf
index e69de29..5d380c2 100644
--- a/workflow/techno_qc.nf
+++ b/workflow/techno_qc.nf
@@ -0,0 +1,224 @@
+#!/usr/bin/env nextflow
+
+nextflow.enable.dsl = 2
+
+def helpMessage() {
+    log.info"""
+
+    Usage:
+
+    The typical command for running the pipeline is as follows:
+
+    nextflow run get-nf/template --inputdir '/path/to/data' --samplesheet 'samples.csv' -profile docker
+
+    Mandatory arguments:
+      --inputdir                    Path to input directory 
+      -profile                      Configuration profile to use. Can use multiple (comma separated)
+                                    Available: conda, docker, singularity, path, genotoul, test and more.
+
+    Options:
+      --samplesheet                 Default inputdir/samples.csv eg: SAMPLE_ID,SAMPLE_NAME,path/to/R1/fastq/file,path/to/R2/fastq/file (for paired-end only)
+      --contaminant                 Name of iGenomes // To be discussed ????
+      --outdir                      The output directory where the results will be saved
+      --email                       Set this parameter to your e-mail address to get a summary e-mail with details of the run sent to you when the workflow exits
+      --email_on_fail               Same as --email, except only send mail if the workflow is not successful
+      --maxMultiqcEmailFileSize     Theshold size for MultiQC report to be attached in notification email. If file generated by pipeline exceeds the threshold, it will not be attached (Default: 25MB)
+      
+      -name [str]                   Name for the pipeline run. If not specified, Nextflow will automatically generate a random mnemonic.
+
+
+    =======================================================
+    Available profiles
+    -profile test                    Run the test dataset
+    -profile conda                   Build a new conda environment before running the pipeline. Use `--condaCacheDir` to define the conda cache path
+    -profile path                    Use the installation path defined for all tools. Use `--globalPath` to define the installation path
+    -profile docker                  Use the Docker images for each process
+    -profile singularity             Use the singularity images for each process
+    -profile genologin               Run the workflow on the cluster, instead of locally
+
+    """.stripIndent()
+}
+
+// Show help message
+if (params.help) {
+    helpMessage()
+    exit 0
+}
+
+
+
+
+// NOTE - THIS IS NOT USED IN THIS PIPELINE, EXAMPLE ONLY
+
+/*
+ * Create a channel for input read files
+ */
+// If you want to use the channel below in a process, define the following:
+//   input:
+//   file dir from inputDirCh
+//
+
+
+ch_inputdir = params.inputdir ? Channel.fromPath(params.inputdir, checkIfExists: true) : Channel.empty()
+
+// Create a channel for input read files
+if(params.samplesheet){
+  if(params.single_end){
+    ch_read_files=Channel
+      .from(file("${params.samplesheet}"))
+      .splitCsv(header: false)
+      .map{ row -> [ row[0], [file(row[2])]] }
+  }else{
+    ch_read_files=Channel
+      .from(file("${params.samplesheet}"))
+      .splitCsv(header: false)
+      .map{ row -> [ row[0], [file(row[2]), file(row[3])]] }    
+   }
+  params.reads=false
+} else {
+  exit 1, "Expect a samplesheet and an input dir !"
+}
+/*
+ * SET UP CONFIGURATION VARIABLES
+ */
+// Has the run name been specified by the user?
+// this has the bonus effect of catching both -name and --name
+params.custom_runName = params.name
+if (!(workflow.runName ==~ /[a-z]+_[a-z]+/)) {
+    params.custom_runName = workflow.runName
+}
+// Stage config files
+ch_multiqc_config = Channel.fromPath("${params.multiqc_config}", checkIfExists: true)
+ch_output_docs = Channel.fromPath("$projectDir/docs/output.md", checkIfExists: true)
+
+
+params.summary = [:]
+if (workflow.revision) params.summary['Pipeline Release'] = workflow.revision
+params.summary['Run Name']         = params.custom_runName ?: workflow.runName
+// TODO nf-core: Report custom parameters here
+params.summary['Input dir']            = params.inputdir
+params.summary['Sample sheet']        = params.samplesheet
+params.summary['Data Type']        = params.single_end ? 'Single-End' : 'Paired-End'
+params.summary['Max Resources']    = "$params.max_memory memory, $params.max_cpus cpus, $params.max_time time per job"
+if (workflow.containerEngine) params.summary['Container'] = "$workflow.containerEngine - $workflow.container"
+params.summary['Output dir']       = params.outdir
+params.summary['Launch dir']       = workflow.launchDir
+params.summary['Working dir']      = workflow.workDir
+params.summary['Script dir']       = workflow.projectDir
+params.summary['User']             = workflow.userName
+if (workflow.profile == 'awsbatch') {
+  params.summary['AWS Region']     = params.awsregion
+  params.summary['AWS Queue']      = params.awsqueue
+}
+params.summary['Config Profile'] = workflow.profile
+if (params.email || params.email_on_fail) {
+  params.summary['E-mail Address']    = params.email
+  params.summary['E-mail on failure'] = params.email_on_fail
+}
+log.info "-\033[2m--------------------------------------------------\033[0m-"
+log.info "-\033[2m----------------"+ workflow.manifest.name +" --\033[0m-"
+log.info "-\033[2m--------------------------------------------------\033[0m-"
+log.info params.summary.collect { k,v -> "${k.padRight(18)}: $v" }.join("\n")
+log.info "-\033[2m--------------------------------------------------\033[0m-"
+
+
+
+// -------------------------------------------------
+// 					INCLUDES
+// -------------------------------------------------
+
+include { 	report	} from '../subworklows/local/wf_report.nf'
+
+
+
+workflow techno_qc {
+	report(ch_output_docs)
+	
+}
+
+
+/*
+ * Completion e-mail notification
+ */
+workflow.onComplete {
+
+    // Set up the e-mail variables
+    def name_wf = workflow.manifest.name
+    def subject = "[$name_wf] Successful: $workflow.runName"
+    if (!workflow.success) {
+      subject = "[$name_wf] FAILED: $workflow.runName"
+    }
+    def email_fields = [:]
+    email_fields['version'] = workflow.manifest.version
+    email_fields['runName'] = params.custom_runName ?: workflow.runName
+    email_fields['success'] = workflow.success
+    email_fields['dateComplete'] = workflow.complete
+    email_fields['duration'] = workflow.duration
+    email_fields['exitStatus'] = workflow.exitStatus
+    email_fields['errorMessage'] = (workflow.errorMessage ?: 'None')
+    email_fields['errorReport'] = (workflow.errorReport ?: 'None')
+    email_fields['commandLine'] = workflow.commandLine
+    email_fields['projectDir'] = workflow.projectDir
+    email_fields['summary'] = params.summary
+    println(workflow)
+    
+    email_fields['summary']['Date Started'] = 11 // workflow.start
+    email_fields['summary']['Date Completed'] = 11 // workflow.complete
+    email_fields['summary']['Pipeline script file path'] = 'aaa' //workflow.scriptFile
+    email_fields['summary']['Pipeline script hash ID'] = 'aaa' //workflow.scriptId 
+    if (workflow.repository) email_fields['summary']['Pipeline repository Git URL'] = workflow.repository
+    if (workflow.commitId) email_fields['summary']['Pipeline repository Git Commit'] = workflow.commitId
+    if (workflow.revision) email_fields['summary']['Pipeline Git branch/tag'] = workflow.revision
+    if (workflow.container) email_fields['summary']['Docker image'] = workflow.container
+    email_fields['summary']['Nextflow Version'] = workflow.nextflow.version
+    email_fields['summary']['Nextflow Build'] = workflow.nextflow.build
+    email_fields['summary']['Nextflow Compile Timestamp'] = workflow.nextflow.timestamp
+
+    // Check if we are only sending emails on failure
+    email_address = params.email
+    if (!params.email && params.email_on_fail && !workflow.success) {
+        email_address = params.email_on_fail
+    }
+
+    // Render the TXT template
+    def engine = new groovy.text.GStringTemplateEngine()
+    def tf = new File("$baseDir/assets/email_template.txt")
+    def txt_template = engine.createTemplate(tf).make(email_fields)
+    def email_txt = txt_template.toString()
+    
+    // Send the HTML e-mail
+    if (email_address) {
+      // Catch failures and try with plaintext
+	  try {
+		  def sending = [ 'echo', '-e' , email_txt ].execute() | [ 'mail', '-s', subject, email_address  ].execute()
+		  log.debug "[$name_wf] Sent summary e-mail to $email_address (mail)"
+	  } catch (all) {
+		  log.error "[$name_wf] ERROR ON EMAIL SENDING TO $email_address !!"
+	  }
+      log.info "$email_txt"
+    }
+
+    // Write summary e-mail HTML to a file
+    def output_d = new File( "${params.outdir}/pipeline_info/" )
+    if (!output_d.exists()) {
+      output_d.mkdirs()
+    }
+    def output_tf = new File( output_d, "pipeline_report.txt" )
+    output_tf.withWriter { w -> w << email_txt }
+    c_green = params.monochrome_logs ? '' : "\033[0;32m";
+    c_purple = params.monochrome_logs ? '' : "\033[0;35m";
+    c_red = params.monochrome_logs ? '' : "\033[0;31m";
+    c_reset = params.monochrome_logs ? '' : "\033[0m";
+
+    if (workflow.stats.ignoredCount > 0 && workflow.success) {
+      log.info "-${c_purple}Warning, pipeline completed, but with errored process(es) ${c_reset}"
+      log.info "-${c_red}Number of ignored errored process(es) : ${workflow.stats.ignoredCount} ${c_reset}"
+      log.info "-${c_green}Number of successfully ran process(es) : ${workflow.stats.succeedCount} ${c_reset}"
+    }
+    if (workflow.success) {
+        log.info "-${c_purple}[${name_wf}]${c_green} Pipeline completed successfully${c_reset}"
+    } else {
+        log.info "-${c_purple}[${name_wf}]${c_red} Pipeline completed with errors${c_reset}"
+    }
+
+}
-- 
GitLab


From dada582bea095ce12295b97dedbb0af614ab7b7a Mon Sep 17 00:00:00 2001
From: Jules Sabban <jules.sabban@inrae.fr>
Date: Wed, 6 Oct 2021 17:13:48 +0200
Subject: [PATCH 4/4] #4 minor changes

---
 main.nf                          | 309 +++++--------------------------
 main_tmp.nf                      |  44 -----
 nextflow.config                  |   2 +-
 sub-workflows/local/wf_report.nf |   2 +-
 workflow/techno_qc.nf            |   2 +-
 5 files changed, 47 insertions(+), 312 deletions(-)
 delete mode 100644 main_tmp.nf

diff --git a/main.nf b/main.nf
index e2246c1..4913ab3 100644
--- a/main.nf
+++ b/main.nf
@@ -1,265 +1,44 @@
-#!/usr/bin/env nextflow
-
-nextflow.enable.dsl = 2
-
-/*
-Copyright INRAE 2021
-
-This software is a computer program whose purpose is to
-analyze high-throughput sequencing data.
-You can use, modify and/ or redistribute the software under the terms
-of license (see the LICENSE file for more details).
-The software is distributed in the hope that it will be useful,
-but "AS IS" WITHOUT ANY WARRANTY OF ANY KIND.
-Users are therefore encouraged to test the software's suitability as regards
-their requirements in conditions enabling the security of their systems and/or data.
-The fact that you are presently reading this means that you have had knowledge
-of the license and that you accept its terms.
-This script is based on : 
- - the nf-core guidelines . See https://nf-co.re/ for more information
- - the Curie institute template https://github.com/bioinfo-pf-curie/geniac-template/
-
-*/
-
-
-/*
-========================================================================================
-                         GeT/template
-========================================================================================
- GeT/template Analysis Pipeline.
- #### Homepage / Documentation
- https://github.com/get-nf/template
-----------------------------------------------------------------------------------------
-*/
-
-def helpMessage() {
-    log.info"""
-
-    Usage:
-
-    The typical command for running the pipeline is as follows:
-
-    nextflow run get-nf/template --inputdir '/path/to/data' --samplesheet 'samples.csv' -profile docker
-
-    Mandatory arguments:
-      --inputdir                    Path to input directory 
-      -profile                      Configuration profile to use. Can use multiple (comma separated)
-                                    Available: conda, docker, singularity, path, genotoul, test and more.
-
-    Options:
-      --samplesheet                 Default inputdir/samples.csv eg: SAMPLE_ID,SAMPLE_NAME,path/to/R1/fastq/file,path/to/R2/fastq/file (for paired-end only)
-      --contaminant                 Name of iGenomes // To be discussed ????
-      --outdir                      The output directory where the results will be saved
-      --email                       Set this parameter to your e-mail address to get a summary e-mail with details of the run sent to you when the workflow exits
-      --email_on_fail               Same as --email, except only send mail if the workflow is not successful
-      --maxMultiqcEmailFileSize     Theshold size for MultiQC report to be attached in notification email. If file generated by pipeline exceeds the threshold, it will not be attached (Default: 25MB)
-      
-      -name [str]                   Name for the pipeline run. If not specified, Nextflow will automatically generate a random mnemonic.
-
-
-    =======================================================
-    Available profiles
-    -profile test                    Run the test dataset
-    -profile conda                   Build a new conda environment before running the pipeline. Use `--condaCacheDir` to define the conda cache path
-    -profile path                    Use the installation path defined for all tools. Use `--globalPath` to define the installation path
-    -profile docker                  Use the Docker images for each process
-    -profile singularity             Use the singularity images for each process
-    -profile genologin               Run the workflow on the cluster, instead of locally
-
-    """.stripIndent()
-}
-
-// Show help message
-if (params.help) {
-    helpMessage()
-    exit 0
-}
-
-
-
-
-// NOTE - THIS IS NOT USED IN THIS PIPELINE, EXAMPLE ONLY
-
-/*
- * Create a channel for input read files
- */
-// If you want to use the channel below in a process, define the following:
-//   input:
-//   file dir from inputDirCh
-//
-
-
-ch_inputdir = params.inputdir ? Channel.fromPath(params.inputdir, checkIfExists: true) : Channel.empty()
-
-// Create a channel for input read files
-if(params.samplesheet){
-  if(params.single_end){
-    ch_read_files=Channel
-      .from(file("${params.samplesheet}"))
-      .splitCsv(header: false)
-      .map{ row -> [ row[0], [file(row[2])]] }
-  }else{
-    ch_read_files=Channel
-      .from(file("${params.samplesheet}"))
-      .splitCsv(header: false)
-      .map{ row -> [ row[0], [file(row[2]), file(row[3])]] }    
-   }
-  params.reads=false
-} else {
-  exit 1, "Expect a samplesheet and an input dir !"
-}
-/*
- * SET UP CONFIGURATION VARIABLES
- */
-// Has the run name been specified by the user?
-// this has the bonus effect of catching both -name and --name
-params.custom_runName = params.name
-if (!(workflow.runName ==~ /[a-z]+_[a-z]+/)) {
-    params.custom_runName = workflow.runName
-}
-// Stage config files
-ch_multiqc_config = Channel.fromPath("${params.multiqc_config}", checkIfExists: true)
-ch_output_docs = Channel.fromPath("$projectDir/docs/output.md", checkIfExists: true)
-
-
-params.summary = [:]
-if (workflow.revision) params.summary['Pipeline Release'] = workflow.revision
-params.summary['Run Name']         = params.custom_runName ?: workflow.runName
-// TODO nf-core: Report custom parameters here
-params.summary['Input dir']            = params.inputdir
-params.summary['Sample sheet']        = params.samplesheet
-params.summary['Data Type']        = params.single_end ? 'Single-End' : 'Paired-End'
-params.summary['Max Resources']    = "$params.max_memory memory, $params.max_cpus cpus, $params.max_time time per job"
-if (workflow.containerEngine) params.summary['Container'] = "$workflow.containerEngine - $workflow.container"
-params.summary['Output dir']       = params.outdir
-params.summary['Launch dir']       = workflow.launchDir
-params.summary['Working dir']      = workflow.workDir
-params.summary['Script dir']       = workflow.projectDir
-params.summary['User']             = workflow.userName
-if (workflow.profile == 'awsbatch') {
-  params.summary['AWS Region']     = params.awsregion
-  params.summary['AWS Queue']      = params.awsqueue
-}
-params.summary['Config Profile'] = workflow.profile
-if (params.email || params.email_on_fail) {
-  params.summary['E-mail Address']    = params.email
-  params.summary['E-mail on failure'] = params.email_on_fail
-}
-log.info "-\033[2m--------------------------------------------------\033[0m-"
-log.info "-\033[2m----------------"+ workflow.manifest.name +" --\033[0m-"
-log.info "-\033[2m--------------------------------------------------\033[0m-"
-log.info params.summary.collect { k,v -> "${k.padRight(18)}: $v" }.join("\n")
-log.info "-\033[2m--------------------------------------------------\033[0m-"
-
-
-
-// -------------------------------------------------
-// 					INCLUDES
-// -------------------------------------------------
-
-include { 	fastqc;
-			qc1;
-			assembly
-} from './modules/local/utils.nf'
-
-include {	workflow_summary;
-			multiqc;
-			output_documentation;
-} from './modules/local/report.nf'
-
-workflow {
-	fastqc(ch_read_files)
-	qc1(ch_read_files)
-	assembly(qc1.out, ch_read_files)
-	workflow_summary()
-	//multiqc(ch_multiqc_config, fastqc.out.collect().ifEmpty([]), workflow_summary.out.collect())
-	output_documentation(ch_output_docs)
-	
-}
-
-
-/*
- * Completion e-mail notification
- */
-workflow.onComplete {
-
-    // Set up the e-mail variables
-    def name_wf = workflow.manifest.name
-    def subject = "[$name_wf] Successful: $workflow.runName"
-    if (!workflow.success) {
-      subject = "[$name_wf] FAILED: $workflow.runName"
-    }
-    def email_fields = [:]
-    email_fields['version'] = workflow.manifest.version
-    email_fields['runName'] = params.custom_runName ?: workflow.runName
-    email_fields['success'] = workflow.success
-    email_fields['dateComplete'] = workflow.complete
-    email_fields['duration'] = workflow.duration
-    email_fields['exitStatus'] = workflow.exitStatus
-    email_fields['errorMessage'] = (workflow.errorMessage ?: 'None')
-    email_fields['errorReport'] = (workflow.errorReport ?: 'None')
-    email_fields['commandLine'] = workflow.commandLine
-    email_fields['projectDir'] = workflow.projectDir
-    email_fields['summary'] = params.summary
-    println(workflow)
-    
-    email_fields['summary']['Date Started'] = 11 // workflow.start
-    email_fields['summary']['Date Completed'] = 11 // workflow.complete
-    email_fields['summary']['Pipeline script file path'] = 'aaa' //workflow.scriptFile
-    email_fields['summary']['Pipeline script hash ID'] = 'aaa' //workflow.scriptId 
-    if (workflow.repository) email_fields['summary']['Pipeline repository Git URL'] = workflow.repository
-    if (workflow.commitId) email_fields['summary']['Pipeline repository Git Commit'] = workflow.commitId
-    if (workflow.revision) email_fields['summary']['Pipeline Git branch/tag'] = workflow.revision
-    if (workflow.container) email_fields['summary']['Docker image'] = workflow.container
-    email_fields['summary']['Nextflow Version'] = workflow.nextflow.version
-    email_fields['summary']['Nextflow Build'] = workflow.nextflow.build
-    email_fields['summary']['Nextflow Compile Timestamp'] = workflow.nextflow.timestamp
-
-    // Check if we are only sending emails on failure
-    email_address = params.email
-    if (!params.email && params.email_on_fail && !workflow.success) {
-        email_address = params.email_on_fail
-    }
-
-    // Render the TXT template
-    def engine = new groovy.text.GStringTemplateEngine()
-    def tf = new File("$baseDir/assets/email_template.txt")
-    def txt_template = engine.createTemplate(tf).make(email_fields)
-    def email_txt = txt_template.toString()
-    
-    // Send the HTML e-mail
-    if (email_address) {
-      // Catch failures and try with plaintext
-	  try {
-		  def sending = [ 'echo', '-e' , email_txt ].execute() | [ 'mail', '-s', subject, email_address  ].execute()
-		  log.debug "[$name_wf] Sent summary e-mail to $email_address (mail)"
-	  } catch (all) {
-		  log.error "[$name_wf] ERROR ON EMAIL SENDING TO $email_address !!"
-	  }
-      log.info "$email_txt"
-    }
-
-    // Write summary e-mail HTML to a file
-    def output_d = new File( "${params.outdir}/pipeline_info/" )
-    if (!output_d.exists()) {
-      output_d.mkdirs()
-    }
-    def output_tf = new File( output_d, "pipeline_report.txt" )
-    output_tf.withWriter { w -> w << email_txt }
-    c_green = params.monochrome_logs ? '' : "\033[0;32m";
-    c_purple = params.monochrome_logs ? '' : "\033[0;35m";
-    c_red = params.monochrome_logs ? '' : "\033[0;31m";
-    c_reset = params.monochrome_logs ? '' : "\033[0m";
-
-    if (workflow.stats.ignoredCount > 0 && workflow.success) {
-      log.info "-${c_purple}Warning, pipeline completed, but with errored process(es) ${c_reset}"
-      log.info "-${c_red}Number of ignored errored process(es) : ${workflow.stats.ignoredCount} ${c_reset}"
-      log.info "-${c_green}Number of successfully ran process(es) : ${workflow.stats.succeedCount} ${c_reset}"
-    }
-    if (workflow.success) {
-        log.info "-${c_purple}[${name_wf}]${c_green} Pipeline completed successfully${c_reset}"
-    } else {
-        log.info "-${c_purple}[${name_wf}]${c_red} Pipeline completed with errors${c_reset}"
-    }
-
-}
+#!/usr/bin/env nextflow
+
+nextflow.enable.dsl = 2
+
+/*
+Copyright INRAE 2021
+
+This software is a computer program whose purpose is to
+analyze high-throughput sequencing data.
+You can use, modify and/ or redistribute the software under the terms
+of license (see the LICENSE file for more details).
+The software is distributed in the hope that it will be useful,
+but "AS IS" WITHOUT ANY WARRANTY OF ANY KIND.
+Users are therefore encouraged to test the software's suitability as regards
+their requirements in conditions enabling the security of their systems and/or data.
+The fact that you are presently reading this means that you have had knowledge
+of the license and that you accept its terms.
+This script is based on : 
+ - the nf-core guidelines . See https://nf-co.re/ for more information
+ - the Curie institute template https://github.com/bioinfo-pf-curie/geniac-template/
+
+*/
+
+/*
+========================================================================================
+    NAMED WORKFLOW FOR PIPELINE
+========================================================================================
+*/
+
+include { techno_qc } from './workflow/techno_qc.nf'
+
+workflow QC_ANALYSIS {
+    techno_qc()
+}
+
+/*
+========================================================================================
+    RUN ALL WORKFLOWS
+========================================================================================
+*/
+
+workflow {
+    QC_ANALYSIS()
+}
diff --git a/main_tmp.nf b/main_tmp.nf
deleted file mode 100644
index 76b4761..0000000
--- a/main_tmp.nf
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/usr/bin/env nextflow
-
-nextflow.enable.dsl = 2
-
-/*
-Copyright INRAE 2021
-
-This software is a computer program whose purpose is to
-analyze high-throughput sequencing data.
-You can use, modify and/ or redistribute the software under the terms
-of license (see the LICENSE file for more details).
-The software is distributed in the hope that it will be useful,
-but "AS IS" WITHOUT ANY WARRANTY OF ANY KIND.
-Users are therefore encouraged to test the software's suitability as regards
-their requirements in conditions enabling the security of their systems and/or data.
-The fact that you are presently reading this means that you have had knowledge
-of the license and that you accept its terms.
-This script is based on : 
- - the nf-core guidelines . See https://nf-co.re/ for more information
- - the Curie institute template https://github.com/bioinfo-pf-curie/geniac-template/
-
-*/
-
-/*
-========================================================================================
-    NAMED WORKFLOW FOR PIPELINE
-========================================================================================
-*/
-
-include { techno_qc } from './workflows/techno_qc.nf'
-
-workflow QC_ANALYSIS {
-    techno_qc()
-}
-
-/*
-========================================================================================
-    RUN ALL WORKFLOWS
-========================================================================================
-*/
-
-workflow {
-    QC_ANALYSIS()
-}
diff --git a/nextflow.config b/nextflow.config
index 950cef5..562640c 100644
--- a/nextflow.config
+++ b/nextflow.config
@@ -20,7 +20,7 @@ params {
   name = false
   multiqc_config = "$baseDir/assets/multiqc_config.yaml"
   tracedir = "${params.outdir}/pipeline_info"
-  email = false
+  email = 'claire.kuchly@inrae.fr'
   email_on_fail = false
   monochrome_logs = false
   help = false
diff --git a/sub-workflows/local/wf_report.nf b/sub-workflows/local/wf_report.nf
index bfddf4d..28625d4 100644
--- a/sub-workflows/local/wf_report.nf
+++ b/sub-workflows/local/wf_report.nf
@@ -4,7 +4,7 @@ nextflow.enable.dsl=2
 
 include {	workflow_summary; 
 			multiqc; 
-			output_documentation; } from './modules/local/modules_report.nf'
+			output_documentation; } from '../../modules/local/modules_report.nf'
 
 workflow report {
 	take:
diff --git a/workflow/techno_qc.nf b/workflow/techno_qc.nf
index 5d380c2..42f16cf 100644
--- a/workflow/techno_qc.nf
+++ b/workflow/techno_qc.nf
@@ -127,7 +127,7 @@ log.info "-\033[2m--------------------------------------------------\033[0m-"
 // 					INCLUDES
 // -------------------------------------------------
 
-include { 	report	} from '../subworklows/local/wf_report.nf'
+include { 	report	} from '../sub-workflows/local/wf_report.nf'
 
 
 
-- 
GitLab