-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgatk_compute_ratios.scr
executable file
·74 lines (61 loc) · 1.81 KB
/
gatk_compute_ratios.scr
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
#!/bin/sh
#$ -cwd
# -l mem=5G,time=4::
# This step in the pipeline computes the transition to transversion ratio of the variants.
GLOBAL="global_config.sh"
if [[ -e $GLOBAL ]]
then
. $GLOBAL
else
echo "Global config file not found. Exiting."
exit 1
fi
USAGE="Usage: $0 -I <Input bam file> -R <Reference fasta> -D <DBSNP file>"
while getopts I:D:R:h o
do case "$o" in
I) INP="$OPTARG";;
D) DBSNP="$OPTARG";;
R) REF="$OPTARG";;
h) echo $USAGE
exit 1;;
esac
done
if [[ $INP == "" || $REF == "" || $DBSNP == "" ]]
then
echo $USAGE
exit 1
fi
DATAPATH=`dirname "$INP"`
$GATK \
-R $REF \
-T CombineVariants \
-variantMergeOptions UNION \
-B:raw,VCF $INP.snps.raw.vcf \
-B:filtered,VCF $INP.snps.filtered.vcf \
-priority raw,filtered \
-o $INP.merged.vcf
# If the CombineVariants step fails, we do not let the next step to execute.
if [[ $? != 0 || `grep "$ERRORMESSAGE" "$DATAPATH"/compute_ratio.output "$DATAPATH"/pipeline.output` != "" ]]
then
echo "CombineVariants FAILED"
exit 1
fi
$GATK \
-T VariantEval \
-R $REF \
-D $DBSNP \
-select 'set=="Intersection"' -selectName Intersection \
-select 'set=="RAW"' -selectName RAW \
-select 'set=="filterInFILTERED-RAW"' -selectName InRAW-FilteredInFILTERED \
-select 'set=="FILTERED"' -selectName FILTERED \
-select 'set=="FILTERED-filterInRAW"' -selectName InFILTERED-FilteredInRAW \
-select 'set=="FilteredInAll"' -selectName FilteredInAll \
-reportType R \
-reportLocation $INP.merged.eval \
-B:eval,VCF $INP.merged.vcf \
-l INFO
if [[ $? != 0 || `grep "$ERRORMESSAGE" "$DATAPATH"/compute_ratio.output "$DATAPATH"/pipeline.output` != "" ]]
then
echo "VariantEval ratio compute FAILED"
exit 1
fi