Skip to content
Snippets Groups Projects
Commit 3d8b32b2 authored by Ruben Vorderman's avatar Ruben Vorderman
Browse files

added stylish newlines

parent 7d5b7928
No related branches found
No related tags found
1 merge request!34Move all files to version 1.0
...@@ -9,6 +9,7 @@ task installPrefix { ...@@ -9,6 +9,7 @@ task installPrefix {
String prefix String prefix
String? condaPath String? condaPath
} }
command <<< command <<<
~{default="conda" condaPath} create \ ~{default="conda" condaPath} create \
--json -q \ --json -q \
...@@ -21,6 +22,7 @@ task installPrefix { ...@@ -21,6 +22,7 @@ task installPrefix {
--prefix ${prefix} \ --prefix ${prefix} \
~{sep=' ' requirements} ~{sep=' ' requirements}
>>> >>>
output { output {
File condaEnvPath=prefix File condaEnvPath=prefix
File condaJson=stdout() File condaJson=stdout()
......
...@@ -89,6 +89,7 @@ task ExtractAdaptersFastqc { ...@@ -89,6 +89,7 @@ task ExtractAdaptersFastqc {
Float? memory Float? memory
Float? memoryMultiplier Float? memoryMultiplier
} }
Int mem = ceil(select_first([memory, 4.0])) Int mem = ceil(select_first([memory, 4.0]))
String toolCommand = if defined(toolJar) String toolCommand = if defined(toolJar)
...@@ -174,6 +175,7 @@ task FastqSync { ...@@ -174,6 +175,7 @@ task FastqSync {
Float? memory Float? memory
Float? memoryMultiplier Float? memoryMultiplier
} }
Int mem = ceil(select_first([memory, 4.0])) Int mem = ceil(select_first([memory, 4.0]))
String toolCommand = if defined(toolJar) String toolCommand = if defined(toolJar)
...@@ -297,6 +299,7 @@ task Seqstat { ...@@ -297,6 +299,7 @@ task Seqstat {
Float? memory Float? memory
Float? memoryMultiplier Float? memoryMultiplier
} }
Int mem = ceil(select_first([memory, 4.0])) Int mem = ceil(select_first([memory, 4.0]))
String toolCommand = if defined(toolJar) String toolCommand = if defined(toolJar)
...@@ -331,6 +334,7 @@ task ValidateAnnotation { ...@@ -331,6 +334,7 @@ task ValidateAnnotation {
Float? memory Float? memory
Float? memoryMultiplier Float? memoryMultiplier
} }
Int mem = ceil(select_first([memory, 4.0])) Int mem = ceil(select_first([memory, 4.0]))
String toolCommand = if defined(toolJar) String toolCommand = if defined(toolJar)
...@@ -365,6 +369,7 @@ task ValidateFastq { ...@@ -365,6 +369,7 @@ task ValidateFastq {
Float? memory Float? memory
Float? memoryMultiplier Float? memoryMultiplier
} }
Int mem = ceil(select_first([memory, 4.0])) Int mem = ceil(select_first([memory, 4.0]))
String toolCommand = if defined(toolJar) String toolCommand = if defined(toolJar)
...@@ -398,6 +403,7 @@ task ValidateVcf { ...@@ -398,6 +403,7 @@ task ValidateVcf {
Float? memory Float? memory
Float? memoryMultiplier Float? memoryMultiplier
} }
Int mem = ceil(select_first([memory, 4.0])) Int mem = ceil(select_first([memory, 4.0]))
String toolCommand = if defined(toolJar) String toolCommand = if defined(toolJar)
......
...@@ -26,6 +26,7 @@ task mem { ...@@ -26,6 +26,7 @@ task mem {
output { output {
File bamFile = outputPath File bamFile = outputPath
} }
runtime{ runtime{
cpu: select_first([threads,1]) cpu: select_first([threads,1])
memory: select_first([memory,8]) memory: select_first([memory,8])
...@@ -62,6 +63,7 @@ task index { ...@@ -62,6 +63,7 @@ task index {
File indexedFasta = outputFile File indexedFasta = outputFile
Array[File] indexFiles = [outputFile + ".bwt",outputFile + ".pac",outputFile + ".sa",outputFile + ".amb",outputFile + ".ann"] Array[File] indexFiles = [outputFile + ".bwt",outputFile + ".pac",outputFile + ".sa",outputFile + ".amb",outputFile + ".ann"]
} }
parameter_meta { parameter_meta {
fasta: "Fasta file to be indexed" fasta: "Fasta file to be indexed"
constructionAlgorithm: "-a STR BWT construction algorithm: bwtsw, is or rb2 [auto]" constructionAlgorithm: "-a STR BWT construction algorithm: bwtsw, is or rb2 [auto]"
......
...@@ -28,6 +28,7 @@ task Build { ...@@ -28,6 +28,7 @@ task Build {
Int? threads Int? threads
Int? memory Int? memory
} }
command { command {
set -e -o pipefail set -e -o pipefail
~{preCommand} ~{preCommand}
...@@ -52,6 +53,7 @@ task Build { ...@@ -52,6 +53,7 @@ task Build {
~{inputFasta} \ ~{inputFasta} \
~{centrifugeIndexBase} ~{centrifugeIndexBase}
} }
runtime { runtime {
cpu: select_first([threads, 8]) cpu: select_first([threads, 8])
memory: select_first([memory, 20]) memory: select_first([memory, 20])
...@@ -136,6 +138,7 @@ task Download { ...@@ -136,6 +138,7 @@ task Download {
Boolean? modifyHeader = false Boolean? modifyHeader = false
Boolean? downloadGiMap = false Boolean? downloadGiMap = false
} }
# This will use centrifuge-download to download. # This will use centrifuge-download to download.
# The bash statement at the beginning is to make sure # The bash statement at the beginning is to make sure
# the directory for the SeqTaxMapPath exists. # the directory for the SeqTaxMapPath exists.
...@@ -201,6 +204,7 @@ task Kreport { ...@@ -201,6 +204,7 @@ task Kreport {
Int? cores Int? cores
Int? memory Int? memory
} }
String kreportFilePath = outputDir + "/" + prefix + "." + suffix String kreportFilePath = outputDir + "/" + prefix + "." + suffix
command { command {
set -e -o pipefail set -e -o pipefail
......
...@@ -5,6 +5,7 @@ task AppendToStringArray { ...@@ -5,6 +5,7 @@ task AppendToStringArray {
Array[String] array Array[String] array
String string String string
} }
command { command {
echo "~{sep='\n' array} echo "~{sep='\n' array}
~{string}" ~{string}"
...@@ -25,6 +26,7 @@ task CheckFileMD5 { ...@@ -25,6 +26,7 @@ task CheckFileMD5 {
File file File file
String MD5sum String MD5sum
} }
command { command {
set -e -o pipefail set -e -o pipefail
MD5SUM=$(md5sum ~{file} | cut -d ' ' -f 1) MD5SUM=$(md5sum ~{file} | cut -d ' ' -f 1)
...@@ -39,6 +41,7 @@ task ConcatenateTextFiles { ...@@ -39,6 +41,7 @@ task ConcatenateTextFiles {
Boolean? unzip = false Boolean? unzip = false
Boolean? zip = false Boolean? zip = false
} }
command { command {
set -e -o pipefail set -e -o pipefail
~{"mkdir -p $(dirname " + combinedFilePath + ")"} ~{"mkdir -p $(dirname " + combinedFilePath + ")"}
...@@ -62,6 +65,7 @@ task CreateLink { ...@@ -62,6 +65,7 @@ task CreateLink {
String inputFile String inputFile
String outputPath String outputPath
} }
command { command {
ln -sf ~{inputFile} ~{outputPath} ln -sf ~{inputFile} ~{outputPath}
} }
...@@ -98,6 +102,7 @@ task ObjectMd5 { ...@@ -98,6 +102,7 @@ task ObjectMd5 {
input { input {
Object the_object Object the_object
} }
command { command {
cat ~{write_object(the_object)} | md5sum - | sed -e 's/ -//' cat ~{write_object(the_object)} | md5sum - | sed -e 's/ -//'
} }
...@@ -115,6 +120,7 @@ task StringArrayMd5 { ...@@ -115,6 +120,7 @@ task StringArrayMd5 {
input { input {
Array[String] stringArray Array[String] stringArray
} }
command { command {
set -eu -o pipefail set -eu -o pipefail
echo ~{sep=',' stringArray} | md5sum - | sed -e 's/ -//' echo ~{sep=',' stringArray} | md5sum - | sed -e 's/ -//'
......
...@@ -60,6 +60,7 @@ task cutadapt { ...@@ -60,6 +60,7 @@ task cutadapt {
Boolean? noZeroCap Boolean? noZeroCap
String? reportPath String? reportPath
} }
command { command {
set -e -o pipefail set -e -o pipefail
~{"mkdir -p $(dirname " + read1output + ")"} ~{"mkdir -p $(dirname " + read1output + ")"}
...@@ -107,6 +108,7 @@ task cutadapt { ...@@ -107,6 +108,7 @@ task cutadapt {
~{true="--zero-cap" false="" zeroCap} ~{true="--no-zero-cap" false="" noZeroCap} \ ~{true="--zero-cap" false="" zeroCap} ~{true="--no-zero-cap" false="" noZeroCap} \
~{read1} ~{read2} ~{"> " + reportPath} ~{read1} ~{read2} ~{"> " + reportPath}
} }
output{ output{
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 cutRead1 = read1output
...@@ -121,6 +123,7 @@ task cutadapt { ...@@ -121,6 +123,7 @@ task cutadapt {
File? restFile=restFilePath File? restFile=restFilePath
File? wildcardFile=wildcardFilePath File? wildcardFile=wildcardFilePath
} }
runtime { runtime {
cpu: select_first([cores]) cpu: select_first([cores])
memory: select_first([memory]) memory: select_first([memory])
......
...@@ -19,6 +19,7 @@ task fastqc { ...@@ -19,6 +19,7 @@ task fastqc {
Int? kmers Int? kmers
String? dir String? dir
} }
# Chops of the .gz extension if present. # Chops of the .gz extension if present.
String name = sub(seqFile, "\\.gz$","") String name = sub(seqFile, "\\.gz$","")
# This regex chops of the extension and replaces it with _fastqc for the reportdir. # This regex chops of the extension and replaces it with _fastqc for the reportdir.
...@@ -64,6 +65,7 @@ task getConfiguration { ...@@ -64,6 +65,7 @@ task getConfiguration {
String? preCommand String? preCommand
String? fastqcDirFile = "fastqcDir.txt" String? fastqcDirFile = "fastqcDir.txt"
} }
command { command {
set -e -o pipefail set -e -o pipefail
~{preCommand} ~{preCommand}
......
...@@ -272,6 +272,7 @@ task HaplotypeCallerGvcf { ...@@ -272,6 +272,7 @@ task HaplotypeCallerGvcf {
Float? memory Float? memory
Float? memoryMultiplier Float? memoryMultiplier
} }
Int mem = ceil(select_first([memory, 4.0])) Int mem = ceil(select_first([memory, 4.0]))
String toolCommand = if defined(gatkJar) String toolCommand = if defined(gatkJar)
...@@ -318,6 +319,7 @@ task SplitNCigarReads { ...@@ -318,6 +319,7 @@ task SplitNCigarReads {
Float? memory Float? memory
Float? memoryMultiplier Float? memoryMultiplier
} }
Int mem = ceil(select_first([memory, 4.0])) Int mem = ceil(select_first([memory, 4.0]))
String toolCommand = if defined(gatkJar) String toolCommand = if defined(gatkJar)
......
...@@ -10,6 +10,7 @@ task PeakCalling { ...@@ -10,6 +10,7 @@ task PeakCalling {
Int? memory Int? memory
Boolean? nomodel Boolean? nomodel
} }
command { command {
set -e -o pipefail set -e -o pipefail
~{preCommand} ~{preCommand}
......
...@@ -10,6 +10,7 @@ task MergeCounts { ...@@ -10,6 +10,7 @@ task MergeCounts {
Int valueColumn Int valueColumn
Boolean inputHasHeader Boolean inputHasHeader
} }
# Based on a script by Szymon Kielbasa/Ioannis Moustakas # Based on a script by Szymon Kielbasa/Ioannis Moustakas
command <<< command <<<
set -e -o pipefail set -e -o pipefail
......
...@@ -19,6 +19,7 @@ task genomeDownload { ...@@ -19,6 +19,7 @@ task genomeDownload {
String? executable = "ncbi-genome-download" String? executable = "ncbi-genome-download"
String? preCommand String? preCommand
} }
command { command {
set -e -o pipefail set -e -o pipefail
~{preCommand} ~{preCommand}
...@@ -79,6 +80,7 @@ task downloadNtFasta{ ...@@ -79,6 +80,7 @@ task downloadNtFasta{
String ntDir = libraryPath + "/nt" String ntDir = libraryPath + "/nt"
String ntFilePath = ntDir + "/nt.fna" String ntFilePath = ntDir + "/nt.fna"
} }
command { command {
set -e -o pipefail set -e -o pipefail
mkdir -p ~{ntDir} mkdir -p ~{ntDir}
...@@ -105,6 +107,7 @@ task downloadAccessionToTaxId { ...@@ -105,6 +107,7 @@ task downloadAccessionToTaxId {
String downloadDir String downloadDir
Boolean gzip = false Boolean gzip = false
} }
command { command {
set -e -o pipefail set -e -o pipefail
mkdir -p ~{downloadDir} mkdir -p ~{downloadDir}
......
...@@ -27,6 +27,7 @@ task CollectMultipleMetrics { ...@@ -27,6 +27,7 @@ task CollectMultipleMetrics {
Float? memory Float? memory
Float? memoryMultiplier Float? memoryMultiplier
} }
Int mem = ceil(select_first([memory, 4.0])) Int mem = ceil(select_first([memory, 4.0]))
String toolCommand = if defined(picardJar) String toolCommand = if defined(picardJar)
...@@ -94,6 +95,7 @@ task CollectRnaSeqMetrics { ...@@ -94,6 +95,7 @@ task CollectRnaSeqMetrics {
Float? memory Float? memory
Float? memoryMultiplier Float? memoryMultiplier
} }
Int mem = ceil(select_first([memory, 4.0])) Int mem = ceil(select_first([memory, 4.0]))
String toolCommand = if defined(picardJar) String toolCommand = if defined(picardJar)
...@@ -231,8 +233,8 @@ task MarkDuplicates { ...@@ -231,8 +233,8 @@ task MarkDuplicates {
# Sometimes we wish to supply "null" in order to turn off optical duplicate detection # Sometimes we wish to supply "null" in order to turn off optical duplicate detection
# This can be desirable if you don't mind the estimated library size being wrong and optical duplicate detection is taking >7 days and failing # This can be desirable if you don't mind the estimated library size being wrong and optical duplicate detection is taking >7 days and failing
String? read_name_regex String? read_name_regex
} }
# Task is assuming query-sorted input so that the Secondary and Supplementary reads get marked correctly # Task is assuming query-sorted input so that the Secondary and Supplementary reads get marked correctly
# This works because the output of BWA is query-grouped and therefore, so is the output of MergeBamAlignment. # This works because the output of BWA is query-grouped and therefore, so is the output of MergeBamAlignment.
# While query-grouped isn't actually query-sorted, it's good enough for MarkDuplicates with ASSUME_SORT_ORDER="queryname" # While query-grouped isn't actually query-sorted, it's good enough for MarkDuplicates with ASSUME_SORT_ORDER="queryname"
...@@ -283,6 +285,7 @@ task MergeVCFs { ...@@ -283,6 +285,7 @@ task MergeVCFs {
Float? memory Float? memory
Float? memoryMultiplier Float? memoryMultiplier
} }
# Using MergeVcfs instead of GatherVcfs so we can create indices # Using MergeVcfs instead of GatherVcfs so we can create indices
# See https://github.com/broadinstitute/picard/issues/789 for relevant GatherVcfs ticket # See https://github.com/broadinstitute/picard/issues/789 for relevant GatherVcfs ticket
Int mem = ceil(select_first([memory, 4.0])) Int mem = ceil(select_first([memory, 4.0]))
...@@ -321,6 +324,7 @@ task SamToFastq { ...@@ -321,6 +324,7 @@ task SamToFastq {
Float? memory Float? memory
Float? memoryMultiplier Float? memoryMultiplier
} }
Int mem = ceil(select_first([memory, 16.0])) # High memory default to avoid crashes. Int mem = ceil(select_first([memory, 16.0])) # High memory default to avoid crashes.
String toolCommand = if defined(picardJar) String toolCommand = if defined(picardJar)
...@@ -359,6 +363,7 @@ task ScatterIntervalList { ...@@ -359,6 +363,7 @@ task ScatterIntervalList {
Float? memory Float? memory
Float? memoryMultiplier Float? memoryMultiplier
} }
Int mem = ceil(select_first([memory, 4.0])) Int mem = ceil(select_first([memory, 4.0]))
String toolCommand = if defined(picardJar) String toolCommand = if defined(picardJar)
......
...@@ -6,6 +6,7 @@ task Index { ...@@ -6,6 +6,7 @@ task Index {
File bamFilePath File bamFilePath
String? bamIndexPath String? bamIndexPath
} }
command { command {
set -e -o pipefail set -e -o pipefail
~{preCommand} ~{preCommand}
...@@ -23,6 +24,7 @@ task Merge { ...@@ -23,6 +24,7 @@ task Merge {
Array[File]+ bamFiles Array[File]+ bamFiles
String outputBamPath String outputBamPath
} }
command { command {
set -e -o pipefail set -e -o pipefail
~{preCommand} ~{preCommand}
...@@ -104,15 +106,18 @@ task fastq { ...@@ -104,15 +106,18 @@ task fastq {
~{"--threads " + totalThreads} \ ~{"--threads " + totalThreads} \
~{inputBam} ~{inputBam}
} }
output { output {
File read1 = outputRead1 File read1 = outputRead1
File? read2 = outputRead2 File? read2 = outputRead2
File? read0 = outputRead0 File? read0 = outputRead0
} }
runtime { runtime {
cpu: totalThreads cpu: totalThreads
memory: select_first([memory, 1]) memory: select_first([memory, 1])
} }
parameter_meta { parameter_meta {
preCommand: "A command that is run before the task. Can be used to activate environments" preCommand: "A command that is run before the task. Can be used to activate environments"
inputBam: "The bam file to process." inputBam: "The bam file to process."
......
...@@ -13,17 +13,18 @@ task sample { ...@@ -13,17 +13,18 @@ task sample {
} }
command { command {
set -e -o pipefail set -e -o pipefail
~{'mkdir -p $(dirname ' + outFilePath + ')'} ~{'mkdir -p $(dirname ' + outFilePath + ')'}
~{preCommand} ~{preCommand}
seqtk sample \ seqtk sample \
~{"-s " + seed} \ ~{"-s " + seed} \
~{true="-2 " false="" twoPassMode} \ ~{true="-2 " false="" twoPassMode} \
~{sequenceFile} \ ~{sequenceFile} \
~{number} ~{fraction} \ ~{number} ~{fraction} \
~{true="| gzip" false="" zip} \ ~{true="| gzip" false="" zip} \
~{"> " + outFilePath} ~{"> " + outFilePath}
} }
output { output {
File subsampledReads= select_first([outFilePath]) File subsampledReads= select_first([outFilePath])
} }
......
...@@ -31,6 +31,7 @@ task spades { ...@@ -31,6 +31,7 @@ task spades {
Float? covCutoff Float? covCutoff
Int? phredOffset Int? phredOffset
} }
Int finalThreads = select_first([threads]) Int finalThreads = select_first([threads])
Float totalMemory = select_first([memoryGb, finalThreads * 16.0]) Float totalMemory = select_first([memoryGb, finalThreads * 16.0])
Int finalMemory = ceil(totalMemory) Int finalMemory = ceil(totalMemory)
...@@ -67,6 +68,7 @@ task spades { ...@@ -67,6 +68,7 @@ task spades {
~{"--cov-cutoff " + covCutoff } \ ~{"--cov-cutoff " + covCutoff } \
~{"--phred-offset " + phredOffset } ~{"--phred-offset " + phredOffset }
} }
output { output {
Array[File] correctedReads = glob(outputDir + "/corrected/*.fastq*") Array[File] correctedReads = glob(outputDir + "/corrected/*.fastq*")
File scaffolds = outputDir + "/scaffolds.fasta" File scaffolds = outputDir + "/scaffolds.fasta"
...@@ -78,6 +80,7 @@ task spades { ...@@ -78,6 +80,7 @@ task spades {
File params = outputDir + "/params.txt" File params = outputDir + "/params.txt"
File log = outputDir + "/spades.log" File log = outputDir + "/spades.log"
} }
runtime { runtime {
cpu: finalThreads cpu: finalThreads
memory: clusterMemory memory: clusterMemory
......
...@@ -60,6 +60,7 @@ task makeStarRGline { ...@@ -60,6 +60,7 @@ task makeStarRGline {
String? platform String? platform
String readgroup String readgroup
} }
command { command {
printf '"ID:~{readgroup}" "LB:~{library}" "PL:~{default="ILLUMINA" platform}" "SM:~{sample}"' printf '"ID:~{readgroup}" "LB:~{library}" "PL:~{default="ILLUMINA" platform}" "SM:~{sample}"'
} }
......
...@@ -46,6 +46,7 @@ task unicycler { ...@@ -46,6 +46,7 @@ task unicycler {
String? scores String? scores
String? lowScore String? lowScore
} }
command { command {
set -e -o pipefail set -e -o pipefail
mkdir -p ~{out} mkdir -p ~{out}
...@@ -92,11 +93,13 @@ task unicycler { ...@@ -92,11 +93,13 @@ task unicycler {
~{"--scores " + scores } \ ~{"--scores " + scores } \
~{"--low_score " + lowScore } ~{"--low_score " + lowScore }
} }
output { output {
File assemblyFasta = out + "/assembly.fasta" File assemblyFasta = out + "/assembly.fasta"
File assemblyGfa = out + "/assembly.gfa" File assemblyGfa = out + "/assembly.gfa"
File log = out + "/unicycler.log" File log = out + "/unicycler.log"
} }
runtime { runtime {
cpu: select_first([threads]) cpu: select_first([threads])
memory: select_first([memory]) memory: select_first([memory])
......
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