haplotyper-battle-royale/modules/viquas/viquas

50 lines
810 B
Text
Raw Normal View History

2023-08-10 04:21:33 +00:00
#!/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}")
2023-08-10 04:39:02 +00:00
cp -r /viquas/viquas_files .
cp /viquas/ViQuaS.R .
2023-08-10 04:21:33 +00:00
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
2023-08-10 04:39:02 +00:00
rm -rf ./viquas_files
rm ViQuaS.R