#!/bin/bash --login
script_file=${1}
tumour_set=${2}
input_dir=${3}
output_dir=${4}
PL_method=${5}
mut_file=${6}
wgd_file=${7}
G=${8}
unobserved=${9}
add_mut=${10}
mem_saver=${11}
inc_mrca=${12}
if [ "${wgd_file}" = "" ]; then
wgd_text=""
else
wgd_text="wgd_file=${wgd_file}"
fi
if [ "${unobserved}" = "" ]; then
unobserved_text=""
else
unobserved_text="unobserved_events=${unobserved}"
fi
if [ "${add_mut}" = "" ]; then
add_mut=TRUE
fi
if [ "${G}" == "" ]; then
G=1
fi
if [ "${mem_saver}" = "" ]; then
mem_saver=FALSE
fi
if [ "${inc_mrca}" = "" ]; then
inc_mrca=FALSE
fi
echo "running with G=${G}"
module load apps/gcc/R/4.1.2
Rscript ${script_file} ${tumour_set} input_dir=${input_dir} output_dir=${output_dir} PLmethod=${PL_method} ${unobserved_text} add_mut=${add_mut} genes="all" mut_file=${mut_file} G=${G} memory_saver=${mem_saver} estimate_MRCA=${inc_mrca} ${wgd_text}