-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathblat_runner.wdl
108 lines (87 loc) · 2.81 KB
/
blat_runner.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
102
103
104
105
106
107
108
## Run blat
version 1.0
task blat {
input{
# TASK INPUT PARAMS
File tumorBam
File tumorBamIdx
File MAF
File genome_bit
String pairName
# FILE SIZE
Int tumorBam_size
# RUNTIME INPUT PARAMS
String preemptible ="1"
String diskGB_boot = "15"
String diskGB_buffer = "15"
String machine_memoryGB = "10"
String cpu ="1"
## can also be saved as /opt/hg38.2bit
String refGenome = "hg19"
}
# COMPUTE DISK SIZE
Int diskGB = 2*ceil(tumorBam_size + size(MAF, "G") + size(genome_bit, "G") + diskGB_buffer)
parameter_meta {
tumorBam : "sample tumor BAM file"
tumorBamIdx : "sample tumor BAI file (indexed BAM)"
MAF : "filename pointing to a mutation annotation format (MAF) file (data for somatic point mutations)"
pairName : "tumor sample name, string prefix of the output"
}
command {
set -euxo pipefail
savPath="/opt/${refGenome}.2bit"
cp -v ${genome_bit} $savPath
python /opt/realign.py ${tumorBam} ${MAF} ${pairName}
# Count number of passed and rejected mutations
python /usr/local/bin/count_variants.py "${pairName}.blat.maf" "${pairName}.count_passed_mutations.txt"
python /usr/local/bin/count_variants.py "${pairName}.blat.rejected.maf" "${pairName}.count_rejected_mutations.txt"
# python /usr/local/bin/add_judgement_column.py \
# --input "${pairName}.blat.all.maf" \
# --output "${pairName}.blat.all.with_judgement_annotations.maf" \
# --column "realign_judgment" \
# --pass_flag "KEEP"
}
runtime {
docker : "gcr.io/broad-getzlab-workflows/cga_production_pipeline:v0.2"
bootDiskSizeGb : diskGB_boot
preemptible : preemptible
cpu : cpu
disks : "local-disk ${diskGB} HDD"
memory : machine_memoryGB + "GB"
}
output {
Int num_rejected_mutations=read_int("${pairName}.count_rejected_mutations.txt")
Int num_passed_mutations=read_int("${pairName}.count_passed_mutations.txt")
File passMaf="${pairName}.blat.maf"
File rejectMaf="${pairName}.blat.rejected.maf"
#File allMaf="${pairName}.blat.all.with_judgement_annotations.maf"
}
}
workflow runBlat{
input{
# TASK INPUT PARAMS
File tumorBam
File tumorBamIdx
File MAF
File genome_bit
String pairName
# FILE SIZE
Int tumorBam_size
# RUNTIME INPUT PARAMS
String preemptible
String diskGB_boot
String diskGB_buffer
String memoryGB
String cpu
String refGenome
}
call blat {
input:
tumorBam=tumorBam,
tumorBamIdx=tumorBamIdx,
MAF=MAF,
pairName=pairName,
genome_bit=genome_bit,
tumorBam_size=tumorBam_size
}
}