Skip to content
Snippets Groups Projects
Unverified Commit e45f6eed authored by Ruben Vorderman's avatar Ruben Vorderman Committed by GitHub
Browse files

Merge pull request #45 from biowdl/somatic

Changes for somatic variantcalling
parents 756c2d59 490a0db3
No related branches found
No related tags found
No related merge requests found
version 1.0 version 1.0
task Somatic { task ConfigureSomatic {
input { input {
File tumorBam File tumorBam
File tumorIndex File tumorIndex
...@@ -14,9 +14,6 @@ task Somatic { ...@@ -14,9 +14,6 @@ task Somatic {
Boolean exome = false Boolean exome = false
String? preCommand String? preCommand
String? installDir String? installDir
Int cores = 1
Int memory = 4
} }
String toolCommand = if defined(installDir) String toolCommand = if defined(installDir)
...@@ -33,7 +30,22 @@ task Somatic { ...@@ -33,7 +30,22 @@ task Somatic {
~{"--callRegions " + callRegions} \ ~{"--callRegions " + callRegions} \
--runDir ~{runDir} \ --runDir ~{runDir} \
~{true="--exome" false="" exome} ~{true="--exome" false="" exome}
}
output {
String runDirectory = runDir
}
}
task RunSomatic {
input {
String runDir
Int cores = 1
Int memory = 4
Boolean paired = true
}
command {
~{runDir}/runWorkflow.py \ ~{runDir}/runWorkflow.py \
-m local \ -m local \
-j ~{cores} \ -j ~{cores} \
...@@ -46,10 +58,10 @@ task Somatic { ...@@ -46,10 +58,10 @@ task Somatic {
"/results/variants/candidateSmallIndels.vcf.gz.tbi" "/results/variants/candidateSmallIndels.vcf.gz.tbi"
File candidateSV = runDir + "/results/variants/candidateSV.vcf.gz" File candidateSV = runDir + "/results/variants/candidateSV.vcf.gz"
File candidateSVindex = runDir + "/results/variants/candidateSV.vcf.gz.tbi" File candidateSVindex = runDir + "/results/variants/candidateSV.vcf.gz.tbi"
File tumorSV = if defined(normalBam) File tumorSV = if paired
then runDir + "/results/variants/somaticSV.vcf.gz" then runDir + "/results/variants/somaticSV.vcf.gz"
else runDir + "/results/variants/tumorSV.vcf.gz" else runDir + "/results/variants/tumorSV.vcf.gz"
File tumorSVindex = if defined(normalBam) File tumorSVindex = if paired
then runDir + "/results/variants/somaticSV.vcf.gz.tbi" then runDir + "/results/variants/somaticSV.vcf.gz.tbi"
else runDir + "/results/variants/tumorSV.vcf.gz.tbi" else runDir + "/results/variants/tumorSV.vcf.gz.tbi"
File? diploidSV = "/results/variants/diploidSV.vcf.gz" File? diploidSV = "/results/variants/diploidSV.vcf.gz"
......
...@@ -386,6 +386,7 @@ task SortVcf { ...@@ -386,6 +386,7 @@ task SortVcf {
Array[File]+ vcfFiles Array[File]+ vcfFiles
String outputVcf String outputVcf
File? sequenceDict
Int memory = 4 Int memory = 4
Float memoryMultiplier = 3.0 Float memoryMultiplier = 3.0
...@@ -401,7 +402,8 @@ task SortVcf { ...@@ -401,7 +402,8 @@ task SortVcf {
~{toolCommand} \ ~{toolCommand} \
SortVcf \ SortVcf \
I=~{sep=" I=" vcfFiles} \ I=~{sep=" I=" vcfFiles} \
O=outputVcf ~{"SEQUENCE_DICTIONARY=" + sequenceDict} \
O=~{outputVcf}
} }
output { output {
......
version 1.0 version 1.0
task Germline { task ConfigureGermline {
input { input {
String? preCommand String? preCommand
String? installDir String? installDir
...@@ -13,9 +13,6 @@ task Germline { ...@@ -13,9 +13,6 @@ task Germline {
File? callRegionsIndex File? callRegionsIndex
Boolean exome = false Boolean exome = false
Boolean rna = false Boolean rna = false
Int cores = 1
Int memory = 4
} }
String toolCommand = if defined(installDir) String toolCommand = if defined(installDir)
...@@ -32,26 +29,14 @@ task Germline { ...@@ -32,26 +29,14 @@ task Germline {
~{"--callRegions " + callRegions} \ ~{"--callRegions " + callRegions} \
~{true="--exome" false="" exome} \ ~{true="--exome" false="" exome} \
~{true="--rna" false="" rna} ~{true="--rna" false="" rna}
~{runDir}/runWorkflow.py \
-m local \
-j ~{cores} \
-g ~{memory}
} }
output { output {
File variants = runDir + "/results/variants/variants.vcf.gz" String runDirectory = runDir
File variantsIndex = runDir + "/results/variants/variants.vcf.gz.tbi"
}
runtime {
cpu: cores
memory: memory
} }
} }
task ConfigureSomatic {
task Somatic {
input { input {
String? preCommand String? preCommand
String? installDir String? installDir
...@@ -67,9 +52,6 @@ task Somatic { ...@@ -67,9 +52,6 @@ task Somatic {
File? indelCandidates File? indelCandidates
File? indelCandidatesIndex File? indelCandidatesIndex
Boolean exome = false Boolean exome = false
Int cores = 1
Int memory = 4
} }
String toolCommand = if defined(installDir) String toolCommand = if defined(installDir)
...@@ -87,7 +69,22 @@ task Somatic { ...@@ -87,7 +69,22 @@ task Somatic {
~{"--callRegions " + callRegions} \ ~{"--callRegions " + callRegions} \
~{"--indelCandidates " + indelCandidates} \ ~{"--indelCandidates " + indelCandidates} \
~{true="--exome" false="" exome} \ ~{true="--exome" false="" exome} \
}
output {
String runDirectory = runDir
}
}
task Run {
input {
String runDir
Int cores = 1
Int memory = 4
Boolean somatic = true
}
command {
~{runDir}/runWorkflow.py \ ~{runDir}/runWorkflow.py \
-m local \ -m local \
-j ~{cores} \ -j ~{cores} \
...@@ -95,10 +92,14 @@ task Somatic { ...@@ -95,10 +92,14 @@ task Somatic {
} }
output { output {
File indelsVcf = runDir + "/results/variants/somatic.indels.vcf.gz" File? indelsVcf = runDir + "/results/variants/somatic.indels.vcf.gz"
File indelsIndex = runDir + "/results/variants/somatic.indels.vcf.gz.tbi" File? indelsIndex = runDir + "/results/variants/somatic.indels.vcf.gz.tbi"
File snvVcf = runDir + "/results/variants/somatic.snvs.vcf.gz" File variants = if somatic
File snvIndex = runDir + "/results/variants/somatic.snvs.vcf.gz.tbi" then runDir + "/results/variants/somatic.snvs.vcf.gz"
else runDir + "/results/variants/variants.vcf.gz"
File variantsIndex = if somatic
then runDir + "/results/variants/somatic.snvs.vcf.gz.tbi"
else runDir + "/results/variants/variants.vcf.gz.tbi"
} }
runtime { runtime {
......
...@@ -22,21 +22,25 @@ task VarDict { ...@@ -22,21 +22,25 @@ task VarDict {
Int geneColumn = 4 Int geneColumn = 4
String? preCommand String? preCommand
Int memory = 8
Float memoryMultiplier = 2.0
} }
String toolCommand = if defined(installDir) String toolCommand = if defined(installDir)
then installDir + "/VarDict" then installDir + "/VarDict"
else if useJavaVersion else if useJavaVersion
then "vardict-java" #probably needs memory stuff then "vardict-java"
else "vardict" else "vardict"
command { command {
set -e -o pipefail set -e -o pipefail
export JAVA_OPTS="-Xmx~{memory}G"
~{preCommand} ~{preCommand}
~{toolCommand} \ ~{toolCommand} \
-G ~{refFasta} \ -G ~{refFasta} \
-N ~{tumorSampleName} \ -N ~{tumorSampleName} \
-b "~{tumorBam}~{"|" + normalBam}" \ -b "~{tumorBam}~{"|" + normalBam}" \
~{true="" false="-z" defined(normalBam)} \
-c ~{chromosomeColumn} \ -c ~{chromosomeColumn} \
-S ~{startColumn} \ -S ~{startColumn} \
-E ~{endColumn} \ -E ~{endColumn} \
...@@ -53,4 +57,8 @@ task VarDict { ...@@ -53,4 +57,8 @@ task VarDict {
output { output {
File vcfFile = outputVcf File vcfFile = outputVcf
} }
runtime {
memory: ceil(memory * memoryMultiplier)
}
} }
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