-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbsv-R1-S24_unrecalibrated_vcf_metrics.pbs
executable file
·79 lines (60 loc) · 2.32 KB
/
bsv-R1-S24_unrecalibrated_vcf_metrics.pbs
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
#!/bin/bash
#########################################################
#
# Platform: NCI Gadi HPC
# Description: Generate VCF metrics for final joint-genotyped VCF
# Compare to metrics from the VCF created without BQSR
# The Metrics tool requires dbsnp input: will need to use
# the botstrapped resource as input for the unrecal VCF, this
# is not ideal but let's see how it turns out...
# Author: Cali Willet
# cali.willet@sydney.edu.au
# Date last modified: 14/10/2020
#
# If you use this script towards a publication, please acknowledge the
# Sydney Informatics Hub (or co-authorship, where appropriate).
#
# Suggested acknowledgement:
# The authors acknowledge the scientific and technical assistance
# <or e.g. bioinformatics assistance of <PERSON> of Sydney Informatics
# Hub and resources and services from the National Computational
# Infrastructure (NCI), which is supported by the Australian Government
# with access facilitated by the University of Sydney.
#
#########################################################
#PBS -P <project>
#PBS -N bsv-R1-S24
#PBS -l walltime=00:30:00
#PBS -l ncpus=2
#PBS -l mem=64GB
#PBS -l wd
#PBS -q hugemem
#PBS -W umask=022
#PBS -o ./Logs/bsv-R1-S24-unrecal.o
#PBS -e ./Logs/bsv-R1-S24-unrecal.e
#PBS -lstorage=<lstorage>
module load gatk/4.1.2.0
set -e
cohort=<cohort>
round=<round>
vcf=../GenotypeGVCFs/${cohort}.vcf # The final sorted joint-genotyped VCF from Germline-ShortV pipeline (if round 1) OR the final sorted joint called VCF from the preceeding round of BQSR bootstrapping
known_snps=./VCFs/${cohort}_bootstrap-R${round}-S5_SNP_filtered.vcf # The filtered SNP file generated from round $round of BQSR
log=./GATK_logs/vcf_metrics_unrecalibrated_round${round}.oe
rm -rf ${log}
mkdir -p ./VCF_metrics/Round${round}
metrics=./VCF_metrics/Round${round}/${cohort}_unrecalibrated_round${round}
echo "$(date) : Start GATK4 metrics generation for ${cohort} BEFORE bootstrapped BQSR round ${round} variant calling " > $log 2>&1
gatk CollectVariantCallingMetrics \
--java-options "-Xmx58g -DGATK_STACKTRACE_ON_USER_EXCEPTION=true" \
--DBSNP ${known_snps} \
-I ${vcf} \
-O ${metrics} >> ${log} 2>&1
echo "$(date) : Finished." >> $log 2>&1
if grep -q -i error $log
then
printf "Error in GATK log ${log}\n"
fi
if grep -q Exception $log
then
printf "Exception in GATK log ${log}\n"
fi