Skip to content

Commit

Permalink
Merge pull request #121 from RabadanLab/buendia/ref_patch
Browse files Browse the repository at this point in the history
Dockerfile and CI/CD to use conda environment
  • Loading branch information
abuendia authored Feb 2, 2024
2 parents b479452 + e486cd8 commit fce869d
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 101 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ jobs:
- name: Build docker image
run: docker build -t test-arcas-hla -f Docker/Dockerfile .
- name: Test with pytest
run: docker run --rm -v $GITHUB_WORKSPACE:/home test-arcas-hla pytest
run: docker run --rm -v $GITHUB_WORKSPACE:/app test-arcas-hla pytest
84 changes: 9 additions & 75 deletions Docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,80 +1,14 @@
# work from latest LTS ubuntu release
FROM ubuntu:18.04
FROM continuumio/miniconda3:latest

# set the environment variables
ENV kallisto_version 0.44.0
ENV samtools_version 1.9
ENV bedtools_version 2.29.2
ENV biopython_version 1.77
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
WORKDIR /app

# run update and install necessary tools from package manager
RUN apt-get update -y && apt-get install -y \
build-essential \
cmake \
zlib1g-dev \
libhdf5-dev \
libnss-sss \
curl \
autoconf \
bzip2 \
python3-dev \
python3-pip \
python \
pigz \
git \
libncurses5-dev \
libncursesw5-dev \
libbz2-dev \
liblzma-dev \
bzip2 \
unzip

# install python libraries
RUN pip3 install numpy
RUN pip3 install scipy
RUN pip3 install pandas
RUN pip3 install biopython==${biopython_version}
RUN pip3 install pytest

# install kallisto
RUN mkdir -p /usr/bin/kallisto \
&& curl -SL https://github.com/pachterlab/kallisto/archive/v${kallisto_version}.tar.gz \
| tar -zxvC /usr/bin/kallisto

RUN mkdir -p /usr/bin/kallisto/kallisto-${kallisto_version}/build
RUN cd /usr/bin/kallisto/kallisto-${kallisto_version}/build && cmake ..
RUN cd /usr/bin/kallisto/kallisto-${kallisto_version}/ext/htslib && autoreconf
RUN cd /usr/bin/kallisto/kallisto-${kallisto_version}/build && make
RUN cd /usr/bin/kallisto/kallisto-${kallisto_version}/build && make install

# install samtools
WORKDIR /usr/bin/
RUN curl -SL https://github.com/samtools/samtools/releases/download/${samtools_version}/samtools-${samtools_version}.tar.bz2 \
> samtools-${samtools_version}.tar.bz2
RUN tar -xjvf samtools-${samtools_version}.tar.bz2
WORKDIR /usr/bin/samtools-${samtools_version}
RUN ./configure
RUN make
RUN make install

# install bedtools
WORKDIR /usr/bin
RUN curl -SL https://github.com/arq5x/bedtools2/releases/download/v${bedtools_version}/bedtools-${bedtools_version}.tar.gz \
> bedtools-${bedtools_version}.tar.gz
RUN tar -xzvf bedtools-${bedtools_version}.tar.gz
WORKDIR /usr/bin/bedtools2
RUN make
RUN ln -s /usr/bin/bedtools2/bin/bedtools /usr/bin/bedtools

# git lfs
# Install Git LFS
RUN apt-get update && \
apt-get install -y git curl pigz
RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
RUN apt-get install -y git-lfs
RUN git lfs install --system --skip-repo

# install arcasHLA
WORKDIR /home/
RUN git clone https://github.com/RabadanLab/arcasHLA.git arcasHLA-master

ENV PATH="${PATH}:/home/arcasHLA-master/"
RUN git clone -b buendia/ref_patch https://github.com/RabadanLab/arcasHLA.git
RUN conda env create -f /app/arcasHLA/environment.yml
RUN echo "source activate arcas-hla" > ~/.bashrc
ENV PATH /opt/conda/envs/arcas-hla/bin:$PATH
17 changes: 1 addition & 16 deletions Docker/README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
# Container for arcasHLA #

Installs up-to-date versions of arcasHLA and all dependencies:

- arcasHLA
- [Git Large File Storage](https://github.com/git-lfs/git-lfs/wiki/Installation)
- coreutils
- [Samtools v1.19](http://www.htslib.org/)
- [bedtools v2.29.1](http://bedtools.readthedocs.io/)
- [pigz v2.3.1](https://zlib.net/pigz/)
- [Kallisto v0.44.0](https://pachterlab.github.io/kallisto/)
- python 3.6
- [Biopython v1.77](https://biopython.org/wiki/Download)
- numpy
- scipy
- pandas
- pytest
Installs up-to-date versions of arcasHLA and all dependencies from `environment.yml`.

### Build ###
In order to use this arcasHLA container, install Docker and build in this directory:
Expand All @@ -33,5 +19,4 @@ docker run \
<image_name> \
arcasHLA extract --o docker/path/to/files/out_dir \
[other options] docker/path/to/files/sample.bam &
```
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ conda activate arcas-hla

```
docker build -t <image-name> -f Docker/Dockerfile .
docker run --rm -v /path/to/repo:/home <image-name> pytest
docker run --rm -v /path/to/repo:/app <image-name> pytest
```
-----

Expand Down
8 changes: 5 additions & 3 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
name: arcas-hla
channels:
- bioconda
- defaults
dependencies:
- bedtools==2.26.0
- kallisto==0.44.0
- pip==23.3.1
- python==3.11.5
- samtools==1.5
- python==3.10.0
- samtools==1.11
- pip:
- biopython==1.83
- numpy==1.26.3
- pandas==2.2.0
- pyarrow==15.0.0
- pytest==8.0.0
- scipy==1.12.0
5 changes: 0 additions & 5 deletions requirements.txt

This file was deleted.

0 comments on commit fce869d

Please sign in to comment.