From 985cef3173d81f0ccddc83cd853c4c5b36d6b0d6 Mon Sep 17 00:00:00 2001
From: "Gervaise H. Henry" <gervaise.henry@utsouthwestern.edu>
Date: Wed, 20 Jan 2021 01:52:45 -0600
Subject: [PATCH] Fix fastqc error detection

---
 workflow/rna-seq.nf | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/workflow/rna-seq.nf b/workflow/rna-seq.nf
index eb58808..e41f42a 100644
--- a/workflow/rna-seq.nf
+++ b/workflow/rna-seq.nf
@@ -570,12 +570,11 @@ process fastqc {
 
     # run fastqc
     echo -e "LOG: running fastq on raw fastqs" >> ${repRID}.fastqc.log
-    fastqcErrorOut=false
-    fastqc *.fastq.gz -o . &> fastqc.out || :
-    fastqcErrorOut=\$(cat fastqc.out | grep -c 'Failed to process file')
+    fastqcErrorOut=0
+    fastqc *.fastq.gz -o . &> fastqc.out || fastqcErrorOut=\$(cat fastqc.out | grep -c 'Failed to process file')
     fastqFileError=false
     fastqFileError_details=""
-    if [ "\${fastqcErrorOut}" -gt "0" ]
+    if [ "\${fastqcErrorOut}" -ne "0" ]
     then
       fastqFileError=true
       fastqFileError_details="**There is an error with the structure of the fastq**"
-- 
GitLab