-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathvarscan_helper.sh
executable file
·44 lines (40 loc) · 1.12 KB
/
varscan_helper.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
#!/bin/bash
set -o errexit
set -o nounset
if [ $# -lt 7 ]
then
echo "Usage: $0 [TUMOR_BAM] [NORMAL_BAM] [REFERENCE] [STRAND_FILTER] [MIN_COVERAGE] [MIN_VAR_FREQ] [P_VALUE] [roi_bed?]"
exit 1
fi
TUMOR_BAM="$1"
NORMAL_BAM="$2"
REFERENCE="$3"
STRAND_FILTER="$4"
MIN_COVERAGE="$5"
MIN_VAR_FREQ="$6"
P_VALUE="$7"
OUTPUT="${HOME}/output"
if [ -z ${8+x} ]
then
#run without ROI
java -jar /opt/varscan/VarScan.jar somatic \
<(/opt/samtools/bin/samtools mpileup --no-baq -f "$REFERENCE" "$NORMAL_BAM" "$TUMOR_BAM") \
$OUTPUT \
--strand-filter $STRAND_FILTER \
--min-coverage $MIN_COVERAGE \
--min-var-freq $MIN_VAR_FREQ \
--p-value $P_VALUE \
--mpileup 1 \
--output-vcf
else
ROI_BED="$8"
java -jar /opt/varscan/VarScan.jar somatic \
<(/opt/samtools/bin/samtools mpileup --no-baq -l "$ROI_BED" -f "$REFERENCE" "$NORMAL_BAM" "$TUMOR_BAM") \
$OUTPUT \
--strand-filter $STRAND_FILTER \
--min-coverage $MIN_COVERAGE \
--min-var-freq $MIN_VAR_FREQ \
--p-value $P_VALUE \
--mpileup 1 \
--output-vcf
fi