-
Notifications
You must be signed in to change notification settings - Fork 1
/
GATK4
40 lines (31 loc) · 1.01 KB
/
GATK4
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
#!/bin/bash -x
#PBS -N GATK4
#PBS -q batch
### Switch to the working directory; by default TORQUE launches processes from your home directory.
cd $PBS_O_WORKDIR
echo Working directory is $PBS_O_WORKDIR
module load java/java-1.8.0
module load bio/samtools-1.9
export INPATH=/mnt/home/usr/infiles
export OUTPATH=/home/usr/outfiles
mkdir -p $OUTPATH
chmod u+rwx $OUTPATH
export reference=/mnt/home/usr/references/refseq.fasta
java -jar /mnt/home/usr/tools/gatk-4.1.8.1/gatk-package-4.1.8.1-local.jar CreateSequenceDictionary -R $reference
samtools faidx $reference
for file in $INPATH/*.bam ;
do
bname=$(basename $file ".bam")
echo $bname
variants=$OUTPATH/$bname".vcf"
echo $variants
samtools index $file
java -Xmx4G -jar /mnt/home/usr/tools/gatk-4.1.8.1/gatk-package-4.1.8.1-local.jar HaplotypeCaller \
-R $reference \
-ploidy 1 \
-I $file \
-O $variants \
-ERC GVCF \
--read-filter OverclippedReadFilter \
--QUIET \
done