-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenpipes_level_2.wdl
71 lines (63 loc) · 1.94 KB
/
genpipes_level_2.wdl
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
71
task picard_sam_to_fastq {
Object readset
String CPU = "1"
String RAM = "1G"
command<<<
# note that cromwell knows about runtime and will use these entry to select the right machine
cat << EOF
module load mugqic/java/openjdk-jdk1.8.0_72 mugqic/picard/2.9.0 && \
java -Djava.io.tmpdir=$TMPDIR -XX:+UseParallelGC \
-XX:ParallelGCThreads=${CPU} -Dsamjdk.buffer_size=4194304 -Xmx${RAM} -jar \
$PICARD_HOME/picard.jar SamToFastq \
VALIDATION_STRINGENCY=LENIENT \
INPUT=${readset.bam} \
FASTQ=${readset.name}_pair1.fatsq.gz \
SECOND_END_FASTQ=${readset.name}_pair2.fastq.gz
EOF
# fake pipeline !
echo I am some fake fastq ${readset.name} > ${readset.name}_pair1.fatsq
echo I am some fake fastq ${readset.name} > ${readset.name}_pair2.fastq
>>>
output {
File out1 = "${readset.name}_pair1.fatsq"
File out2 = "${readset.name}_pair2.fastq"
}
}
task sym_link_fastq {
Object readset
String sample
String in1
String in2
command<<<
mkdir -p deliverables/${sample}/wgs/raw_reads && \
ln -sf \
${in1} \
deliverables/${sample}/wgs/raw_reads/${readset.name}.pair1.fastq.gz && \
mkdir -p deliverables/${sample}/wgs/raw_reads && \
ln -sf \
${in2} \
deliverables/${sample}/wgs/raw_reads/${readset.name}.pair2.fastq.gz
>>>
output {
File out1 = "deliverables/${sample}/wgs/raw_reads/${readset.name}.pair1.fastq.gz"
File out2 = "deliverables/${sample}/wgs/raw_reads/${readset.name}.pair2.fastq.gz"
}
}
workflow l2_wf {
String sample
Array[Object] readsets
scatter(readset in readsets) {
call picard_sam_to_fastq{input: readset=readset}
call sym_link_fastq{
input:
readset=readset, sample=sample,
in1=picard_sam_to_fastq.out1,
in2=picard_sam_to_fastq.out2
}
# to be passed to the main wf
output{
Array[File] out1 = picard_sam_to_fastq.out1
Array[File] out2 = picard_sam_to_fastq.out2
}
}
}