forked from broadinstitute/warp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
VerifyJointGenotyping.wdl
101 lines (82 loc) · 2.71 KB
/
VerifyJointGenotyping.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
version 1.0
import "../verification/VerifyTasks.wdl" as VerifyTasks
import "../verification/VerifyMetrics.wdl" as MetricsVerification
import "../verification/VerifyGermlineSingleSample.wdl" as GermlineVerification
import "../verification/VerifyNA12878.wdl" as VerifyNA12878
workflow VerifyJointGenotyping {
input {
Array[File] test_vcfs
Array[File] test_vcf_indexes
Array[File] truth_vcfs
Array[File] truth_vcf_indexes
Array[File] test_intervals
Array[File] truth_intervals
Array[File] test_metrics
Array[File] truth_metrics
File? test_fingerprint
File? truth_fingerprint
Boolean? done
}
scatter (idx in range(length(truth_vcfs))) {
call VerifyTasks.CompareVCFsVerbosely {
input:
actual = test_vcfs[idx],
actual_index = test_vcf_indexes[idx],
expected = truth_vcfs[idx],
expected_index = truth_vcf_indexes[idx],
extra_args = "--ignore-attribute VQSLOD --ignore-attribute AS_VQSLOD --ignore-filters --ignore-attribute culprit "
+ " --ignore-attribute AS_culprit --ignore-attribute AS_FilterStatus --ignore-attribute ExcessHet --ignore-attribute AS_SOR "
+"--ignore-attribute AS_FS --ignore-attribute AS_BaseQRankSum --ignore-attribute AS_ReadPosRankSum --ignore-attribute AS_MQRankSum"
}
call GermlineVerification.CompareGvcfs {
input:
test_gvcf = test_vcfs[idx],
truth_gvcf = truth_vcfs[idx]
}
}
call MetricsVerification.VerifyMetrics {
input:
test_metrics = test_metrics,
truth_metrics = truth_metrics
}
call VerifyTasks.CompareTextFiles as CompareIntervals {
input:
test_text_files = test_intervals,
truth_text_files = truth_intervals
}
if (defined(test_fingerprint)){
call CompareFingerprints {
input:
test_fingerprint = select_first([test_fingerprint]),
truth_fingerprint = select_first([truth_fingerprint])
}
}
call VerifyNA12878.VerifyNA12878 {
input:
vcf_files = flatten([test_vcfs, truth_vcfs]),
vcf_file_indexes = flatten([test_vcf_indexes, truth_vcf_indexes]),
vcf_names = ["test","truth"]
}
output {
Array[File]? tables = VerifyNA12878.concordance_tables
}
meta {
allowNestedInputs: true
}
}
task CompareFingerprints {
input {
File test_fingerprint
File truth_fingerprint
}
command {
# We need to strip out the vcf paths because they contain workflow-specific path elements
cmp <(grep -v '^#' ~{test_fingerprint} | 's/gs:\/\/.*\.vcf\.gz//g') <(grep -v '^#' ~{truth_fingerprint} | 's/gs:\/\/.*\.vcf\.gz//g')
}
runtime {
docker: "gcr.io/gcp-runtimes/ubuntu_16_0_4:latest"
disks: "local-disk 10 HDD"
memory: "2 GiB"
preemptible: 3
}
}