From 4779a13ec10a7c1900c39af242707d945cbaded6 Mon Sep 17 00:00:00 2001 From: Maxime Garcia Date: Wed, 20 Jun 2018 10:18:00 +0200 Subject: [PATCH 1/2] new Dockerfile for new container gatk4 --- buildContainers.nf | 5 +++-- containers/gatk4/Dockerfile | 27 +++++++++++++++++++++++++++ containers/gatk4/Singularity | 19 ------------------- scripts/do_all.sh | 4 ++-- 4 files changed, 32 insertions(+), 23 deletions(-) create mode 100644 containers/gatk4/Dockerfile delete mode 100644 containers/gatk4/Singularity diff --git a/buildContainers.nf b/buildContainers.nf index 145bbde39c..ba6d96ff32 100644 --- a/buildContainers.nf +++ b/buildContainers.nf @@ -179,6 +179,7 @@ def defineContainersList(){ return [ 'freebayes', 'gatk', + 'gatk4', 'igvtools', 'mutect1', 'picard', @@ -207,8 +208,8 @@ def helpMessage() { log.info " --containers: Choose which containers to build" log.info " Default: all" log.info " Possible values:" - log.info " all, freebayes, gatk, igvtools, mutect1, picard, qctools" - log.info " r-base, runallelecount, sarek, snpeff" + log.info " all, freebayes, gatk, gatk4, igvtools, mutect1, picard" + log.info " qctools, r-base, runallelecount, sarek, snpeff" log.info " snpeffgrch37, snpeffgrch38, vepgrch37, vepgrch38" log.info " --docker: Build containers using Docker" log.info " --help" diff --git a/containers/gatk4/Dockerfile b/containers/gatk4/Dockerfile new file mode 100644 index 0000000000..2fca8dc103 --- /dev/null +++ b/containers/gatk4/Dockerfile @@ -0,0 +1,27 @@ +FROM openjdk:8-slim + +LABEL \ + author="Maxime Garcia" \ + description="GATK image for use in Sarek" \ + maintainer="maxime.garcia@scilifelab.se" + +# Install libraries +RUN \ + apt-get update && apt-get install -y --no-install-recommends \ + wget \ + && rm -rf /var/lib/apt/lists/* + +# Setup ENV variables +ENV \ + GATK_VER="4.0.5.1" \ + GATK_HOME="/opt/gatk" + +# Install GATK +RUN \ + mkdir $GATK_HOME \ + && cd $GATK_HOME \ + && wget --quiet -O $GATK_HOME/gatk-${GATK_VER}.zip \ + https://github.com/broadinstitute/gatk/releases/download/${GATK_VER}/gatk-${GATK_VER}.zip \ + && unzip gatk-${GATK_VER}.zip \ + && mv gatk-${GATK_VER}/gatk-package-${GATK_VER}-local.jar gatk4.jar \ + && rm gatk-${GATK_VER}.zip diff --git a/containers/gatk4/Singularity b/containers/gatk4/Singularity deleted file mode 100644 index 44f0259380..0000000000 --- a/containers/gatk4/Singularity +++ /dev/null @@ -1,19 +0,0 @@ -Bootstrap: docker -From: ubuntu:18.04 - -%post - apt-get -y update - apt-get -y install openjdk-8-jre-headless - -%help - Custom container for GATK4 to contain only single jar as the result of "./gradlew localJar" in /opt ; you have to change the filename for the created jar below - -%files - /home/szilva/dev/gatk/build/libs/gatk-package-4.0.4.0-15-g61c6891-SNAPSHOT-local.jar /opt/gatk4.jar - -%environment - GATK_HOME=/opt - export GATK_HOME - -%labels - AUTHOR szilveszter.juhos@scilifelab.se diff --git a/scripts/do_all.sh b/scripts/do_all.sh index c2b1f07abd..e4780958a1 100755 --- a/scripts/do_all.sh +++ b/scripts/do_all.sh @@ -57,8 +57,8 @@ function toLower() { if [[ $TOOL = docker ]] && [[ GRCh37,GRCh38 =~ $GENOME ]] then - nextflow run buildContainers.nf -profile ${PROFILE} --verbose --docker ${PUSH} --repository ${REPOSITORY} --tag ${TAG} --containers freebayes,gatk,igvtools,mutect1,picard,qctools,r-base,runallelecount,sarek,snpeff + nextflow run buildContainers.nf -profile ${PROFILE} --verbose --docker ${PUSH} --repository ${REPOSITORY} --tag ${TAG} --containers freebayes,gatk,gatk4,igvtools,mutect1,picard,qctools,r-base,runallelecount,sarek,snpeff nextflow run buildContainers.nf -profile ${PROFILE} --verbose --docker ${PUSH} --repository ${REPOSITORY} --tag ${TAG} --containers snpeff$(toLower ${GENOME}),vep$(toLower ${GENOME}) else - nextflow run buildContainers.nf -profile ${PROFILE} --verbose --singularity --repository ${REPOSITORY} --tag ${TAG} --containerPath containers/ --containers freebayes,gatk,igvtools,mutect1,picard,qctools,r-base,runallelecount,sarek,snpeff$(toLower ${GENOME}),vep$(toLower ${GENOME}) + nextflow run buildContainers.nf -profile ${PROFILE} --verbose --singularity --repository ${REPOSITORY} --tag ${TAG} --containerPath containers/ --containers freebayes,gatk,gatk4,igvtools,mutect1,picard,qctools,r-base,runallelecount,sarek,snpeff$(toLower ${GENOME}),vep$(toLower ${GENOME}) fi From b7951de749a3ec7b9ec228020ab561e8967179c0 Mon Sep 17 00:00:00 2001 From: Maxime Garcia Date: Wed, 20 Jun 2018 11:47:07 +0200 Subject: [PATCH 2/2] use bioconda to install gatk4 --- containers/gatk4/Dockerfile | 28 ++++++++-------------------- containers/gatk4/environment.yml | 9 +++++++++ 2 files changed, 17 insertions(+), 20 deletions(-) create mode 100644 containers/gatk4/environment.yml diff --git a/containers/gatk4/Dockerfile b/containers/gatk4/Dockerfile index 2fca8dc103..ad3cfc8aef 100644 --- a/containers/gatk4/Dockerfile +++ b/containers/gatk4/Dockerfile @@ -1,27 +1,15 @@ -FROM openjdk:8-slim +FROM nfcore/base:latest LABEL \ author="Maxime Garcia" \ - description="GATK image for use in Sarek" \ + description="GATK4 Image for Sarek" \ maintainer="maxime.garcia@scilifelab.se" -# Install libraries -RUN \ - apt-get update && apt-get install -y --no-install-recommends \ - wget \ - && rm -rf /var/lib/apt/lists/* - -# Setup ENV variables -ENV \ - GATK_VER="4.0.5.1" \ - GATK_HOME="/opt/gatk" +COPY environment.yml / -# Install GATK RUN \ - mkdir $GATK_HOME \ - && cd $GATK_HOME \ - && wget --quiet -O $GATK_HOME/gatk-${GATK_VER}.zip \ - https://github.com/broadinstitute/gatk/releases/download/${GATK_VER}/gatk-${GATK_VER}.zip \ - && unzip gatk-${GATK_VER}.zip \ - && mv gatk-${GATK_VER}/gatk-package-${GATK_VER}-local.jar gatk4.jar \ - && rm gatk-${GATK_VER}.zip + conda env create -f /environment.yml && \ + conda clean -a + + # Export PATH +ENV PATH /opt/conda/envs/sarek-gatk4-2.0/bin:$PATH diff --git a/containers/gatk4/environment.yml b/containers/gatk4/environment.yml new file mode 100644 index 0000000000..041d2a2b92 --- /dev/null +++ b/containers/gatk4/environment.yml @@ -0,0 +1,9 @@ +# You can use this file to create a conda environment: +# conda env create -f environment.yml +name: sarek-gatk4-2.0 +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - gatk4=4.0.4.0