-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgatk_calibrate.scr
executable file
·62 lines (51 loc) · 1.23 KB
/
gatk_calibrate.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
#!/bin/sh
#$ -cwd
# -l mem=8G,time=8::
# This step in the pipeline performs calibration of the original input bam file.
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> [-L \"#:#-#\"]"
while getopts I:L:R:D:h o
do case "$o" in
I) INP="$OPTARG";;
L) CHR="$OPTARG";;
R) REF="$OPTARG";;
D) DBSNP="$OPTARG";;
h) echo $USAGE
exit 1;;
esac
done
if [[ $INP == "" || $REF == "" || $DBSNP == "" ]]
then
echo $USAGE
exit 1
fi
# Chromosome number may be specified in eithe of the formats for example:
# chrX or X
# Find out using the samtools idxstats command.
CHR_NAME=`$SAMTOOLS idxstats $INP | grep chr`
if [[ $CHR != "" ]]
then
if [[ `grep chr $CHR` == "" && -n $CHR_NAME ]]
then
CHR="chr${CHR}"
fi
fi
$GATK \
-L $CHR \
-R $REF \
--DBSNP $DBSNP \
-I $INP \
-T CountCovariates \
-cov ReadGroupCovariate \
-cov QualityScoreCovariate \
-cov CycleCovariate \
-cov DinucCovariate \
-recalFile $INP.recal_data.csv
# [-B:mask,VCF sitesToMask.vcf] \