#!/bin/bash --login
script_dir=${1}
name=${2}
output_dir=${3}
sample_list=${4}
dsf=${5} # driver gene symbols file: 1 gene symbol per line
nsmf=${6} # nonsynonymous mutation file - required columns: Tumor_Barcode, Chromosome, Start_Position, End_Position
dpdd=${7} # DPClust data directory: for each sample, this must contain files with the following patterns:
# - _dpclust_input_data.txt
# - _bestConsensusAssignments.bed
# and, IF there is no winner's curse corrected directory provided:
# - _bestClusterInfo.txt
gene_gr=${8} # File path of an .Rdata file containing all genes saved as a GRanges object, all_gene_gr
wccd=${9} # If winner's curse correction has been carried out, the directory should be passed here
# For each sample, it should contain a file with the pattern _WCC_ccf_nMut.txt
TM_dir=`dirname ${script_dir}`
dpad=${dpdd}/dpc_annotated/
module load apps/gcc/R/4.1.2
if [ "${gene_gr}" != "" ]; then
gene_gr_text="all_gene_gr_file=${gene_gr}"
else
gene_gr_text=""
fi
if [ "${wccd}" != "" ]; then
wc_text="wc_dir=${wccd}"
else
wc_text=""
fi
if [ "${sample_list}" != "none" ]; then
sl_text="sample_list=${sample_list}"
else
sl_text=""
fi
Rscript ${script_dir}/prepare_driver_mutations.R ${name} ${dpad} ${dsf} ${nsmf} output_dir=${output_dir} dp_data_dir=${dpdd} ${gene_gr_text} ${wc_text} ${sl_text}