-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgatk_03_realigner_target_creator.sh
53 lines (45 loc) · 1.54 KB
/
gatk_03_realigner_target_creator.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
#!/bin/bash
#$ -cwd -V
#$ -pe smp 10
#$ -l h_vmem=110G
# $ -M [email protected]
#$ -m a
#$ -N gatk_realign
#$ -hold_jid_ad splittrim
#$ -o /user/logs/realigner_target_creator.$JOB_ID.$TASK_ID.out
#$ -e /user/logs/realigner_target_creator.$JOB_ID.$TASK_ID.err
module add apps/java/jre-1.7.0_75
module add apps/gatk/3.3-protected
module add apps/samtools/1.3.1
start_time=$(date)
start_secs=$(date +%s)
echo "### Logging Info ###"
echo "### Job: ${JOB_ID}: ${JOB_NAME} ###"
echo "### Array ID: ${SGE_TASK_ID} ###"
echo "### Job Occupying ${NSLOTS} slots ###"
echo "### Job running on ${HOSTNAME} ###"
echo "### Started at: ${start_time} ###"
source /user/scripts/C_variables_hg19.sh
BAM=$bamOutput/2pass/${FILENAME[$SGE_TASK_ID-1]}.Aligned_split.bam
samtools index ${BAM}
BAMFILE=${FILENAME[$SGE_TASK_ID-1]}.Aligned_split.bam
#BAMFILE=Aligned_split.bam
# move bamfile and index to localscratch
cp ${BAM}* ${TMPDIR}
#cp ${BAM%.bam}.bai $TMPDIR
#cp ${BAM}.bai $TMPDIR
GATK_JAVA_ARGS='-Xmx96g -Xms96g -XX:-UseLargePages'
java ${GATK_JAVA_ARGS} -jar ${GATK_ROOT}/GenomeAnalysisTK.jar \
-T RealignerTargetCreator \
-nt ${NSLOTS} \
-R ${HG19} \
-I ${TMPDIR}/${BAMFILE} \
-o ${bamOutput}/2pass/${FILENAME[$SGE_TASK_ID-1]}.intervals \
--known ${GATK_BUNDLE}/Mills_and_1000G_gold_standard.indels.hg19.sites.vcf \
--known ${GATK_BUNDLE}/1000G_phase1.indels.hg19.sites.vcf
end_time=$(date)
end_secs=$(date +%s)
time_elapsed=$(echo "${end_secs} - ${start_secs}" | bc)
echo
echo "### Ended at: ${end_time} ###"
echo "### Time Elapsed: ${time_elapsed} ###"