Skip to content

Commit

Permalink
Containerized
Browse files Browse the repository at this point in the history
  • Loading branch information
aw-watson committed Sep 9, 2024
1 parent f4e8762 commit a4eb229
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 2 deletions.
47 changes: 47 additions & 0 deletions runAnnotation/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# syntax=docker/dockerfile:1
FROM continuumio/miniconda3:24.5.0-0 AS build

ENV container=docker

# add conda channels
RUN conda config --add channels conda-forge \
&& conda config --add channels bioconda

RUN conda init bash \
&& . ~/.bashrc \
&& conda create --name annotation \
&& conda activate annotation

RUN conda install -n annotation -c bioconda perl-lwp-protocol-https
RUN conda install -n annotation -c conda-forge r-base
RUN conda install -n annotation -c bioconda prokka
RUN conda install -n annotation -c bioconda mummer
RUN conda install -n annotation -c bioconda blast=2.16
RUN conda install -n annotation -c bioconda perl-yaml

RUN conda install -c conda-forge conda-pack

#Custom implementation of RATT from EDGE
RUN wget https://ref-db.edgebioinformatics.org/EDGE/dev/edge_dev_thirdParty_softwares.tgz \
&& tar -xvzf edge_dev_thirdParty_softwares.tgz \
&& tar -xvzf thirdParty/RATT.tar.gz -C . \
&& mv RATT /opt/conda/envs/annotation/opt

#add scripts from this project to bin
ADD bin/* /opt/conda/envs/annotation/bin

#pack environment for runtime image
RUN conda-pack -n annotation -o /tmp/env.tar && \
mkdir /venv && cd /venv && tar xf /tmp/env.tar && \
rm /tmp/env.tar

RUN /venv/bin/conda-unpack

FROM debian:latest AS runtime

COPY --from=build /venv /venv

ENV PATH=/venv/bin:/venv/opt/RATT:$PATH

SHELL ["/bin/bash", "-c"]
CMD /bin/bash
3 changes: 2 additions & 1 deletion runAnnotation/bin/runRATT.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

export RATT_HOME=$CONDA_PREFIX/opt/RATT #remove when Dockerizeing
#this is the correct location in this workflow's container
export RATT_HOME=/venv/opt/RATT #remove when Dockerizeing

$RATT_HOME/start.ratt.sh $1 $2 $3 $4
6 changes: 6 additions & 0 deletions runAnnotation/nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ params {

}

singularity {
enabled=true
runOptions="--compat --bind .:/venv/bin/ec_info"
}
process.container = 'apwat/annotation:0.4'

workflow.onComplete = {
"rm -rf nf_assets".execute().text
}
Expand Down
1 change: 0 additions & 1 deletion runAnnotation/runAnnotation.nf
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ process annPlot {
path "plot_gff3.log"
path "annotation_stats_plots.pdf"
path "${params.projName}.txt", optional:true
//see what goes missing if we only publish that

script:
def rattReport = params.annotateProgram.equalsIgnoreCase("ratt") ? "awk \'\$1 ~ /CDS|RNA/ {print \$1\": \"\$2}' plot_gff3.log > ${params.projName}.txt" : ""
Expand Down

0 comments on commit a4eb229

Please sign in to comment.