forked from RobertKSuter/CloudASM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbam_recalibration.sh
49 lines (44 loc) · 1.66 KB
/
bam_recalibration.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
#!/bin/bash
# Note: Picardtools packages require that we specify the whole path of the package
# Make sure it is consistent with what is created in the Docker image.
PICARD="/genomics-packages/picard-tools-1.97"
JAVA="/genomics-packages/jre1.7.0_25/bin/"
BIS_SNP="/genomics-packages/BisSNP-0.82.2"
# Temp folder for the packages
TMP_DIR="/mnt/data/tmp/"
mkdir -p ${TMP_DIR}
# Sort by coordinate (required by Bis-SNP)
java \
-Djava.io.tmpdir=${TMP_DIR} \
-Xmx52g \
-jar $PICARD/SortSam.jar \
I=${BAM} \
O=$(dirname "${BAM}")/${SAMPLE}_chr${CHR}_sorted.bam \
SORT_ORDER=coordinate \
CREATE_INDEX=true \
MAX_RECORDS_IN_RAM=9000000
echo "Create recal file. This requires a specific version of Java."
$JAVA/java \
-Djava.io.tmpdir=${TMP_DIR} \
-jar -Xmx52g ${BIS_SNP}/BisSNP-0.82.2.jar \
-L $CHR \
-R $(dirname "${REF_GENOME}")/human_g1k_v37.fasta \
-I $(dirname "${BAM}")/${SAMPLE}_chr${CHR}_sorted.bam \
-T BisulfiteCountCovariates \
-knownSites ${ALL_VARIANTS} \
-cov ReadGroupCovariate \
-cov QualityScoreCovariate \
-cov CycleCovariate \
-recalFile $(dirname "${OUTPUT_DIR}")/${SAMPLE}_chr${CHR}_recal.csv \
-nt 12
echo "Generates a re-calibrated BAM and BAI file"
$JAVA/java \
-Djava.io.tmpdir=${TMP_DIR} \
-jar -Xmx52g ${BIS_SNP}/BisSNP-0.82.2.jar \
-L $CHR \
-R $(dirname "${REF_GENOME}")/human_g1k_v37.fasta \
-I $(dirname "${BAM}")/${SAMPLE}_chr${CHR}_sorted.bam \
-o $(dirname "${OUTPUT_DIR}")/${SAMPLE}_chr${CHR}_recal.bam \
-T BisulfiteTableRecalibration \
-recalFile $(dirname "${OUTPUT_DIR}")/${SAMPLE}_chr${CHR}_recal.csv \
--max_quality_score 40