Skip to content

Commit

Permalink
Add docker option
Browse files Browse the repository at this point in the history
- together with minor changes to installation option 2
  • Loading branch information
chaklim committed Dec 3, 2019
1 parent a451581 commit 774f0e7
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 3 deletions.
32 changes: 32 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM ubuntu:16.04

ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 PATH=/opt/clair/bin:/opt/conda/bin:$PATH

# update ubuntu packages
RUN apt-get update --fix-missing && \
yes|apt-get upgrade && \
apt-get install -y \
wget \
bzip2 \
make \
gcc && \
rm -rf /bar/lib/apt/lists/*

WORKDIR /opt/clair
COPY . .

# install anaconda
RUN wget --quiet https://repo.anaconda.com/archive/Anaconda3-2019.10-Linux-x86_64.sh && \
bash Anaconda3-2019.10-Linux-x86_64.sh -b -p /opt/conda && \
rm Anaconda3-2019.10-Linux-x86_64.sh

# create conda environment
RUN conda config --add channels defaults && \
conda config --add channels bioconda && \
conda config --add channels conda-forge && \
conda create -n clair-env -c bioconda -y clair
RUN echo "source activate clair-env" > ~/.bashrc
ENV PATH /opt/conda/envs/clair-env/bin:$PATH
RUN /bin/bash -c ". activate clair-env && \
pypy3 -m ensurepip && \
pypy3 -m pip install --no-cache-dir intervaltree blosc"
44 changes: 41 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,11 @@ conda config --add channels conda-forge
conda create -n clair-env -c bioconda clair
conda activate clair-env

# use `clair.py` instead of `python clair.py`, the same afterwards
clair.py --help
# store clair.py PATH into $CLAIR variable
CLAIR=`which clair.py`

# run clair like this afterwards
python $CLAIR --help
```

The conda environment has the Pypy intepreter installed, but two Pypy libraries `intervaltree` and `blosc` are still missing. The reason why the two packages are not installed by default is because they are not yet available in any conda repositories. To install the two libraries for Pypy, after activating the conda environment, please run the follow commands:
Expand All @@ -88,7 +91,42 @@ Download the models to a folder and continue the process
(Please refer to `# download pretrained model` in [Installation Option 1](#option-1-conda-for-virtual-environment))


### [TODO] Option 3. Docker
### Option 3. Docker
```bash
# clone Clair
git clone --depth=1 https://github.com/HKU-BAL/Clair.git
cd Clair

# download pretrained model (for ONT)
mkdir ont && cd ont
wget http://www.bio8.cs.hku.hk/clair_models/ont/12.tar
tar -xf 12.tar
cd ../

# download pretrained model (for PacBio CCS)
mkdir pacbio && cd pacbio
wget http://www.bio8.cs.hku.hk/clair_models/pacbio/ccs/15.tar
tar -xf 15.tar
cd ../

# download pretrained model (for Illumina)
mkdir illumina && cd illumina
wget http://www.bio8.cs.hku.hk/clair_models/illumina/12345.tar
tar -xf 12345.tar
cd ../

# build a docker image named clair_docker_image
docker build -f ./Dockerfile -t clair_docker_image .

# run docker image
docker run -it clair_docker_image

# store clair.py PATH into $CLAIR variable
CLAIR=`which clair.py`

# run clair like this afterwards
python $CLAIR --help
```

### After Installation

Expand Down

0 comments on commit 774f0e7

Please sign in to comment.