diff --git a/centrifuge.wdl b/centrifuge.wdl index e950284b5076276bfc6f189ecc2819be1096e665..f466fe3b53c380077fb61cccc12354c2b0cc06a5 100644 --- a/centrifuge.wdl +++ b/centrifuge.wdl @@ -86,7 +86,7 @@ task Classify { mkdir -p ${outputDir} ${preCommand} centrifuge \ - ${"-p " + threads} \ + ${"-p " + select_first([threads, 4])} \ ${"-x " + indexPrefix} \ ${true="-f" false="" fastaInput} \ ${true="-k" false="" defined(assignments)} ${assignments} \ @@ -108,8 +108,8 @@ task Classify { } runtime { - cpu: select_first([threads, 1]) - memory: select_first([memory, 4]) + cpu: select_first([threads, 4]) + memory: select_first([memory, 8]) } } diff --git a/gatk.wdl b/gatk.wdl index 3035d805b935767d3a7e80d2565585064527858b..fbbc8138342e1e37aafb7289129d775e6aec962f 100644 --- a/gatk.wdl +++ b/gatk.wdl @@ -19,13 +19,12 @@ task ApplyBQSR { String toolCommand = if defined(gatkJar) then "java -Xmx" + mem + "G -jar " + gatkJar - else "gatk -Xmx" + mem + "G" + else "gatk --java-options -Xmx" + mem + "G" command { set -e -o pipefail ${preCommand} ${toolCommand} \ - -Xms${mem}G -jar ${gatkJar} \ ApplyBQSR \ --create-output-bam-md5 \ --add-output-sam-program-record \ @@ -56,12 +55,23 @@ task BaseRecalibrator { File inputBamIndex String recalibrationReportPath Array[File]+ sequenceGroupInterval - Array[File]+ knownIndelsSitesVCFs - Array[File]+ knownIndelsSitesIndices + Array[File]? knownIndelsSitesVCFs + Array[File]? knownIndelsSitesIndices + File? dbsnpVCF + File? dbsnpVCFindex File refDict File refFasta File refFastaIndex + Array[File]+ knownIndelsSitesVCFsArg = flatten([ + select_first([knownIndelsSitesVCFs, []]), + select_all([dbsnpVCF]) + ]) + Array[File]+ knownIndelsSitesIndicesArg = flatten([ + select_first([knownIndelsSitesIndices, []]), + select_all([dbsnpVCFindex]) + ]) + Float? memory Float? memoryMultiplier @@ -69,7 +79,7 @@ task BaseRecalibrator { String toolCommand = if defined(gatkJar) then "java -Xmx" + mem + "G -jar " + gatkJar - else "gatk -Xmx" + mem + "G" + else "gatk --java-options -Xmx" + mem + "G" command { set -e -o pipefail @@ -80,7 +90,7 @@ task BaseRecalibrator { -I ${inputBam} \ --use-original-qualities \ -O ${recalibrationReportPath} \ - --known-sites ${sep=" --known-sites " knownIndelsSitesVCFs} \ + --known-sites ${sep=" --known-sites " knownIndelsSitesVCFsArg} \ -L ${sep=" -L " sequenceGroupInterval} } @@ -115,7 +125,7 @@ task CombineGVCFs { String toolCommand = if defined(gatkJar) then "java -Xmx" + mem + "G -jar " + gatkJar - else "gatk -Xmx" + mem + "G" + else "gatk --java-options -Xmx" + mem + "G" command { set -e -o pipefail @@ -123,7 +133,6 @@ task CombineGVCFs { if [ ${length(gvcfFiles)} -gt 1 ]; then ${toolCommand} \ - -Xmx${mem}G -jar ${gatkJar} \ CombineGVCFs \ -R ${refFasta} \ -O ${outputPath} \ @@ -159,7 +168,7 @@ task GatherBqsrReports { String toolCommand = if defined(gatkJar) then "java -Xmx" + mem + "G -jar " + gatkJar - else "gatk -Xmx" + mem + "G" + else "gatk --java-options -Xmx" + mem + "G" command { set -e -o pipefail @@ -193,8 +202,8 @@ task GenotypeGVCFs { File refFastaIndex File refDict - File dbsnpVCF - File dbsnpVCFindex + File? dbsnpVCF + File? dbsnpVCFindex Int? compressionLevel Float? memory @@ -204,18 +213,17 @@ task GenotypeGVCFs { String toolCommand = if defined(gatkJar) then "java -Xmx" + mem + "G -jar " + gatkJar - else "gatk -Xmx" + mem + "G" + else "gatk --java-options -Xmx" + mem + "G" command { set -e -o pipefail ${preCommand} ${toolCommand} \ - -Xmx${mem}G -jar ${gatkJar} \ GenotypeGVCFs \ -R ${refFasta} \ -O ${outputPath} \ - -D ${dbsnpVCF} \ + ${"-D " + dbsnpVCF} \ -G StandardAnnotation \ --only-output-calls-starting-in-intervals \ -new-qual \ @@ -247,24 +255,27 @@ task HaplotypeCallerGvcf { Int? compressionLevel String? gatkJar + File? dbsnpVCF + File? dbsnpVCFindex + Float? memory Float? memoryMultiplier Int mem = ceil(select_first([memory, 4.0])) String toolCommand = if defined(gatkJar) then "java -Xmx" + mem + "G -jar " + gatkJar - else "gatk -Xmx" + mem + "G" + else "gatk --java-options -Xmx" + mem + "G" command { set -e -o pipefail ${preCommand} ${toolCommand} \ - -Xmx${mem}G -jar ${gatkJar} \ HaplotypeCaller \ -R ${refFasta} \ -O ${gvcfPath} \ -I ${sep=" -I " inputBams} \ -L ${sep=' -L ' intervalList} \ + ${"-D " + dbsnpVCF} \ -contamination ${default=0 contamination} \ -ERC GVCF } @@ -297,7 +308,7 @@ task SplitNCigarReads { String toolCommand = if defined(gatkJar) then "java -Xmx" + mem + "G -jar " + gatkJar - else "gatk -Xmx" + mem + "G" + else "gatk --java-options -Xmx" + mem + "G" command { set -e -o pipefail diff --git a/picard.wdl b/picard.wdl index adba2cf6762223322efe23c20c2fbc3b0da510e1..66916efa9ffb874617e1effea459e3dbb1b0c099 100644 --- a/picard.wdl +++ b/picard.wdl @@ -11,7 +11,7 @@ task ScatterIntervalList { String toolCommand = if defined(picardJar) then "java -Xmx" + mem + "G -jar " + picardJar - else "gatk -Xmx" + mem + "G" + else "picard -Xmx" + mem + "G" command { set -e -o pipefail @@ -52,7 +52,7 @@ task GatherBamFiles { String toolCommand = if defined(picardJar) then "java -Xmx" + mem + "G -jar " + picardJar - else "gatk -Xmx" + mem + "G" + else "picard -Xmx" + mem + "G" command { set -e -o pipefail @@ -100,7 +100,7 @@ task MarkDuplicates { String toolCommand = if defined(picardJar) then "java -Xmx" + mem + "G -jar " + picardJar - else "gatk -Xmx" + mem + "G" + else "picard -Xmx" + mem + "G" command { set -e -o pipefail @@ -148,7 +148,7 @@ task MergeVCFs { String toolCommand = if defined(picardJar) then "java -Xmx" + mem + "G -jar " + picardJar - else "gatk -Xmx" + mem + "G" + else "picard -Xmx" + mem + "G" command { set -e -o pipefail @@ -182,7 +182,7 @@ task SamToFastq { String toolCommand = if defined(picardJar) then "java -Xmx" + mem + "G -jar " + picardJar - else "gatk -Xmx" + mem + "G" + else "picard -Xmx" + mem + "G" command { set -e -o pipefail diff --git a/star.wdl b/star.wdl index 92245ecd90fba746be99d99883b467231b85faaa..941a1d60137ad31dbc4ab7cbe7d8f6616bbee7b5 100644 --- a/star.wdl +++ b/star.wdl @@ -2,7 +2,7 @@ task Star { String? preCommand Array[File] inputR1 - Array[File?] inputR2 + Array[File]? inputR2 String genomeDir String outFileNamePrefix