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

Switch biopet tools to structs

parent 5a7dbffa
No related branches found
No related tags found
1 merge request!61Switch to structs
version 1.0 version 1.0
import "common.wdl"
task BaseCounter { task BaseCounter {
input { input {
String? preCommand String? preCommand
File? toolJar File? toolJar
File bam IndexedBamFile bam
File bamIndex
File refFlat File refFlat
String outputDir String outputDir
String prefix String prefix
...@@ -23,7 +24,7 @@ task BaseCounter { ...@@ -23,7 +24,7 @@ task BaseCounter {
mkdir -p ~{outputDir} mkdir -p ~{outputDir}
~{preCommand} ~{preCommand}
~{toolCommand} \ ~{toolCommand} \
-b ~{bam} \ -b ~{bam.file} \
-r ~{refFlat} \ -r ~{refFlat} \
-o ~{outputDir} \ -o ~{outputDir} \
-p ~{prefix} -p ~{prefix}
...@@ -160,10 +161,8 @@ task FastqSplitter { ...@@ -160,10 +161,8 @@ task FastqSplitter {
task FastqSync { task FastqSync {
input { input {
String? preCommand String? preCommand
File ref1 FastqPair refFastq
File ref2 FastqPair inputFastq
File in1
File in2
String out1path String out1path
String out2path String out2path
File? toolJar File? toolJar
...@@ -181,17 +180,19 @@ task FastqSync { ...@@ -181,17 +180,19 @@ task FastqSync {
~{preCommand} ~{preCommand}
mkdir -p $(dirname ~{out1path}) $(dirname ~{out2path}) mkdir -p $(dirname ~{out1path}) $(dirname ~{out2path})
~{toolCommand} \ ~{toolCommand} \
--in1 ~{in1} \ --in1 ~{inputFastq.R1} \
--in2 ~{in2} \ --in2 ~{inputFastq.R2} \
--ref1 ~{ref1} \ --ref1 ~{refFastq.R1} \
--ref2 ~{ref2} \ --ref2 ~{refFastq.R2} \
--out1 ~{out1path} \ --out1 ~{out1path} \
--out2 ~{out2path} --out2 ~{out2path}
} }
output { output {
File out1 = out1path FastqPair out1 = object {
File out2 = out2path R1: out1path,
R1: out2path
}
} }
runtime { runtime {
...@@ -199,89 +200,10 @@ task FastqSync { ...@@ -199,89 +200,10 @@ task FastqSync {
} }
} }
task SampleConfig {
input {
File? toolJar
String? preCommand
Array[File]+ inputFiles
String keyFilePath
String? sample
String? library
String? readgroup
String? jsonOutputPath
String? tsvOutputPath
Int memory = 4
Float memoryMultiplier = 2.0
}
String toolCommand = if defined(toolJar)
then "java -Xmx" + memory + "G -jar " +toolJar
else "biopet-sampleconfig -Xmx" + memory + "G"
command {
set -e -o pipefail
~{preCommand}
mkdir -p . ~{"$(dirname " + jsonOutputPath + ")"} ~{"$(dirname " + tsvOutputPath + ")"}
~{toolCommand} \
-i ~{sep="-i " inputFiles} \
~{"--sample " + sample} \
~{"--library " + library} \
~{"--readgroup " + readgroup} \
~{"--jsonOutput " + jsonOutputPath} \
~{"--tsvOutput " + tsvOutputPath} \
> ~{keyFilePath}
}
output {
File keysFile = keyFilePath
File? jsonOutput = jsonOutputPath
File? tsvOutput = tsvOutputPath
}
runtime {
memory: ceil(memory * memoryMultiplier)
}
}
task SampleConfigCromwellArrays {
input {
File? toolJar
String? preCommand
Array[File]+ inputFiles
String outputPath
Int memory = 4
Float memoryMultiplier = 2.0
}
String toolCommand = if defined(toolJar)
then "java -Xmx" + memory + "G -jar " + toolJar
else "biopet-sampleconfig -Xmx" + memory + "G"
command {
set -e -o pipefail
~{preCommand}
mkdir -p $(dirname ~{outputPath})
~{toolCommand} CromwellArrays \
-i ~{sep="-i " inputFiles} \
~{"-o " + outputPath}
}
output {
File outputFile = outputPath
}
runtime {
memory: ceil(memory * memoryMultiplier)
}
}
task ScatterRegions { task ScatterRegions {
input { input {
String? preCommand String? preCommand
File refFasta Reference reference
File refDict
String outputDirPath String outputDirPath
File? toolJar File? toolJar
Int? scatterSize Int? scatterSize
...@@ -300,7 +222,7 @@ task ScatterRegions { ...@@ -300,7 +222,7 @@ task ScatterRegions {
~{preCommand} ~{preCommand}
mkdir -p ~{outputDirPath} mkdir -p ~{outputDirPath}
~{toolCommand} \ ~{toolCommand} \
-R ~{refFasta} \ -R ~{reference.fasta} \
-o ~{outputDirPath} \ -o ~{outputDirPath} \
~{"-s " + scatterSize} \ ~{"-s " + scatterSize} \
~{"-L " + regions} ~{"-L " + regions}
...@@ -315,48 +237,13 @@ task ScatterRegions { ...@@ -315,48 +237,13 @@ task ScatterRegions {
} }
} }
task Seqstat {
input {
String? preCommand
File? toolJar
File fastq
String outputFile
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} \
--fastq ~{fastq} \
--output ~{outputFile}
}
output {
File json = outputFile
}
runtime {
memory: ceil(memory * memoryMultiplier)
}
}
task ValidateAnnotation { task ValidateAnnotation {
input { input {
String? preCommand String? preCommand
File? toolJar File? toolJar
File? refRefflat File? refRefflat
File? gtfFile File? gtfFile
File refFasta Reference reference
File refFastaIndex
File refDict
Int memory = 4 Int memory = 4
Float memoryMultiplier = 2.0 Float memoryMultiplier = 2.0
...@@ -372,7 +259,7 @@ task ValidateAnnotation { ...@@ -372,7 +259,7 @@ task ValidateAnnotation {
~{toolCommand} \ ~{toolCommand} \
~{"-r " + refRefflat} \ ~{"-r " + refRefflat} \
~{"-g " + gtfFile} \ ~{"-g " + gtfFile} \
-R ~{refFasta} -R ~{reference.fasta}
} }
output { output {
...@@ -388,8 +275,7 @@ task ValidateFastq { ...@@ -388,8 +275,7 @@ task ValidateFastq {
input { input {
String? preCommand String? preCommand
File? toolJar File? toolJar
File fastq1 FastqPair inputFastq
File? fastq2
Int memory = 4 Int memory = 4
Float memoryMultiplier = 2.0 Float memoryMultiplier = 2.0
...@@ -403,14 +289,13 @@ task ValidateFastq { ...@@ -403,14 +289,13 @@ task ValidateFastq {
set -e -o pipefail set -e -o pipefail
~{preCommand} ~{preCommand}
~{toolCommand} \ ~{toolCommand} \
--fastq1 ~{fastq1} \ --fastq1 ~{inputFastq.R1} \
~{"--fastq2 " + fastq2} ~{"--fastq2 " + inputFastq.R2}
} }
output { output {
File stderr = stderr() File stderr = stderr()
File validatedFastq1 = fastq1 FastqPair validatedFastq = inputFastq
File? validatedFastq2 = fastq2
} }
runtime { runtime {
...@@ -422,11 +307,8 @@ task ValidateVcf { ...@@ -422,11 +307,8 @@ task ValidateVcf {
input { input {
String? preCommand String? preCommand
File? toolJar File? toolJar
File vcfFile IndexedVcfFile vcf
File vcfIndex Reference reference
File refFasta
File refFastaIndex
File refDict
Int memory = 4 Int memory = 4
Float memoryMultiplier = 2.0 Float memoryMultiplier = 2.0
...@@ -440,8 +322,8 @@ task ValidateVcf { ...@@ -440,8 +322,8 @@ task ValidateVcf {
set -e -o pipefail set -e -o pipefail
~{preCommand} ~{preCommand}
~{toolCommand} \ ~{toolCommand} \
-i ~{vcfFile} \ -i ~{vcf.file} \
-R ~{refFasta} -R ~{reference.fasta}
} }
output { output {
...@@ -455,11 +337,8 @@ task ValidateVcf { ...@@ -455,11 +337,8 @@ task ValidateVcf {
task VcfStats { task VcfStats {
input { input {
File vcfFile IndexedVcfFile vcf
File vcfIndex Reference reference
File refFasta
File refFastaIndex
File refDict
String outputDir String outputDir
File? intervals File? intervals
Array[String]+? infoTags Array[String]+? infoTags
...@@ -493,8 +372,8 @@ task VcfStats { ...@@ -493,8 +372,8 @@ task VcfStats {
mkdir -p ~{outputDir} mkdir -p ~{outputDir}
~{preCommand} ~{preCommand}
~{toolCommand} \ ~{toolCommand} \
-I ~{vcfFile} \ -I ~{vcf.file} \
-R ~{refFasta} \ -R ~{reference.fasta} \
-o ~{outputDir} \ -o ~{outputDir} \
-t ~{localThreads} \ -t ~{localThreads} \
~{"--intervals " + intervals} \ ~{"--intervals " + intervals} \
......
task SampleConfig {
input {
File? toolJar
String? preCommand
Array[File]+ inputFiles
String keyFilePath
String? sample
String? library
String? readgroup
String? jsonOutputPath
String? tsvOutputPath
Int memory = 4
Float memoryMultiplier = 2.0
}
String toolCommand = if defined(toolJar)
then "java -Xmx" + memory + "G -jar " +toolJar
else "biopet-sampleconfig -Xmx" + memory + "G"
command {
set -e -o pipefail
~{preCommand}
mkdir -p . ~{"$(dirname " + jsonOutputPath + ")"} ~{"$(dirname " + tsvOutputPath + ")"}
~{toolCommand} \
-i ~{sep="-i " inputFiles} \
~{"--sample " + sample} \
~{"--library " + library} \
~{"--readgroup " + readgroup} \
~{"--jsonOutput " + jsonOutputPath} \
~{"--tsvOutput " + tsvOutputPath} \
> ~{keyFilePath}
}
output {
File keysFile = keyFilePath
File? jsonOutput = jsonOutputPath
File? tsvOutput = tsvOutputPath
}
runtime {
memory: ceil(memory * memoryMultiplier)
}
}
task SampleConfigCromwellArrays {
input {
File? toolJar
String? preCommand
Array[File]+ inputFiles
String outputPath
Int memory = 4
Float memoryMultiplier = 2.0
}
String toolCommand = if defined(toolJar)
then "java -Xmx" + memory + "G -jar " + toolJar
else "biopet-sampleconfig -Xmx" + memory + "G"
command {
set -e -o pipefail
~{preCommand}
mkdir -p $(dirname ~{outputPath})
~{toolCommand} CromwellArrays \
-i ~{sep="-i " inputFiles} \
~{"-o " + outputPath}
}
output {
File outputFile = outputPath
}
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