Skip to content
Snippets Groups Projects
Commit 2c2bed96 authored by Cats's avatar Cats
Browse files

Merge branch 'develop' into BIOWDL-78

parents 5de99d71 ef6db0ef
No related branches found
No related tags found
1 merge request!74add SomaticSeq
version 1.0 version 1.0
import "common.wdl" as common
task Mem { task Mem {
input { input {
String? preCommand String? preCommand
...@@ -9,29 +11,59 @@ task Mem { ...@@ -9,29 +11,59 @@ task Mem {
String outputPath String outputPath
String? readgroup String? readgroup
String? picardJar
Int threads = 1 Int threads = 1
Int memory = 8 Int memory = 8
Int picardMemory = 4
} }
String picardPrefix = if defined(picardJar)
then "java -Xmx" + picardMemory + "G -jar " + picardJar
else "picard -Xmx" + picardMemory + "G"
# Post alt script from bwa
String altCommand = if (defined(bwaIndex.altIndex)) then "| bwa-postalt " + bwaIndex.altIndex else ""
# setNmMdAndUqTags is only required if alt sequences are added
String setNmMdAndUqTagsCommand = picardPrefix + " SetNmMdAndUqTags " +
" INPUT=/dev/stdin OUTPUT=" + outputPath +
" CREATE_INDEX=true" +
" R=" + bwaIndex.fastaFile
String sortSamCommand = picardPrefix + " SortSam " +
" INPUT=/dev/stdin SORT_ORDER=coordinate " +
if(defined(bwaIndex.altIndex)) then " OUTPUT=/dev/stdout "
else " OUTPUT=" + outputPath + " CREATE_INDEX=true "
String picardCommand = if (defined(bwaIndex.altIndex)) then sortSamCommand + " | " + setNmMdAndUqTagsCommand
else sortSamCommand
String readgroupArg = if (defined(readgroup)) then "-R '" + readgroup + "'" else ""
command { command {
set -e -o pipefail set -e -o pipefail
mkdir -p $(dirname ~{outputPath}) mkdir -p $(dirname ~{outputPath})
~{preCommand} ~{preCommand}
bwa mem ~{"-t " + threads} \ bwa mem ~{"-t " + threads} \
~{"-R '" + readgroup + "'"} \ ~{readgroupArg} \
~{bwaIndex.fastaFile} \ ~{bwaIndex.fastaFile} \
~{inputR1} \ ~{inputR1} \
~{inputR2} \ ~{inputR2} \
| samtools sort --output-fmt BAM - > ~{outputPath} ~{altCommand} \
| ~{picardCommand}
} }
output { output {
File bamFile = outputPath IndexedBamFile bamFile = object {
file: outputPath,
index: sub(outputPath, ".bam$", ".bai")
}
} }
runtime{ runtime{
cpu: threads cpu: threads
memory: memory memory: memory + picardMemory + picardMemory
} }
} }
...@@ -62,8 +94,10 @@ task Index { ...@@ -62,8 +94,10 @@ task Index {
} }
output { output {
File indexedFasta = outputFile BwaIndex outputIndex = object {
Array[File] indexFiles = [outputFile + ".bwt",outputFile + ".pac",outputFile + ".sa",outputFile + ".amb",outputFile + ".ann"] fastaFile: outputFile,
indexFiles: [outputFile + ".bwt",outputFile + ".pac",outputFile + ".sa",outputFile + ".amb",outputFile + ".ann"]
}
} }
parameter_meta { parameter_meta {
...@@ -77,4 +111,5 @@ task Index { ...@@ -77,4 +111,5 @@ task Index {
struct BwaIndex { struct BwaIndex {
File fastaFile File fastaFile
Array[File] indexFiles Array[File] indexFiles
File? altIndex
} }
...@@ -197,7 +197,7 @@ task Kreport { ...@@ -197,7 +197,7 @@ task Kreport {
String suffix = "kreport" String suffix = "kreport"
String prefix = "centrifuge" String prefix = "centrifuge"
String indexPrefix String indexPrefix
Boolean? onlyUnique Boolean? onlyUnique ## removed in 1.0.4
Boolean? showZeros Boolean? showZeros
Boolean? isCountTable Boolean? isCountTable
Int? minScore Int? minScore
......
...@@ -6,7 +6,7 @@ task Sample { ...@@ -6,7 +6,7 @@ task Sample {
String outFilePath = "subsampledReads.fq.gz" String outFilePath = "subsampledReads.fq.gz"
String? preCommand String? preCommand
Int? seed Int? seed
Boolean twoPassMode Boolean twoPassMode = false
Float? fraction Float? fraction
Int? number Int? number
Boolean zip = true Boolean zip = true
......
...@@ -32,7 +32,8 @@ task Spades { ...@@ -32,7 +32,8 @@ task Spades {
Int? phredOffset Int? phredOffset
} }
Int clusterMemory = ceil(memoryGb / threads) Int clusterMemory = ceil(memoryGb / threads * 1.2)
Int memoryArg = ceil(memoryGb)
command { command {
set -e -o pipefail set -e -o pipefail
...@@ -60,7 +61,7 @@ task Spades { ...@@ -60,7 +61,7 @@ task Spades {
~{true="--disable-rr" false="" disableRepeatResolution} \ ~{true="--disable-rr" false="" disableRepeatResolution} \
~{"--dataset " + dataset} \ ~{"--dataset " + dataset} \
~{"--threads " + threads} \ ~{"--threads " + threads} \
~{"--memory " + memoryGb} \ ~{"--memory " + memoryArg} \
~{"-k " + k} \ ~{"-k " + k} \
~{"--cov-cutoff " + covCutoff} \ ~{"--cov-cutoff " + covCutoff} \
~{"--phred-offset " + phredOffset} ~{"--phred-offset " + phredOffset}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment