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
import "common.wdl" as common
task Mem {
input {
String? preCommand
......@@ -9,29 +11,59 @@ task Mem {
String outputPath
String? readgroup
String? picardJar
Int threads = 1
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 {
set -e -o pipefail
mkdir -p $(dirname ~{outputPath})
~{preCommand}
bwa mem ~{"-t " + threads} \
~{"-R '" + readgroup + "'"} \
~{readgroupArg} \
~{bwaIndex.fastaFile} \
~{inputR1} \
~{inputR2} \
| samtools sort --output-fmt BAM - > ~{outputPath}
~{altCommand} \
| ~{picardCommand}
}
output {
File bamFile = outputPath
IndexedBamFile bamFile = object {
file: outputPath,
index: sub(outputPath, ".bam$", ".bai")
}
}
runtime{
cpu: threads
memory: memory
memory: memory + picardMemory + picardMemory
}
}
......@@ -62,8 +94,10 @@ task Index {
}
output {
File indexedFasta = outputFile
Array[File] indexFiles = [outputFile + ".bwt",outputFile + ".pac",outputFile + ".sa",outputFile + ".amb",outputFile + ".ann"]
BwaIndex outputIndex = object {
fastaFile: outputFile,
indexFiles: [outputFile + ".bwt",outputFile + ".pac",outputFile + ".sa",outputFile + ".amb",outputFile + ".ann"]
}
}
parameter_meta {
......@@ -77,4 +111,5 @@ task Index {
struct BwaIndex {
File fastaFile
Array[File] indexFiles
File? altIndex
}
......@@ -197,7 +197,7 @@ task Kreport {
String suffix = "kreport"
String prefix = "centrifuge"
String indexPrefix
Boolean? onlyUnique
Boolean? onlyUnique ## removed in 1.0.4
Boolean? showZeros
Boolean? isCountTable
Int? minScore
......
......@@ -6,7 +6,7 @@ task Sample {
String outFilePath = "subsampledReads.fq.gz"
String? preCommand
Int? seed
Boolean twoPassMode
Boolean twoPassMode = false
Float? fraction
Int? number
Boolean zip = true
......
......@@ -32,7 +32,8 @@ task Spades {
Int? phredOffset
}
Int clusterMemory = ceil(memoryGb / threads)
Int clusterMemory = ceil(memoryGb / threads * 1.2)
Int memoryArg = ceil(memoryGb)
command {
set -e -o pipefail
......@@ -60,7 +61,7 @@ task Spades {
~{true="--disable-rr" false="" disableRepeatResolution} \
~{"--dataset " + dataset} \
~{"--threads " + threads} \
~{"--memory " + memoryGb} \
~{"--memory " + memoryArg} \
~{"-k " + k} \
~{"--cov-cutoff " + covCutoff} \
~{"--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