set -e function usage() { echo "Usage: $0 [ -s ] [ -o ] [ -x ] [ -c ] [ -p ]" echo "-s Sample Name" echo "-o Output dir" echo "-p Pseudo Panel[MBY2|FeBY2]" echo "-x script_dir" echo "-c WES CNV outdir" } if [ $# -eq 0 ] then usage exit fi while getopts ":s:o:p:x:c:h" opt; do case $opt in s) sample=$OPTARG ;; o) out_dir=$OPTARG ;; c) cnv_dir=$OPTARG ;; p) panel=$OPTARG ;; x) script_dir=$OPTARG ;; h) usage exit ;; \?) echo "Invalid option: -$OPTARG" usage exit ;; esac done if [ -d $cnv_dir ] then echo $cnv_dir. else echo $cnv_dir " NOT exist!" exit fi cd $cnv_dir echo "out_dir:" $out_dir . $script_dir/conf/conf.cfg ## CNV call sh $module/run_CNV_call.sh -s $sample -o $out_dir -x $script_dir -c $cnv_dir ## Merge,Filter,Annotation,Plot sh $module/run_CNV_trim.sh -s $sample -o $out_dir -x $script_dir -c $cnv_dir ## CNV plot #sh $module/run_CNV_plot.sh -s $sample -o $out_dir -x $script_dir -c $cnv_dir ## AZF if [ "$panel" = "MBY2" ] then . $module/run_MBY2AZF_hg19_200113.sh $sample fi