-
Notifications
You must be signed in to change notification settings - Fork 24
/
GATK_03_BaseRecalibrator.sh
executable file
·52 lines (50 loc) · 1.73 KB
/
GATK_03_BaseRecalibrator.sh
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
#!/bin/bash
# This step can be skipped if you don't have the known SNPs file
# You can run this again, after you complete first round of SNP calling to improve the SNPs called
GATK="/data003/GIF/software/packages/gatk/3.3"
KNOWN_VCF="/home/arnstrm/arnstrm/20150413_Graham_SoybeanFST/03_BAM/Soybean_SNPs_119_lines_gatk_htc_only_snps_filtered_pass.vcf"
REFERENCE="/home/arnstrm/arnstrm/20150413_Graham_SoybeanFST/01_DATA/B_REF/Gmax_275_v2.0.fa"
FILE="$1"
java -Xmx60G -jar ${GATK}/GenomeAnalysisTK.jar \
-T BaseRecalibrator \
-R ${REFERENCE} \
-I ${FILE} \
-knownSites ${KNOWN_VCF} \
-o ${FILE%.*}_recal_data.table || {
echo >&2 recal data table generation failed for $FILE
exit 1
}
java -Xmx60G -jar ${GATK}/GenomeAnalysisTK.jar \
-T BaseRecalibrator \
-R ${REFERENCE} \
-I ${FILE} \
-knownSites ${KNOWN_VCF} \
-BQSR ${FILE%.*}_recal_data.table \
-o ${FILE%.*}_post_recal_data.table || {
echo >&2 post recal data table generation failed for $FILE
exit 1
}
#java -jar ${GATK}/GenomeAnalysisTK.jar \
# -T AnalyzeCovariates \
# -R ${REFERENCE} \
# -before ${FILE%.*}_recal_data.table \
# -after ${FILE%.*}_post_recal_data.table \
# -plots ${FILE%.*}_recalibration_plots.pdf || {
#echo >&2 recal plots generation failed for $FILE
#exit 1
#}
java -Xmx60G -jar ${GATK}/GenomeAnalysisTK.jar \
-T PrintReads \
-R ${REFERENCE} \
-I ${FILE} \
-BQSR ${FILE%.*}_recal_data.table \
-o ${FILE%.*}_recal_reads.bam || {
echo >&2 writing recal bam failed for $FILE
exit 1
}
java -Xmx60G -jar /data003/GIF/software/packages/picard_tools/1.130/picard.jar BuildBamIndex \
INPUT=${FILE%.*}_recal_reads.bam \
OUTPUT=${FILE%.*}_recal_reads.bai || {
echo >&2 recal bam indexing failed for $FILE
exit 1
}