diff --git a/Singularity b/Singularity index 0579db1..038e6c4 100644 --- a/Singularity +++ b/Singularity @@ -20,37 +20,10 @@ From: ubuntu:22.04 %files setup.py /opt/primer_finder/ gene_splicer /opt/primer_finder/ + scripts /opt/primer_finder/ %post - echo ===== Installing Prerequisites ===== >/dev/null - apt-get update - apt-get install -y build-essential unzip git wget \ - fontconfig libbz2-dev liblzma-dev libssl-dev \ - libffi-dev libsqlite3-dev - - echo ===== Installing Python ===== >/dev/null - apt-get install -y python3 python3-pip - - echo ===== Installing blast ===== >/dev/null - apt-get install -y ncbi-blast+ - - echo ===== Installing Python packages ===== >/dev/null - cd /opt/primer_finder - pip3 install . - - echo ===== Installing minimap2 ===== >/dev/null - apt-get install -y minimap2 - - echo ===== Installing hivseqinr ===== >/dev/null - apt-get install -y libz-dev libcurl4-openssl-dev libxml2-dev - DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y r-base - Rscript /opt/primer_finder/gene_splicer/configure_r.sh - python3 -m gene_splicer.hivseqinr /opt/hivseqinr - - # Clean up - apt-get remove -y wget git build-essential - apt-get clean - rm -rf /var/lib/apt/lists/* + sh -- /opt/primer_finder/scripts/install.sh %environment export LANG=en_US.UTF-8 diff --git a/scripts/install.sh b/scripts/install.sh new file mode 100644 index 0000000..7b9fb59 --- /dev/null +++ b/scripts/install.sh @@ -0,0 +1,12 @@ +#! /bin/sh + +set -e + +CURRENT_DIR="${0%/*}" + +set -x + +for SCRIPT in "$CURRENT_DIR/installation/"* +do + sh -- "$SCRIPT" +done diff --git a/scripts/installation/10-prerequisites.sh b/scripts/installation/10-prerequisites.sh new file mode 100644 index 0000000..1aa2390 --- /dev/null +++ b/scripts/installation/10-prerequisites.sh @@ -0,0 +1,12 @@ +#! /bin/sh + +set -e + +echo ===== Installing Prerequisites ===== >/dev/null + +set -x + +apt-get update -qq +apt-get install -y build-essential unzip git wget \ + fontconfig libbz2-dev liblzma-dev libssl-dev \ + libffi-dev libsqlite3-dev diff --git a/scripts/installation/15-python.sh b/scripts/installation/15-python.sh new file mode 100644 index 0000000..59b1ef2 --- /dev/null +++ b/scripts/installation/15-python.sh @@ -0,0 +1,9 @@ +#! /bin/sh + +set -e + +echo ===== Installing Python ===== >/dev/null + +set -x + +apt-get install -y python3 python3-pip diff --git a/scripts/installation/20-blast.sh b/scripts/installation/20-blast.sh new file mode 100644 index 0000000..b97c86e --- /dev/null +++ b/scripts/installation/20-blast.sh @@ -0,0 +1,9 @@ +#! /bin/sh + +set -e + +echo ===== Installing blast ===== >/dev/null + +set -x + +apt-get install -y ncbi-blast+ diff --git a/scripts/installation/25-python-packages.sh b/scripts/installation/25-python-packages.sh new file mode 100644 index 0000000..17a7edd --- /dev/null +++ b/scripts/installation/25-python-packages.sh @@ -0,0 +1,9 @@ +#! /bin/sh + +set -e + +echo ===== Installing Python packages ===== >/dev/null + +set -x + +pip3 install /opt/primer_finder diff --git a/scripts/installation/30-minimap2.sh b/scripts/installation/30-minimap2.sh new file mode 100644 index 0000000..d3b9af4 --- /dev/null +++ b/scripts/installation/30-minimap2.sh @@ -0,0 +1,9 @@ +#! /bin/sh + +set -e + +echo ===== Installing minimap2 ===== >/dev/null + +set -x + +apt-get install -y minimap2 diff --git a/scripts/installation/35-hivseqinr.sh b/scripts/installation/35-hivseqinr.sh new file mode 100644 index 0000000..76180f9 --- /dev/null +++ b/scripts/installation/35-hivseqinr.sh @@ -0,0 +1,14 @@ +#! /bin/sh + +set -e + +echo ===== Installing hivseqinr ===== >/dev/null + +set -x + +export DEBIAN_FRONTEND=noninteractive + +apt-get install -y libz-dev libcurl4-openssl-dev libxml2-dev +apt-get install --no-install-recommends -y r-base +Rscript /opt/primer_finder/gene_splicer/configure_r.sh +python3 -m gene_splicer.hivseqinr /opt/hivseqinr diff --git a/scripts/installation/90-cleanup.sh b/scripts/installation/90-cleanup.sh new file mode 100644 index 0000000..025cb83 --- /dev/null +++ b/scripts/installation/90-cleanup.sh @@ -0,0 +1,11 @@ +#! /bin/sh + +set -e + +echo ===== Clean up ===== >/dev/null + +set -x + +apt-get remove -y wget git build-essential +apt-get clean +rm -rf /var/lib/apt/lists/*