-
Notifications
You must be signed in to change notification settings - Fork 118
Expand file tree
/
Copy pathStargazerFromJointVCF.wdl
More file actions
132 lines (111 loc) · 3.79 KB
/
Copy pathStargazerFromJointVCF.wdl
File metadata and controls
132 lines (111 loc) · 3.79 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
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
version 1.0
workflow StargazerFromJointVCF {
input {
File inputVCF
File inputVCF_index
String sample_name
String outputVCFname = sample_name + ".pgx_genotyped.vcf.gz"
Array[String] gene_names
File ref_fasta
File ref_fasta_index
File ref_dict
Int? disk_size
}
String pipeline_version = "aou_9.0.0"
call SelectVariants {
input:
inputVCF = inputVCF,
inputVCFindex = inputVCF_index,
outputVCFname = outputVCFname,
disk_size = disk_size,
sample_name = sample_name
}
call RunStargazer {
input:
input_vcf = SelectVariants.output_vcf,
input_vcf_index = SelectVariants.output_vcf_index,
ref_fasta = ref_fasta,
ref_fasta_index = ref_fasta_index,
sample_name = sample_name,
gene_names = gene_names
}
call RunStargazer as Stargazer_DPYD {
input:
input_vcf = SelectVariants.output_vcf,
input_vcf_index = SelectVariants.output_vcf_index,
ref_fasta = ref_fasta,
ref_fasta_index = ref_fasta_index,
sample_name = sample_name,
gene_names = ['dpyd'],
memory_in_mb = 7500
}
output {
Array[File] stargazer_details = flatten([RunStargazer.stargazer_details, Stargazer_DPYD.stargazer_details])
}
}
task RunStargazer {
input {
File input_vcf
File input_vcf_index
File ref_fasta
File ref_fasta_index
String sample_name
Array[String] gene_names
File? panel_vcf_override
String? stargazer_docker
Int? memory_in_mb
}
command <<<
set -euxo pipefail
~{if defined(panel_vcf_override) then "mv " + panel_vcf_override + " /stargazer-grc38-v.2.0.2/stargazer/1kgp_vcf/grc38/" else ""}
# Create REF_CACHE. Used when indexing a CRAM
/usr/bin/seq_cache_populate.pl -root ./ref/cache ~{ref_fasta} > /dev/null #don't clog the log with 3600 contig names
export REF_PATH=:
export REF_CACHE=./ref/cache/%2s/%2s/%s
gene_names_array=(~{sep=" " gene_names})
for gene_name in ${gene_names_array[@]}; do
python /stargazer-grc38-v.2.0.2/stargazer -t ${gene_name} -o ~{sample_name}_${gene_name} -i ~{input_vcf} -a grc38
mv ~{sample_name}_${gene_name}/report.tsv ~{sample_name}_${gene_name}_report.tsv
mv ~{sample_name}_${gene_name}/genotype-calls.tsv ~{sample_name}_${gene_name}_genotype-calls.tsv
done
>>>
output {
Array[File] stargazer_output = glob("~{sample_name}_*_report.tsv")
Array[File] stargazer_details = glob("~{sample_name}_*_genotype-calls.tsv")
}
runtime {
memory: select_first([memory_in_mb, 3750]) + " MiB"
disks: "local-disk 100 HDD"
disk: "100 GB"
bootDiskSizeGb: 15
preemptible: 3
docker: select_first([stargazer_docker, "us.gcr.io/broad-dsde-methods/stargazer:latest"])
}
}
task SelectVariants {
input {
File inputVCF
File inputVCFindex
String outputVCFname
String sample_name
Int? disk_size = 100
}
parameter_meta{
inputVCF: {localization_optional: true}
inputVCFindex: {localization_optional: true}
}
command <<<
set -euxo pipefail
/gatk/gatk SelectVariants -V ~{inputVCF} -sn ~{sample_name} -O ~{outputVCFname}
>>>
runtime {
memory: "7 GB"
cpu: 1
disks: "local-disk " + disk_size + " HDD"
docker: "us.gcr.io/broad-gatk/gatk:4.4.0.0"
}
output {
File output_vcf = "~{outputVCFname}"
File output_vcf_index = "~{outputVCFname}.tbi"
}
}