Skip to content

Commit

Permalink
raven_assembler updated with docker image (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
asyakhl authored Dec 19, 2023
1 parent 5d2f9c4 commit 12e68b1
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 4 deletions.
1 change: 1 addition & 0 deletions config/containers.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"images": {
"raven": "docker://asyakhleborodova/raven_assembly:v0.1.0"
}
}
59 changes: 59 additions & 0 deletions docker/raven_assembler/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
FROM ubuntu:22.04

RUN mkdir -p /opt2 && mkdir -p /data2
WORKDIR /opt2

# Set time zone to US east coast
ENV TZ=America/New_York
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \
&& echo $TZ > /etc/timezone

RUN apt-get update \
&& apt-get -y upgrade \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
build-essential \
cmake \
curl \
gawk \
git \
gzip \
g++ \
libboost-dev \
libcurl4-openssl-dev \
libssl-dev \
libxml2-dev \
locales \
# python/3.10.6
python3 \
python3-pip \
samtools \
wget \
zlib1g-dev \
&& apt-get clean && apt-get purge \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*


ENV CONDA_DIR /opt2/conda
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \
/bin/bash ~/miniconda.sh -b -p /opt2/conda

# Put conda in path so we can use conda activate
ENV PATH=$CONDA_DIR/bin:$PATH

# Set the locale
RUN localedef -i en_US -f UTF-8 en_US.UTF-8

############### INSTALL ################
RUN ln -sf /usr/bin/python3 /usr/bin/python
RUN pip3 install --upgrade pip \
&& pip3 install matplotlib \
&& pip3 install numpy \
&& pip3 install pandas \
&& pip3 install scipy

RUN conda install -y --channel=defaults --channel=bioconda --channel=conda-forge raven-assembler

WORKDIR /opt2

COPY Dockerfile /opt2
WORKDIR /data2
35 changes: 35 additions & 0 deletions docker/raven_assembler/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
## Steps for Building Docker Images

Directly below are instructions for building an image using the provided Dockerfile:

```bash
# See listing of images on computer
docker image ls

# Build from Dockerfile
docker build --no-cache -f Dockerfile --tag=raven_assembly:v0.1.0 .

# Testing, take a peek inside
docker run -ti raven_assembly:v0.1.0 /bin/bash

# Updating Tag before pushing to DockerHub
docker tag raven_assembly:v0.1.0 asyakhleborodova/raven_assembly:v0.1.0
docker tag raven_assembly:v0.1.0 asyakhleborodova/raven_assembly # latest

# Check out new tag(s)
docker image ls

# Push new tagged image to DockerHub
docker push asyakhleborodova/raven_assembly:v0.1.0
docker push asyakhleborodova/raven_assembly:latest
```

### Other Recommended Steps

Scan your image for known vulnerabilities:

```bash
docker scan raven_assembly:v0.1.0
```

> **Please Note**: Any references to `asyakhleborodova` should be replaced your username if you would also like to push the image to a non-org account.
6 changes: 2 additions & 4 deletions workflow/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ rule To_Fasta:
params:
rname="To_Fasta",
samtools="samtools/1.9",
seqkit="seqkit/0.12.1",
seqkit="seqkit/2.2.0",
dir=directory(join(workpath, "reads")),
temp_ext = lambda w: ext[w.samples],
FQ=join(workpath, "reads/{samples}.fastq")
Expand Down Expand Up @@ -130,17 +130,15 @@ rule raven_assembly:
dir=directory(join(workpath, "raven_assembly")),
gfa="{samples}.raven.gfa",
#conda: "envs/raven-assembler.yaml"
container: config['images']['raven']
threads: 32
shell:
"""
source /data/NCBR/apps/genome-assembly/conda/etc/profile.d/conda.sh
conda activate raven-assembler
mkdir -p {params.dir}
cd {params.dir}
#raven --threads {threads} {input} > {output.fa}
raven --graphical-fragment-assembly {params.gfa} --threads {threads} {input}
awk '$1 ~/S/ {{print ">"$2"\\n"$3}}' {output.gfa} > {output.fa}
conda deactivate
"""

# rule wtdbg2_assembly:
Expand Down

0 comments on commit 12e68b1

Please sign in to comment.