-
Notifications
You must be signed in to change notification settings - Fork 1
/
recode-plink-split-vcf.wdl
76 lines (66 loc) · 1.29 KB
/
recode-plink-split-vcf.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
task plink {
File bim
File fam
File bed
String basename
command <<<
mkdir bfiles
mv ${bim} bfiles/
mv ${bed} bfiles/
mv ${fam} bfiles/
plink --bfile bfiles/${basename} --recode vcf --out ${basename}
>>>
runtime {
disks: "local-disk 100 HDD"
memory: "32 GB"
docker: "jrose77/plinkdocker"
}
output {
File out_vcf = "${basename}.vcf"
}
}
task split_vcf {
Int chr
File in_vcf
String basename
command <<<
mkdir in_files/
mv ${in_vcf} in_files/
cd in_files && bgzip ${basename}.vcf && bcftools index ${basename}.vcf.gz && cd ..
bcftools view -r ${chr} in_files/${basename}.vcf.gz| bgzip >chr${chr}.vcf.gz
bcftools index chr${chr}.vcf.gz
>>>
runtime {
disks: "local-disk 100 HDD"
memory: "32 GB"
docker: "vandhanak/bcftools:1.3.1"
}
output {
File chr_vcf = "chr${chr}.vcf.gz"
File chr_vcf_ind = "chr${chr}.vcf.gz.csi"
}
}
workflow plink_workflow {
String basename
Int chr
File bim
File fam
File bed
call plink {
input:
basename=basename,
bim=bim,
fam=fam,
bed=bed
}
call split_vcf {
input:
in_vcf=plink.out_vcf,
chr=chr,
basename=basename
}
output {
File chr_vcf=split_vcf.chr_vcf
File chr_vcf_ind=split_vcf.chr_vcf_ind
}
}