FROM ubuntu:bionic ENV R_VERSION=3.6.3 ENV ROCKER_VERSION=4.1.1 ENV R_HOME=/usr/local/lib/R ENV TZ=Etc/UTC ENV SAMTOOLS_VERSION=1.2 RUN < /usr/bin/viquas #!/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 PWD_BACKUP=$PWD 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 "${1}" /viquas cp "${2}" /viquas cd /viquas || exit 1 case $NUM_ARGS in 2) Rscript /viquas/ViQuaS.R "${REFERENCE_FILE}" "${BAM_FILE}" ;; 6) Rscript /viquas/ViQuaS.R "${REFERENCE_FILE}" "${BAM_FILE}" "${@[3:]}" ;; *) echo "${USAGE}" echo "Incorrect number of arguments: expecting 2 or 6" exit 1 esac mv /viquas/ViQuaS-Spectrum.fa "${PWD_BACKUP}" mv /viquas/ViQuaS-Richness.txt "${PWD_BACKUP}" 2> /dev/null cd "${PWD_BACKUP}" || exit 1 EOF chmod +x /usr/bin/viquas chmod -R 777 /viquas END_RUN_CMD ENTRYPOINT [ "viquas" ]