-
Notifications
You must be signed in to change notification settings - Fork 1
/
spvcf.wdl
111 lines (91 loc) · 2.32 KB
/
spvcf.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
version 1.0
task spvcf_encode {
input {
File vcf_gz
Boolean multithread = false
String docker = "ghcr.io/mlin/spvcf:v1.3.0"
Int cpu = if multithread then 8 else 4
}
parameter_meta {
vcf_gz: "stream"
}
command <<<
set -euxo pipefail
threads_arg=""
if [ "~{multithread}" == "true" ]; then
threads_arg="--threads 4"
fi
nm=$(basename "~{vcf_gz}" .vcf.gz)
nm="${nm}.spvcf.gz"
mkdir out
bgzip -dc "~{vcf_gz}" | spvcf encode $threads_arg | bgzip -@ 4 > "out/${nm}"
>>>
runtime {
docker: docker
cpu: cpu
memory: "~{cpu} GB"
disks: "local-disk ~{ceil(size(vcf_gz,'GB'))} SSD"
}
output {
File spvcf_gz = glob("out/*.gz")[0]
}
}
task spvcf_decode {
input {
File spvcf_gz
Boolean with_missing_fields = false
String docker = "ghcr.io/mlin/spvcf:v1.3.0"
}
parameter_meta {
spvcf_gz: "stream"
}
command <<<
set -euxo pipefail
nm=$(basename "~{spvcf_gz}" .spvcf.gz)
nm="${nm}.vcf.gz"
mkdir out
bgzip -dc "~{spvcf_gz}" \
| spvcf decode ~{if with_missing_fields then "--with-missing-fields" else ""} \
| bgzip -@ 4 > "out/${nm}"
>>>
runtime {
docker: docker
cpu: 4
memory: "4 GB"
disks: "local-disk ~{10*ceil(size(spvcf_gz,'GB'))} SSD"
}
output {
File vcf_gz = glob("out/*.gz")[0]
}
}
task spvcf_squeeze {
input {
File vcf_gz
Boolean multithread = false
String docker = "ghcr.io/mlin/spvcf:v1.3.0"
Int cpu = if multithread then 8 else 4
}
parameter_meta {
vcf_gz: "stream"
}
command <<<
set -euxo pipefail
threads_arg=""
if [ "~{multithread}" == "true" ]; then
threads_arg="--threads 4"
fi
nm=$(basename "~{vcf_gz}" .vcf.gz)
nm="${nm}.squeeze.vcf.gz"
mkdir out
bgzip -dc "~{vcf_gz}" | spvcf squeeze $threads_arg | bgzip -@ 4 > "out/${nm}"
>>>
runtime {
docker: docker
cpu: cpu
memory: "~{cpu} GB"
disks: "local-disk ~{ceil(size(vcf_gz,'GB'))} SSD"
}
output {
File squeeze_vcf_gz = glob("out/*.gz")[0]
}
}