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