haplotyper-battle-royale/modules/viquas/viquas

47 lines
798 B
Bash

#!/bin/sh
USAGE="
USAGE:
viquas reference.fsa reads.bam [o r perform_richness diversity_region_length]
"
NUM_ARGS=$#
case $NUM_ARGS in
2)
;;
6)
;;
*)
echo "${USAGE}"
echo "Incorrect number of arguments: expecting 2 or 6"
exit 1
esac
if [ ! -f "${1}" ]; then
echo "Error: ${1} is not a file"
exit 1
fi
if [ ! -f "${2}" ]; then
echo "Error: ${2} is not a file"
exit 1
fi
REFERENCE_FILE=$(basename "${1}")
BAM_FILE=$(basename "${2}")
cp -r /viquas/{viquas_files,ViQuaS.R} .
case $NUM_ARGS in
2)
Rscript ./ViQuaS.R "${REFERENCE_FILE}" "${BAM_FILE}"
;;
6)
Rscript ./ViQuaS.R "${REFERENCE_FILE}" "${BAM_FILE}" "${@[3:]}"
;;
*)
echo "${USAGE}"
echo "Incorrect number of arguments: expecting 2 or 6"
exit 1
esac
rm -rf ./{viquas_files,ViQuaS.R}