-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgathering_and_genotyping.wdl
executable file
·91 lines (76 loc) · 1.87 KB
/
gathering_and_genotyping.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
#WDL gathering GVCFs and genotyping
#Takes list of GVCFs for many samples
#we need to assign samples names and text file for each sample
#listing full path of GVCFs
workflow gatk_variant_calling{
File GVCF_samples_lists
Array[File] gvcfs_all_samples = read_lines(GVCF_samples_lists)
File gatk
File tabix
File refFasta
File refIndex
File refDict
File refAMB
File refANN
File refBWT
File refPAC
File refSA
call MergeVcfs{
input:
gatk = gatk,
tabix = tabix,
refFasta = refFasta,
refIndex = refIndex,
refDict = refDict,
gvcfs_all_samples = gvcfs_all_samples
}
call GenotypeGVCFs {
input:
gatk = gatk,
tabix = tabix,
refFasta = refFasta,
refIndex = refIndex,
refDict = refDict,
merged_gvcfs = MergeVcfs.merged_gvcfs
}
}
task MergeVcfs{
File gatk
File tabix
File refFasta
File refIndex
File refDict
Array[File] gvcfs_all_samples
command {
for file in ${sep=' ' gvcfs_all_samples}; do
filename=$(basename $file)
output_filename=$(echo "$filename" | cut -f 1 -d '.')
java -jar ${gatk} MergeVcfs \
-I $file \
-O $output_filename".vcf"
done
}
output {
Array[File] merged_gvcfs = glob("*.vcf")
}
}
task GenotypeGVCFs{
File gatk
File tabix
File refFasta
File refIndex
File refDict
Array[File] merged_gvcfs
command {
for file in ${sep=' ' merged_gvcfs}; do
filename=$(basename $file)
output_filename=$(echo "$filename" | cut -f 1 -d '.')
java -jar ${gatk} GenotypeGVCFs \
-R ${refFasta} \
-V $file \
-O $output_filename"_genotyped.vcf"
done
}
output {
}
}