From fb1a2c685695d63645ee953c21f6eeb020efcc6a Mon Sep 17 00:00:00 2001
From: DavyCats <davycats.dc@gmail.com>
Date: Wed, 30 May 2018 13:18:42 +0200
Subject: [PATCH] requested changes and memory settings

---
 biopet.wdl    |  9 +++++----
 gatk.wdl      | 14 +++++++-------
 picard.wdl    | 10 +++++-----
 samtools.wdl  | 11 +++--------
 stringtie.wdl |  2 +-
 5 files changed, 21 insertions(+), 25 deletions(-)

diff --git a/biopet.wdl b/biopet.wdl
index e74fc61..f9d2a6b 100644
--- a/biopet.wdl
+++ b/biopet.wdl
@@ -1,8 +1,9 @@
 # PLEASE ADD TASKS IN ALPHABETIC ORDER.
 # This makes searching a lot easier.
+
 task BaseCounter {
     String? preCommand
-    String tool_jar
+    File toolJar
     File bam
     File bamIndex
     File refFlat
@@ -17,7 +18,7 @@ task BaseCounter {
         set -e -o pipefail
         mkdir -p ${outputDir}
         ${preCommand}
-        java -Xmx${mem}G -jar ${tool_jar} \
+        java -Xmx${mem}G -jar ${toolJar} \
         -b ${bam} \
         -r ${refFlat} \
         -o ${outputDir} \
@@ -62,7 +63,7 @@ task BaseCounter {
     }
 
     runtime {
-        memory: ceil(mem * select_first([memoryMultiplier, 1.5]))
+        memory: ceil(mem * select_first([memoryMultiplier, 3.0]))
     }
 }
 
@@ -187,7 +188,7 @@ task ScatterRegions {
     }
 
     runtime {
-        memory: ceil(mem * select_first([memoryMultiplier, 2.0]))
+        memory: ceil(mem * select_first([memoryMultiplier, 3.0]))
     }
 }
 
diff --git a/gatk.wdl b/gatk.wdl
index bd97b42..12b03d9 100644
--- a/gatk.wdl
+++ b/gatk.wdl
@@ -34,7 +34,7 @@ task BaseRecalibrator {
     }
 
     runtime {
-        memory: ceil(mem * select_first([memoryMultiplier, 1.5]))
+        memory: ceil(mem * select_first([memoryMultiplier, 3.0]))
     }
 }
 
@@ -78,7 +78,7 @@ task ApplyBQSR {
     }
 
     runtime {
-        memory: ceil(mem * select_first([memoryMultiplier, 1.5]))
+        memory: ceil(mem * select_first([memoryMultiplier, 3.0]))
     }
 }
 
@@ -107,7 +107,7 @@ task GatherBqsrReports {
     }
 
     runtime {
-        memory: ceil(mem * select_first([memoryMultiplier, 1.5]))
+        memory: ceil(mem * select_first([memoryMultiplier, 3.0]))
     }
 }
 
@@ -149,7 +149,7 @@ task HaplotypeCallerGvcf {
     }
 
     runtime {
-        memory: ceil(mem * select_first([memoryMultiplier, 1.5]))
+        memory: ceil(mem * select_first([memoryMultiplier, 3.0]))
     }
 }
 
@@ -198,7 +198,7 @@ task GenotypeGVCFs {
     }
 
     runtime{
-        memory: ceil(mem * select_first([memoryMultiplier, 1.5]))
+        memory: ceil(mem * select_first([memoryMultiplier, 3.0]))
     }
 }
 
@@ -245,7 +245,7 @@ task CombineGVCFs {
     }
 
     runtime {
-        memory: ceil(mem * select_first([memoryMultiplier, 1.5]))
+        memory: ceil(mem * select_first([memoryMultiplier, 3.0]))
     }
 }
 
@@ -282,6 +282,6 @@ task SplitNCigarReads {
     }
 
     runtime {
-        memory: ceil(mem * select_first([memoryMultiplier, 1.5]))
+        memory: ceil(mem * select_first([memoryMultiplier, 3.0]))
     }
 }
diff --git a/picard.wdl b/picard.wdl
index 2c638df..e3bcbc1 100644
--- a/picard.wdl
+++ b/picard.wdl
@@ -28,7 +28,7 @@ task ScatterIntervalList {
     }
 
     runtime {
-        memory: ceil(mem * select_first([memoryMultiplier, 1.5]))
+        memory: ceil(mem * select_first([memoryMultiplier, 3.0]))
     }
 }
 
@@ -63,7 +63,7 @@ task GatherBamFiles {
     }
 
     runtime {
-        memory: ceil(mem * select_first([memoryMultiplier, 1.5]))
+        memory: ceil(mem * select_first([memoryMultiplier, 3.0]))
     }
 }
 
@@ -113,7 +113,7 @@ task MarkDuplicates {
     }
 
     runtime {
-        memory: ceil(mem * select_first([memoryMultiplier, 1.5]))
+        memory: ceil(mem * select_first([memoryMultiplier, 3.0]))
     }
 }
 
@@ -148,7 +148,7 @@ task MergeVCFs {
     }
 
     runtime {
-        memory: ceil(mem * select_first([memoryMultiplier, 1.5]))
+        memory: ceil(mem * select_first([memoryMultiplier, 3.0]))
     }
 }
 
@@ -183,6 +183,6 @@ task SamToFastq {
     }
 
     runtime {
-        memory: ceil(mem * select_first([memoryMultiplier, 1.5]))
+        memory: ceil(mem * select_first([memoryMultiplier, 3.0]))
     }
 }
\ No newline at end of file
diff --git a/samtools.wdl b/samtools.wdl
index 949f87d..ccd99cb 100644
--- a/samtools.wdl
+++ b/samtools.wdl
@@ -1,7 +1,7 @@
 task Index {
     String? preCommand
     File bamFilePath
-    String bamIndexPath
+    String? bamIndexPath
 
     command {
         set -e -o pipefail
@@ -10,7 +10,7 @@ task Index {
     }
 
     output {
-        File indexFile = bamIndexPath
+        File indexFile = if defined(bamIndexPath) then select_first([bamIndexPath]) else bamFilePath + ".bai"
     }
 }
 
@@ -22,12 +22,7 @@ task Merge {
     command {
         set -e -o pipefail
         ${preCommand}
-        if [ ${length(bamFiles)} -gt 1 ]
-          then
-            samtools merge ${outputBamPath} ${sep=' ' bamFiles}
-          else
-            ln -sf ${sep=' ' bamFiles} ${outputBamPath}
-        fi
+        samtools merge ${outputBamPath} ${sep=' ' bamFiles}
     }
 
     output {
diff --git a/stringtie.wdl b/stringtie.wdl
index 77f287e..f5c6854 100644
--- a/stringtie.wdl
+++ b/stringtie.wdl
@@ -10,7 +10,7 @@ task Stringtie {
 
     command {
         set -e -o pipefail
-        mkdir -p ${sub(assembledTranscriptsFile, basename(assembledTranscriptsFile), "")}
+        mkdir -p $(dirname ${assembledTranscriptsFile})
         ${preCommand}
         stringtie \
         ${"-p " + threads} \
-- 
GitLab