-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmerge_vcfs.wdl
executable file
·50 lines (42 loc) · 1.05 KB
/
merge_vcfs.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
#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 mergevcfs{
File VCF_samples_lists
Array[File] vcfs_all_samples = read_lines(VCF_samples_lists)
File gatk
File tabix
File refFasta
File refIndex
File refDict
call MergeVcfs{
input:
gatk = gatk,
tabix = tabix,
refFasta = refFasta,
refIndex = refIndex,
refDict = refDict,
vcfs_all_samples = vcfs_all_samples
}
}
task MergeVcfs{
File gatk
File tabix
File refFasta
File refIndex
File refDict
Array[File] vcfs_all_samples
command {
for file in ${sep=' ' vcfs_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")
}
}