forked from Neurosurgery-Brain-Tumor-Center-DiazLab/CONICS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_BAf_analysis.sh
38 lines (29 loc) · 1.19 KB
/
run_BAf_analysis.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
#!/bin/bash
source ./CONICS.cfg
tumor_bam=${1}
snvs_normal=${2}
snvs_tumor=${3}
cnv_bed=${4}
output_base=${5}
if [ $# -ne 5 ]
then
echo "usage: [script.sh] [directory_tumor_bam_files] [SNVs Control] [SNVs Tumor] [CNV list] [base name for output file]"
exit 1
fi
out_dir="output_"${output_base}
if [ -d ${out_dir} ]
then
echo "[error] output directory \"${out_dir}\" already exists"
exit 1
fi
mkdir ${out_dir}
echo "========= <generating BED file of heterozygous germline SNVs> ================="
${path_to_python} ./backend/FilterSNVsFromVCF.py ${snvs_normal} ${snvs_tumor} ${cnv_bed} ./${out_dir}/${output_base}
echo " =============================="
echo " BED file generated"
echo " =============================="
echo "========= <Summarizing all SNVs in each cell> ================="
${path_to_python} ./backend/summarizeSNVs.py ${tumor_bam} ./${out_dir}/${output_base} ./${out_dir}/${output_base}_germline_snvs.bed ${genome} ${path_to_bamreadcount}
echo "========= <Summary done> ================="
echo "============== <Plotting results> ====================="
${path_to_rscript} ./backend/plotVAFs.R ${out_dir}/${output_base}_af.txt ${out_dir}/${output_base}_bf.txt ${out_dir}/${output_base}