From a75cb7cffe307ab2d72f4d9cd92b43c792fe2b38 Mon Sep 17 00:00:00 2001
From: Brandi Cantarel <brandi.cantarel@utsouthwestern.edu>
Date: Wed, 22 Jul 2020 19:54:57 -0500
Subject: [PATCH] trim galore bug with

---
 preproc_fastq/trimgalore.sh | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/preproc_fastq/trimgalore.sh b/preproc_fastq/trimgalore.sh
index 5cf4f83..e198d3c 100644
--- a/preproc_fastq/trimgalore.sh
+++ b/preproc_fastq/trimgalore.sh
@@ -30,7 +30,7 @@ if [[ -z $pair_id ]]; then
 fi
 fqs=''
 i=0
-numfq=$#
+numfq=${#fqs[@]}
 while [[ $i -le $numfq ]]
 do
     fqs="$fqs $1"
@@ -51,14 +51,13 @@ fi
 
 numfq=${#fqs[@]}
 copts='-q 25 --illumina --gzip --length 35'
-if [[ $numfq == 2 ]]
+if [[ $numfq == 1 ]]
 then
     copts="$copts --paired"
 fi
     
 source /etc/profile.d/modules.sh
 module load trimgalore/0.6.4 cutadapt/2.5
-
 trim_galore $copts ${fqs}
 files=`find ./ -name "*_val_1.fq.gz"`
 
-- 
GitLab