-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwhatshap_phase.wdl
58 lines (45 loc) · 1.33 KB
/
whatshap_phase.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
version 1.0
# Phase a VCF using WhatsHap
import "../structs.wdl"
task whatshap_phase {
input {
File vcf
File vcf_index
String? chromosome
Array[File] aligned_bams
Array[File] aligned_bam_indices
File reference
File reference_index
RuntimeAttributes runtime_attributes
}
String vcf_basename = basename(vcf, ".vcf.gz")
Int disk_size = ceil((size(vcf, "GB") + size(reference, "GB") + size(aligned_bams[0], "GB") * length(aligned_bams)) * 2 + 20)
command <<<
set -euo pipefail
whatshap --version
whatshap phase \
--indels \
--reference ~{reference} \
~{"--chromosome " + chromosome} \
--output ~{vcf_basename}.phased.vcf.gz \
~{vcf} \
~{sep=' ' aligned_bams}
tabix ~{vcf_basename}.phased.vcf.gz
>>>
output {
File phased_vcf = "~{vcf_basename}.phased.vcf.gz"
File phased_vcf_index = "~{vcf_basename}.phased.vcf.gz.tbi"
}
runtime {
docker: "~{runtime_attributes.container_registry}/whatshap@sha256:34957019d127e9c9c888a38061b28af8c1a42ec9e131bf1b806f70c6e96a1fca"
cpu: 2
memory: "8 GB"
disk: disk_size + " GB"
disks: "local-disk " + disk_size + " HDD"
preemptible: runtime_attributes.preemptible_tries
maxRetries: runtime_attributes.max_retries
awsBatchRetryAttempts: runtime_attributes.max_retries
queueArn: runtime_attributes.queue_arn
zones: runtime_attributes.zones
}
}