-
Notifications
You must be signed in to change notification settings - Fork 1
/
bsv-R1-S8_bqsr_gather.sh
executable file
·61 lines (47 loc) · 1.62 KB
/
bsv-R1-S8_bqsr_gather.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
53
54
55
56
57
58
59
60
#!/bin/bash
#########################################################
#
# Platform: NCI Gadi HPC
# Description: run GATK GatherBQSRReports over parallel tasks
# 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.
#
#########################################################
module load gatk/4.1.2.0
labSampleID=$1
round=<round>
tables=$(find ./BQSR_recal_tables/Round${round} -name "${labSampleID}.*.recal_data.table")
tables=($tables)
tables_list=''
log=GATK_logs/BQSR_round${round}/${labSampleID}.gather.oe
err=./Error_capture/Bootstrap_BQSR_round${round}/${labSampleID}.gather.err
out=./BQSR_recal_tables/Round${round}/${labSampleID}.recal_data.table
rm -f $log $err
echo "$(date): Bootstrap round ${round} step 8: Gather BQSR reports for sample ${labSampleID}" > ${log}
for file in ${tables[@]}
do
tables_list+=" -I $file"
done
gatk GatherBQSRReports \
$tables_list \
-O $out >> $log 2>&1
echo "$(date): Finished." >> ${log} 2>&1
if grep -q -i error $log
then
printf "Error in GATK log ${log}\n" >> $err
fi
if grep -q Exception $log
then
printf "Exception in GATK log ${log}\n" >> $err
fi