-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathrun_CONICS.sh
45 lines (34 loc) · 1.45 KB
/
run_CONICS.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
#!/bin/bash
source ./CONICS.cfg
date +'%d/%m/%Y %H:%M:%S:%3N'
tumor_bam=${1}
normal_bam=${2}
cnv_bed=${3}
output_base=${4}
if [ $# -ne 4 ]
then
echo "usage: [script.sh] [directory_tumor_bam_files] [directory_normal_bam_files] [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 CPM matrix> ================="
echo "mapping threshold = ${mappingCutoff}"
echo "read number threshold = ${readCutoff}"
echo "=================================================="
echo " =============================="
echo " > Tumor"
echo " =============================="
${path_to_python} ./backend/CalculateCoverageMatrix.py ${tumor_bam} ${cnv_bed} ${mappingCutoff} ${readCutoff} ${path_to_samtools} ${path_to_bedtools} ./${out_dir}/${output_base}"_tumor"
echo " =============================="
echo " > Normal"
echo " =============================="
${path_to_python} ./backend/CalculateCoverageMatrix.py ${normal_bam} ${cnv_bed} ${mappingCutoff} ${readCutoff} ${path_to_samtools} ${path_to_bedtools} ./${out_dir}/${output_base}"_normal"
echo "============== <CNV calling> ====================="
${path_to_rscript} ./backend/plot_bean_CPM.R ${out_dir}/${output_base}_tumor_cpmMatrix.csv ${out_dir}/${output_base}_normal_cpmMatrix.csv ${out_dir}/${output_base} ${fdrCutoff}
date +'%d/%m/%Y %H:%M:%S:%3N'