-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchreadgroup.sh
77 lines (60 loc) · 1.34 KB
/
chreadgroup.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#$ -S /bin/bash
#$ -N chrg
#$ -o chrgout
#$ -e chrgerr
#$ -V
#$ -cwd
#$ -S /bin/bash
#$ -q !gbs
# #$ -l mem_free=2G
# $ -p -10
# #$ -h
#$ -t 1-5:1
# $ -t 5-4921
i=$(expr $SGE_TASK_ID - 1)
#GATK="/home/bpp/knausb/bin/gatk/GenomeAnalysisTK.jar"
GATK="/home/bpp/knausb/bin/gatk/GenomeAnalysisTK-3.5.jar"
#GATK="/home/bpp/knausb/bin/gatk/GenomeAnalysisTK-3.6.jar"
JAVA="/home/bpp/knausb/bin/javadir/jre1.8.0_25/bin/java"
PIC="/home/bpp/knausb/bin/picard/picard-tools-2.5.0/picard.jar"
REF="/home/bpp/knausb/Grunwald_Lab/home/knausb/bjk_pinf_ref/pinf_super_contigs.fa"
SAMT="~/bin/samtools-1.3.1/samtools"
SAMPS=("HPM-200" "HPM-527" "HPM-663" "HPM-693" "HPM-867")
ANNOT="C"
#EVAL="TRUE"
EVAL="FALSE"
#FILE=( `cat "bams1.txt" `)
#IFS=',' read -r -a arr <<< "${FILE[$i]}"
echo -n "Running on: "
hostname
echo "SGE job id: $JOB_ID"
date
echo
CMD="$JAVA -version 2>&1"
echo $CMD
eval $CMD
echo
date
CMD="$JAVA -jar $PIC AddOrReplaceReadGroups \
I=${SAMPS[$i]}_fixed.bam \
O=${SAMPS[$i]}"$ANNOT"_fixed.bam \
RGID=${SAMPS[$i]}"$ANNOT" \
RGLB=${SAMPS[$i]}"$ANNOT" \
RGPL=illumina \
RGPU=${SAMPS[$i]}"$ANNOT" \
RGSM=${SAMPS[$i]}"$ANNOT
echo $CMD
if [ "$EVAL" == "TRUE" ]; then
eval $CMD
echo
fi
date
# Index
CMD="$SAMT index ${SAMPS[$i]}"$ANNOT"_fixed.bam"
echo $CMD
#
if [ "$EVAL" == "TRUE" ]; then
eval $CMD
echo
fi
date