Skip to content
Snippets Groups Projects
Unverified Commit 6300bba0 authored by Peter van 't Hof's avatar Peter van 't Hof Committed by GitHub
Browse files

Merge branch 'develop' into BIOWDL-85

parents 32581162 124bc31a
No related branches found
No related tags found
1 merge request!61Switch to structs
......@@ -409,6 +409,8 @@ task ValidateFastq {
output {
File stderr = stderr()
File validatedFastq1 = fastq1
File? validatedFastq2 = fastq2
}
runtime {
......
version 1.0
# Copyright Sequencing Analysis Support Core - Leiden University Medical Center 2018
task Generate {
input {
String? preCommand
File? toolJar
File fastqR1
File? fastqR2
String outputFile
String sample
String library
String readgroup
Int memory = 4
Float memoryMultiplier = 2.0
}
String toolCommand = if defined(toolJar)
then "java -Xmx" + memory + "G -jar " + toolJar
else "biopet-seqstat -Xmx" + memory + "G"
command {
set -e -o pipefail
~{preCommand}
mkdir -p $(dirname ~{outputFile})
~{toolCommand} Generate \
--fastqR1 ~{fastqR1} \
~{"--fastqR2 " + fastqR2} \
--output ~{outputFile} \
~{"--sample " + sample} \
~{"--library " + library } \
~{"--readgroup " + readgroup }
}
output {
File json = outputFile
}
runtime {
memory: ceil(memory * memoryMultiplier)
}
}
\ No newline at end of file
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
}
......@@ -101,7 +101,7 @@ task Classify {
~{true="-k" false="" defined(assignments)} ~{assignments} \
~{true="-1" false="-U" defined(read2)} ~{sep=',' read1} \
~{true="-2" false="" defined(read2)} ~{sep=',' read2} \
~{true="-U" false="" defined(unpairedReads)} ~{sep=',' unpairedReads} \
~{true="-U" false="" length(select_first([unpairedReads])) > 0} ~{sep=',' unpairedReads} \
~{"--report-file " + reportFilePath} \
~{"--min-hitlen " + minHitLen} \
~{"--min-totallen " + minTotalLen} \
......@@ -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
......
......@@ -42,11 +42,14 @@ task ConcatenateTextFiles {
Boolean zip = false
}
# When input and output is both compressed decompression is not needed
String cmdPrefix = if (unzip && !zip) then "zcat " else "cat "
String cmdSuffix = if (!unzip && zip) then " | gzip -c " else ""
command {
set -e -o pipefail
~{"mkdir -p $(dirname " + combinedFilePath + ")"}
~{true='zcat' false= 'cat' unzip} ~{sep=' ' fileList} \
~{true="| gzip -c" false="" zip} > ~{combinedFilePath}
~{cmdPrefix} ~{sep=' ' fileList} ~{cmdSuffix} > ~{combinedFilePath}
}
output {
......@@ -150,3 +153,10 @@ struct IndexedBamFile {
File file
File index
}
struct FastqPair {
File R1
String? R1_md5
File? R2
String? R2_md5
}
......@@ -12,7 +12,6 @@ task ApplyBQSR {
File recalibrationReport
Array[File]+ sequenceGroupInterval
Reference reference
Int? compressionLevel
Int memory = 4
Float memoryMultiplier = 3.0
......@@ -112,7 +111,6 @@ task CombineGVCFs {
Reference reference
Int? compressionLevel #TODO This isn't being used?
Int memory = 4
Float memoryMultiplier = 3.0
}
......@@ -198,7 +196,6 @@ task GenotypeGVCFs {
IndexedVcfFile? dbsnpVCF
Int? compressionLevel
Int memory = 4
Float memoryMultiplier =3.0
}
......@@ -243,7 +240,6 @@ task HaplotypeCallerGvcf {
String gvcfPath
Reference reference
Float contamination = 0.0
Int? compressionLevel
String? gatkJar
IndexedVcfFile? dbsnpVCF
......
version 1.0
task BedToIntervalList {
input {
String? preCommand
File? picardJar
File bedFile
File dict
String outputPath
Int memory = 4
Float memoryMultiplier = 3.0
}
String toolCommand = if defined(picardJar)
then "java -Xmx" + memory + "G -jar " + picardJar
else "picard -Xmx" + memory + "G"
command {
set -e -o pipefail
mkdir -p $(dirname "~{outputPath}")
~{preCommand}
~{toolCommand} \
BedToIntervalList \
I=~{bedFile} \
O=~{outputPath} \
SD=~{dict}
}
output {
File intervalList = outputPath
}
runtime {
memory: ceil(memory * memoryMultiplier)
}
}
task CollectMultipleMetrics {
input {
String? preCommand
......
......@@ -6,9 +6,8 @@ task Sample {
String outFilePath = "subsampledReads.fq.gz"
String? preCommand
Int? seed
Boolean twoPassMode
Float? fraction
Int? number
Boolean twoPassMode = false
Float fractionOrNumber # when above 1.0 is the number of reads, otherwise it's a fraction
Boolean zip = true
}
......@@ -20,8 +19,7 @@ task Sample {
~{"-s " + seed} \
~{true="-2 " false="" twoPassMode} \
~{sequenceFile} \
~{number} \
~{fraction} \
~{fractionOrNumber} \
~{true="| gzip" false="" zip} \
> ~{outFilePath}
}
......
......@@ -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}
......
......@@ -20,7 +20,7 @@ task Star {
Int memory = 10
}
#TODO needs to be extended for all possible output extensions
# Needs to be extended for all possible output extensions
Map[String, String] samOutputNames = {"BAM SortedByCoordinate": "sortedByCoord.out.bam"}
command {
......
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