diff --git a/preproc_fastq/trimgalore.sh b/preproc_fastq/trimgalore.sh
index e1e2966e3070311df176e29e204a2f1542c49e94..c9f00d14d3d7ad936056ec5abdc9eaba779d0d9f 100644
--- a/preproc_fastq/trimgalore.sh
+++ b/preproc_fastq/trimgalore.sh
@@ -22,6 +22,7 @@ do
 done
 
 shift $(($OPTIND -1))
+baseDir="`dirname \"$0\"`"
 
 # Check for mandatory options
 if [[ -z $pair_id ]] || [[ -z $fq1 ]]; then