From 35270ee5125762082a794211fed627d24729d651 Mon Sep 17 00:00:00 2001 From: Daniel Cameron Date: Fri, 21 May 2021 17:00:27 +1000 Subject: [PATCH] Fixed gridss_minimal Docker image --- Dockerfile | 25 ++++++++++++++++++------- scripts/dev/create_release.sh | 6 +++--- scripts/gridss | 6 +++++- 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index a2778eb5..f7d87709 100644 --- a/Dockerfile +++ b/Dockerfile @@ -65,13 +65,23 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ && rm -rf /var/lib/apt/lists/* # Hack a fake Rscript so that insert size metrics dont break when creating the histogram RUN echo "!/bin/sh" > /usr/local/bin/Rscript && chmod +x /usr/local/bin/Rscript -RUN mkdir /opt/gridss/ -# grab the GRIDSS artefacts from the builders -COPY --from=gridss_builder_c /opt/gridss/gridsstools /opt/gridss/gridsstools -COPY --from=gridss_builder_java /opt/gridss/*.jar /opt/gridss/ -# just GRIDSS itself -COPY scripts/gridss /opt/gridss/ ENV PATH="/opt/gridss/:$PATH" +# Install GRIDSS +ARG GRIDSS_VERSION +ENV GRIDSS_VERSION=${GRIDSS_VERSION} +ENV GRIDSS_JAR=/opt/gridss/gridss-${GRIDSS_VERSION}-gridss-jar-with-dependencies.jar +LABEL software="GRIDSS" +LABEL software.version="$GRIDSS_VERSION" +LABEL about.summary="Genomic Rearrangement IDentification Software Suite" +LABEL about.home="https://github.com/PapenfussLab/gridss" +LABEL about.tags="Genomics" +RUN mkdir /opt/gridss/ /data +COPY --from=gridss_builder_c /opt/gridss/gridsstools /opt/gridss/ +COPY --from=gridss_builder_java /opt/gridss/gridss-${GRIDSS_VERSION}-gridss-jar-with-dependencies.jar /opt/gridss/ +COPY scripts/gridss /opt/gridss/ +RUN chmod +x /opt/gridss/* +WORKDIR /data/ + FROM gridss_c_build_environment AS gridss # Setup CRAN ubuntu package repository @@ -144,7 +154,6 @@ RUN mkdir /opt/edirect && \ wget ftp://ftp.ncbi.nlm.nih.gov/entrez/entrezdirect/edirect.tar.gz && \ tar zxf edirect.tar.gz && \ rm edirect.tar.gz - ENV PATH="/opt/gridss/:/opt/RepeatMasker:/opt/rmblast/:/opt/trf:/opt/kraken2:/opt/blast:/opt/edirect:$PATH" # configure repeatmasker RUN cd /opt/RepeatMasker && \ @@ -175,6 +184,8 @@ COPY scripts/gridss \ scripts/gridss.config.R \ scripts/libgridss.R \ /opt/gridss/ +RUN chmod +x /opt/gridss/* && \ + chmod -x /opt/gridss/*.R WORKDIR /data/ # Copy build artifact locally diff --git a/scripts/dev/create_release.sh b/scripts/dev/create_release.sh index b4d722cf..73bfec50 100644 --- a/scripts/dev/create_release.sh +++ b/scripts/dev/create_release.sh @@ -12,11 +12,11 @@ fi echo Building GRIDSS $version 2>&1 rm -rf release/ mkdir release -docker build --build-arg GRIDSS_VERSION=$version --target gridss_export_build_artefacts --output type=local,dest=release --progress=plain . && \ -docker build --build-arg GRIDSS_VERSION=$version --target gridss -t gridss:$version -t gridss:latest . && \ +docker build --build-arg GRIDSS_VERSION=$version --target gridss_export_build_artefacts --output type=local,dest=release . # --progress=plain +docker build --build-arg GRIDSS_VERSION=$version --target gridss -t gridss:$version -t gridss:latest . docker build --build-arg GRIDSS_VERSION=$version --target gridss_minimal -t gridss_minimal:$version -t gridss_minimal:latest . cd release -tar czvf gridss-$version.tar.gz * +tar czf gridss-$version.tar.gz * # TODO: update conda? echo docker push gridss/gridss:$version gridss/gridss:latest gridss/gridss_minimal:$version gridss/gridss_minimal:latest diff --git a/scripts/gridss b/scripts/gridss index 0e20975b..eeaa87bd 100644 --- a/scripts/gridss +++ b/scripts/gridss @@ -865,7 +865,11 @@ if [[ $do_preprocess == true ]] ; then fi fi if [[ -f $tmp_prefix.insert_size_metrics ]] ; then - $rmcmd $tmp_prefix.insert_size_metrics $tmp_prefix.idsv_metrics $tmp_prefix.insert_size_histogram.pdf + $rmcmd $tmp_prefix.insert_size_metrics $tmp_prefix.idsv_metrics + fi + if [[ -f $tmp_prefix.insert_size_histogram.pdf ]] ; then + # pdf does not exist when using gridss_minimal docker image + $rmcmd $tmp_prefix.insert_size_histogram.pdf fi if [[ ! -f $prefix.sv.bam ]] ; then write_status "pre-processing failed for $f"