diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..9f11b755a17d8192c60f61cb17b8902dffbd9f23 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea/ diff --git a/star.wdl b/star.wdl new file mode 100644 index 0000000000000000000000000000000000000000..8aceb354ff858033dbf39f3fb586587bc8292112 --- /dev/null +++ b/star.wdl @@ -0,0 +1,42 @@ +task Star { + String? preCommand + + Array[File] inputR1 + Array[File]? inputR2 + String genomeDir + String outFileNamePrefix + + String? outSAMtype = "BAM SortedByCoordinate" + String? readFilesCommand = "zcat" + Int? runThreadN + String? outStd + String? twopassMode + Array[String]? outSAMattrRGline + + #TODO needs to be extended for all possible output extensions + Map[String, String] samOutputNames = {"BAM SortedByCoordinate": "sortedByCoord.out.bam"} + + command { + set -e -o pipefail + mkdir -p ${sub(outFileNamePrefix, basename(outFileNamePrefix) + "$", "")} + ${preCommand} + STAR \ + --readFilesIn ${sep=',' inputR1} ${sep="," inputR2} \ + --outFileNamePrefix ${outFileNamePrefix} \ + --genomeDir ${genomeDir} \ + ${"--readFilesCommand " + readFilesCommand} \ + ${"--outSAMtype " + outSAMtype} \ + ${"--runThreadN " + runThreadN} \ + ${"--outStd " + outStd} \ + ${"--twopassMode " + twopassMode} \ + ${true="--outSAMattrRGline " false="" defined(outSAMattrRGline)} ${sep=" , " outSAMattrRGline} + } + + output { + File bamFile = outFileNamePrefix + "Aligned." + samOutputNames["${outSAMtype}"] + } + + runtime { + threads: runThreadN + } +} \ No newline at end of file