Skip to content
Snippets Groups Projects
Commit d557d942 authored by ffinfo's avatar ffinfo
Browse files

Switch to strucs

parent 2e4f73df
No related branches found
No related tags found
1 merge request!61Switch to structs
...@@ -5,8 +5,7 @@ import "common.wdl" as common ...@@ -5,8 +5,7 @@ import "common.wdl" as common
task Mem { task Mem {
input { input {
String? preCommand String? preCommand
File inputR1 FastqPair inputFastq
File? inputR2
BwaIndex bwaIndex BwaIndex bwaIndex
String outputPath String outputPath
String? readgroup String? readgroup
...@@ -48,8 +47,8 @@ task Mem { ...@@ -48,8 +47,8 @@ task Mem {
bwa mem ~{"-t " + threads} \ bwa mem ~{"-t " + threads} \
~{readgroupArg} \ ~{readgroupArg} \
~{bwaIndex.fastaFile} \ ~{bwaIndex.fastaFile} \
~{inputR1} \ ~{inputFastq.R1} \
~{inputR2} \ ~{inputFastq.R2} \
~{altCommand} \ ~{altCommand} \
| ~{picardCommand} | ~{picardCommand}
} }
......
version 1.0 version 1.0
import "common.wdl"
task Cutadapt { task Cutadapt {
input { input {
File read1 FastqPair inputFastq
File? read2
String read1output String read1output
String? read2output String? read2output
String? format String? format
...@@ -119,15 +120,17 @@ task Cutadapt { ...@@ -119,15 +120,17 @@ task Cutadapt {
~{true="--bwa" false="" bwa} \ ~{true="--bwa" false="" bwa} \
~{true="--zero-cap" false="" zeroCap} \ ~{true="--zero-cap" false="" zeroCap} \
~{true="--no-zero-cap" false="" noZeroCap} \ ~{true="--no-zero-cap" false="" noZeroCap} \
~{read1} \ ~{inputFastq.R1} \
~{read2} \ ~{inputFastq.R2} \
~{"> " + reportPath} ~{"> " + reportPath}
} }
output{ output{
FastqPair cutOutput = object {
R1: read1output,
R2: read2output
}
File report = if defined(reportPath) then select_first([reportPath]) else stdout() File report = if defined(reportPath) then select_first([reportPath]) else stdout()
File cutRead1 = read1output
File? cutRead2 = read2output
File? tooLongOutput=tooLongOutputPath File? tooLongOutput=tooLongOutputPath
File? tooShortOutput=tooShortOutputPath File? tooShortOutput=tooShortOutputPath
File? untrimmedOutput=untrimmedOutputPath File? untrimmedOutput=untrimmedOutputPath
......
...@@ -3,7 +3,7 @@ version 1.0 ...@@ -3,7 +3,7 @@ version 1.0
task HTSeqCount { task HTSeqCount {
input { input {
String? preCommand String? preCommand
Array[File] alignmentFiles Array[IndexedBamFile] inputBamFiles
File gtfFile File gtfFile
String outputTable String outputTable
String format = "bam" String format = "bam"
...@@ -21,7 +21,7 @@ task HTSeqCount { ...@@ -21,7 +21,7 @@ task HTSeqCount {
-f ~{format} \ -f ~{format} \
-r ~{order} \ -r ~{order} \
-s ~{stranded} \ -s ~{stranded} \
~{sep=" " alignmentFiles} \ ~{sep=" " inputBamFiles.file} \
~{gtfFile} \ ~{gtfFile} \
> ~{outputTable} > ~{outputTable}
} }
......
...@@ -3,7 +3,7 @@ version 1.0 ...@@ -3,7 +3,7 @@ version 1.0
task PeakCalling { task PeakCalling {
input { input {
String? preCommand String? preCommand
Array[File] bamFiles Array[IndexedBamFile] bamFiles
String outDir String outDir
String sampleName String sampleName
Int threads = 1 Int threads = 1
...@@ -15,7 +15,7 @@ task PeakCalling { ...@@ -15,7 +15,7 @@ task PeakCalling {
set -e -o pipefail set -e -o pipefail
~{preCommand} ~{preCommand}
macs2 callpeak \ macs2 callpeak \
--treatment ~{sep = ' ' bamFiles} \ --treatment ~{sep = ' ' bamFiles.file} \
--outdir ~{outDir} \ --outdir ~{outDir} \
--name ~{sampleName} \ --name ~{sampleName} \
~{true='--nomodel' false='' nomodel} ~{true='--nomodel' false='' nomodel}
......
version 1.0 version 1.0
import "common.wdl"
task ConfigureSomatic { task ConfigureSomatic {
input { input {
File tumorBam IndexedBamFile tumorBam
File tumorIndex IndexedBamFile? normalBam
File? normalBam Reference reference
File? normalIndex
File refFasta
File refFastaIndex
String runDir String runDir
File? callRegions File? callRegions
File? callRegionsIndex File? callRegionsIndex
...@@ -24,9 +23,9 @@ task ConfigureSomatic { ...@@ -24,9 +23,9 @@ task ConfigureSomatic {
set -e -o pipefail set -e -o pipefail
~{preCommand} ~{preCommand}
~{toolCommand} \ ~{toolCommand} \
~{"--normalBam " + normalBam} \ ~{"--normalBam " + normalBam.file} \
~{"--tumorBam " + tumorBam} \ ~{"--tumorBam " + tumorBam.file} \
--referenceFasta ~{refFasta} \ --referenceFasta ~{reference.fasta} \
~{"--callRegions " + callRegions} \ ~{"--callRegions " + callRegions} \
--runDir ~{runDir} \ --runDir ~{runDir} \
~{true="--exome" false="" exome} ~{true="--exome" false="" exome}
...@@ -53,19 +52,28 @@ task RunSomatic { ...@@ -53,19 +52,28 @@ task RunSomatic {
} }
output { output {
File condidateSmallIndels = runDir + "/results/variants/candidateSmallIndels.vcf.gz" IndexedVcfFile condidateSmallIndels = object {
File condidateSmallIndelsIndex = runDir + file: runDir + "/results/variants/candidateSmallIndels.vcf.gz",
"/results/variants/candidateSmallIndels.vcf.gz.tbi" index: runDir + "/results/variants/candidateSmallIndels.vcf.gz.tbi"
File candidateSV = runDir + "/results/variants/candidateSV.vcf.gz" }
File candidateSVindex = runDir + "/results/variants/candidateSV.vcf.gz.tbi" IndexedVcfFile candidateSV = object {
File tumorSV = if paired file: runDir + "/results/variants/candidateSV.vcf.gz",
then runDir + "/results/variants/somaticSV.vcf.gz" index: runDir + "/results/variants/candidateSV.vcf.gz.tbi"
else runDir + "/results/variants/tumorSV.vcf.gz" }
File tumorSVindex = if paired File tumorSV = if (paired)
then runDir + "/results/variants/somaticSV.vcf.gz.tbi" then object {
else runDir + "/results/variants/tumorSV.vcf.gz.tbi" file: runDir + "/results/variants/somaticSV.vcf.gz",
File? diploidSV = "/results/variants/diploidSV.vcf.gz" index: runDir + "/results/variants/somaticSV.vcf.gz.tbi"
File? diploidSVindex = "/results/variants/diploidSV.vcf.gz.tbi" }
else object {
file: runDir + "/results/variants/tumorSV.vcf.gz",
index: runDir + "/results/variants/tumorSV.vcf.gz.tbi"
}
IndexedVcfFile diploidSV = object {
file: runDir + "/results/variants/diploidSV.vcf.gz",
index: runDir + "/results/variants/diploidSV.vcf.gz.tbi"
}
} }
runtime { runtime {
......
version 1.0 version 1.0
import "common.wdl"
task BgzipAndIndex { task BgzipAndIndex {
input { input {
File inputFile File inputFile
...@@ -34,9 +36,12 @@ task Index { ...@@ -34,9 +36,12 @@ task Index {
} }
output { output {
File indexFile = if defined(bamIndexPath) IndexedBamFile outputBam = object {
then select_first([bamIndexPath]) file: bamFilePath,
else bamFilePath + ".bai" index: if defined(bamIndexPath)
then select_first([bamIndexPath])
else bamFilePath + ".bai"
}
} }
} }
......
...@@ -3,7 +3,7 @@ version 1.0 ...@@ -3,7 +3,7 @@ version 1.0
task Stringtie { task Stringtie {
input { input {
String? preCommand String? preCommand
File alignedReads IndexedBamFile bam
File? referenceGtf File? referenceGtf
Int threads = 1 Int threads = 1
String assembledTranscriptsFile String assembledTranscriptsFile
...@@ -23,7 +23,7 @@ task Stringtie { ...@@ -23,7 +23,7 @@ task Stringtie {
~{true="fr" false="" secondStranded} \ ~{true="fr" false="" secondStranded} \
-o ~{assembledTranscriptsFile} \ -o ~{assembledTranscriptsFile} \
~{"-A " + geneAbundanceFile} \ ~{"-A " + geneAbundanceFile} \
~{alignedReads} ~{bam.file}
} }
output { output {
......
version 1.0 version 1.0
import "common.wdl"
task VarDict { task VarDict {
input { input {
String? installDir String? installDir
Boolean useJavaVersion = true Boolean useJavaVersion = true
String tumorSampleName String tumorSampleName
File tumorBam IndexedBamFile tumorBam
File tumorIndex
String? normalSampleName String? normalSampleName
File? normalBam IndexedBamFile? normalBam
File? normalIndex Reference reference
File refFasta
File refFastaIndex
File bedFile File bedFile
String outputVcf String outputVcf
...@@ -37,9 +36,9 @@ task VarDict { ...@@ -37,9 +36,9 @@ task VarDict {
export JAVA_OPTS="-Xmx~{memory}G" export JAVA_OPTS="-Xmx~{memory}G"
~{preCommand} ~{preCommand}
~{toolCommand} \ ~{toolCommand} \
-G ~{refFasta} \ -G ~{reference.fasta} \
-N ~{tumorSampleName} \ -N ~{tumorSampleName} \
-b "~{tumorBam}~{"|" + normalBam}" \ -b "~{tumorBam.file}~{"|" + normalBam.file}" \
~{true="" false="-z" defined(normalBam)} \ ~{true="" false="-z" defined(normalBam)} \
-c ~{chromosomeColumn} \ -c ~{chromosomeColumn} \
-S ~{startColumn} \ -S ~{startColumn} \
...@@ -52,10 +51,14 @@ task VarDict { ...@@ -52,10 +51,14 @@ task VarDict {
-N "~{tumorSampleName}~{"|" + normalSampleName}" \ -N "~{tumorSampleName}~{"|" + normalSampleName}" \
~{true="" false="-E" defined(normalBam)} | \ ~{true="" false="-E" defined(normalBam)} | \
bgzip -c > ~{outputVcf} bgzip -c > ~{outputVcf}
tabix -p vcf ~{outputVcf}
} }
output { output {
File vcfFile = outputVcf IndexedVcfFile vcfFile = object {
file: outputVcf,
index: outputVcf + ".tbi"
}
} }
runtime { runtime {
......
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