forked from biowdl/tasks
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstar.wdl
More file actions
70 lines (61 loc) · 2.02 KB
/
Copy pathstar.wdl
File metadata and controls
70 lines (61 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
version 1.0
task Star {
input {
Array[File]+ inputR1
Array[File]? inputR2
Array[File]+ indexFiles
String outFileNamePrefix
String outSAMtype = "BAM SortedByCoordinate"
String readFilesCommand = "zcat"
String? outStd
String? twopassMode = "Basic"
Array[String]? outSAMattrRGline
String? outSAMunmapped = "Within KeepPairs"
Int? limitBAMsortRAM
Int runThreadN = 4
Int memory = 48
String dockerImage = "quay.io/biocontainers/star:2.6.0c--0"
}
#TODO Needs to be extended for all possible output extensions
Map[String, String] samOutputNames = {"BAM SortedByCoordinate": "sortedByCoord.out.bam"}
command {
set -e
mkdir -p $(dirname ~{outFileNamePrefix})
STAR \
--readFilesIn ~{sep=',' inputR1} ~{sep="," inputR2} \
--outFileNamePrefix ~{outFileNamePrefix} \
--genomeDir ~{sub(indexFiles[0], basename(indexFiles[0]), "")} \
--outSAMtype ~{outSAMtype} \
--readFilesCommand ~{readFilesCommand} \
~{"--outSAMunmapped " + outSAMunmapped} \
~{"--runThreadN " + runThreadN} \
~{"--outStd " + outStd} \
~{"--twopassMode " + twopassMode} \
~{"--limitBAMsortRAM " + limitBAMsortRAM} \
~{true="--outSAMattrRGline " false="" defined(outSAMattrRGline)} ~{sep=" , " outSAMattrRGline}
}
output {
File bamFile = outFileNamePrefix + "Aligned." + samOutputNames[outSAMtype]
}
runtime {
cpu: runThreadN
# Return memory per CPU here due to SGE backend.
# Can also work with slurms mem-per-cpu flag
memory: (memory / runThreadN) + 1
docker: dockerImage
}
}
task MakeStarRGline {
input {
String sample
String library
String platform = "ILLUMINA"
String readgroup
}
command {
printf '"ID:~{readgroup}" "LB:~{library}" "PL:~{platform}" "SM:~{sample}"'
}
output {
String rgLine = read_string(stdout())
}
}