From 177bf6946444f27aba6f99e6e0094c97f82e47eb Mon Sep 17 00:00:00 2001 From: Stephen Watts Date: Tue, 19 Mar 2024 18:52:17 +1100 Subject: [PATCH] Use Bioconda/BioContainers for bwa-mem2 module --- modules/local/bwa-mem2/mem/Dockerfile | 19 ------------------- modules/local/bwa-mem2/mem/environment.yml | 9 +++++++++ modules/local/bwa-mem2/mem/main.nf | 6 ++++-- 3 files changed, 13 insertions(+), 21 deletions(-) delete mode 100644 modules/local/bwa-mem2/mem/Dockerfile create mode 100644 modules/local/bwa-mem2/mem/environment.yml diff --git a/modules/local/bwa-mem2/mem/Dockerfile b/modules/local/bwa-mem2/mem/Dockerfile deleted file mode 100644 index ba36b89b..00000000 --- a/modules/local/bwa-mem2/mem/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM docker.io/mambaorg/micromamba:1.5.6 - -USER root - -RUN \ - apt-get update && \ - apt-get install -y procps && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* - -USER mambauser - -RUN \ - micromamba install -y -n base -c bioconda -c conda-forge \ - 'bwa-mem2 ==2.2.1' \ - 'sambamba ==1.0' && \ - micromamba clean --all --yes - -ENV PATH="/opt/conda/bin:/opt/conda/condabin:${PATH}" diff --git a/modules/local/bwa-mem2/mem/environment.yml b/modules/local/bwa-mem2/mem/environment.yml new file mode 100644 index 00000000..571dda57 --- /dev/null +++ b/modules/local/bwa-mem2/mem/environment.yml @@ -0,0 +1,9 @@ +name: bwa-mem2_mem +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::bwa-mem2=2.2.1 + - bioconda::samtools=1.19.2 + - bioconda::sambamba=1.0 diff --git a/modules/local/bwa-mem2/mem/main.nf b/modules/local/bwa-mem2/mem/main.nf index 2ae102b6..961791eb 100644 --- a/modules/local/bwa-mem2/mem/main.nf +++ b/modules/local/bwa-mem2/mem/main.nf @@ -2,8 +2,10 @@ process BWAMEM2_ALIGN { tag "${meta.id}" label 'process_high' - // TODO(SW): create BioContainers multi-package image when appropriate - container 'docker.io/scwatts/bwa-mem2:2.2.1' + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/mulled-v2-4dde50190ae599f2bb2027cb2c8763ea00fb5084:544519c4a0ff7e9616a3b44afde1f143c52f10c3-0' : + 'quay.io/biocontainers/mulled-v2-4dde50190ae599f2bb2027cb2c8763ea00fb5084:544519c4a0ff7e9616a3b44afde1f143c52f10c3-0' }" input: tuple val(meta), path(reads_fwd), path(reads_rev)