From c64d2dd03526038691e2294166cb25ee575e797b Mon Sep 17 00:00:00 2001
From: Laurent Modolo <laurent.modolo@ens-lyon.fr>
Date: Fri, 12 Mar 2021 16:04:44 +0100
Subject: [PATCH] add missing pairend_end & single_end switch

---
 src/nf_modules/fastqc/main.nf | 23 +++++++++++++++++++++++
 src/nf_modules/urqt/main.nf   | 29 +++++++++++++++++++++++++++++
 2 files changed, 52 insertions(+)

diff --git a/src/nf_modules/fastqc/main.nf b/src/nf_modules/fastqc/main.nf
index 599101f6..5e770297 100644
--- a/src/nf_modules/fastqc/main.nf
+++ b/src/nf_modules/fastqc/main.nf
@@ -1,6 +1,29 @@
 version = "0.11.5"
 container_url = "lbmc/fastqc:${version}"
 
+process fastqc_fastq {
+  container = "${container_url}"
+  label "big_mem_mono_cpus"
+  tag "$pair_id"
+
+  input:
+  tuple val(pair_id), path(reads)
+
+  output:
+  path "*.{zip,html}", emit: report
+
+  script:
+if (reads instanceof List)
+"""
+fastqc --quiet --threads ${task.cpus} --format fastq --outdir ./ \
+  ${reads[0]} ${reads[1]}
+"""
+else
+"""
+  fastqc --quiet --threads ${task.cpus} --format fastq --outdir ./ ${reads}
+"""
+}
+
 process fastqc_fastq_pairedend {
   container = "${container_url}"
   label "big_mem_mono_cpus"
diff --git a/src/nf_modules/urqt/main.nf b/src/nf_modules/urqt/main.nf
index 6744856a..48200cc0 100644
--- a/src/nf_modules/urqt/main.nf
+++ b/src/nf_modules/urqt/main.nf
@@ -3,6 +3,35 @@ container_url = "lbmc/urqt:${version}"
 
 trim_quality = "20"
 
+process trimming {
+  container = "${container_url}"
+  label "big_mem_multi_cpus"
+  tag "${reads}"
+
+  input:
+  tuple val(pair_id), path(reads)
+
+  output:
+  tuple val(pair_id), path("*_trim_R{1,2}.fastq.gz"), emit: fastq
+  path "*_report.txt", emit: report
+
+  script:
+if (reads instanceof List)
+"""
+UrQt --t 20 --m ${task.cpus} --gz \
+  --in ${reads[0]} --inpair ${reads[1]} \
+  --out ${pair_id}_trim_R1.fastq.gz --outpair ${pair_id}_trim_R2.fastq.gz \
+  > ${pair_id}_trimming_report.txt
+"""
+else
+"""
+UrQt --t 20 --m ${task.cpus} --gz \
+  --in ${reads} \
+  --out ${file_id}_trim.fastq.gz \
+  > ${file_id}_trimming_report.txt
+"""
+}
+
 process trimming_pairedend {
   container = "${container_url}"
   label "big_mem_multi_cpus"
-- 
GitLab