forked from opentargets/genetics-colocalisation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
79 lines (64 loc) · 2.88 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
FROM r-base:3.6.3
ENV credset_dir='/data/finemapping/credset'
ENV DEBIAN_FRONTEND=noninteractive
# RUN apt-get update && \
# apt-get remove -y -o APT::Immediate-Configure=0 libgcc1 && \
# apt-get install -y ant && \
# apt-get clean;
# Install OpenJDK-8
RUN apt-get update && \
apt-get install -y gcc-9-base libgcc-9-dev libc6-dev && \
apt-get install -y openjdk-8-jdk && \
apt-get clean;
# Fix certificate issues
RUN apt-get update && \
apt-get install ca-certificates-java && \
apt-get clean && \
update-ca-certificates -f;
# Install JDK-11 (by JS, but later removed)
#RUN wget https://download.java.net/java/ga/jdk11/openjdk-11_linux-x64_bin.tar.gz -P /software/jdk
#RUN tar -xvf /software/jdk/openjdk-11*_bin.tar.gz -C /software/jdk/
# Install parallel
RUN apt-get update && \
apt-get install -yf parallel
# Conda and the environment dependencies
RUN mkdir /conda
RUN wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /conda/miniconda.sh
RUN bash /conda/miniconda.sh -b -p /conda/miniconda
ENV PATH="/conda/miniconda/bin:${PATH}"
COPY ./environment.yaml /coloc/
WORKDIR /coloc
# I'm not sure why, but in latest build it takes many hours for
# conda to complete "solving environment..."
RUN conda env create -n coloc --file environment.yaml
# Setup JAVA_HOME -- useful for docker commandline
ENV JAVA_HOME='/usr/lib/jvm/java-8-openjdk-amd64/'
# ENV JAVA_HOME='/usr/lib/jvm/java-11-openjdk-amd64/'
#ENV JAVA_HOME='/software/jdk/jdk-11/'
# Google Cloud SDK
# (Not needed on google VMs)
#RUN apt-get install -y curl
#RUN curl https://sdk.cloud.google.com | bash
# Default command
CMD ["/bin/bash"]
# Install GCTA
RUN apt-get install unzip
RUN wget https://cnsgenomics.com/software/gcta/bin/gcta_1.92.3beta3.zip --no-check-certificate -P /software/gcta
RUN unzip /software/gcta/gcta_1.92.3beta3.zip -d /software/gcta
RUN rm /software/gcta/gcta_1.92.3beta3.zip
ENV PATH="/software/gcta/gcta_1.92.3beta3:${PATH}"
# Install R packages
# Coloc install didn't seem to work well via Conda, so doing it here
RUN apt-get -y install libxml2-dev libssl-dev libcurl4-openssl-dev
RUN Rscript -e "install.packages('BiocManager', dependencies=TRUE, repos='http://cran.rstudio.com/')" -e "BiocManager::install(c('snpStats'))"
RUN R -e "install.packages('coloc', dependencies=TRUE, repos='http://cran.rstudio.com/')"
RUN R -e "install.packages('tidyverse', dependencies=TRUE, repos='http://cran.rstudio.com/')"
RUN R -e "install.packages('R.utils', dependencies=TRUE, repos='http://cran.rstudio.com/')"
# Install plink
RUN wget https://s3.amazonaws.com/plink1-assets/plink_linux_x86_64_20210606.zip --no-check-certificate -P /software/plink
RUN unzip /software/plink/plink_linux_x86_64_20210606.zip -d /software/plink
ENV PATH="/software/plink:${PATH}"
# Copy project to its own coloc directory
COPY ./ /coloc
# Activate coloc environment
ENV PATH /conda/miniconda/envs/coloc/bin:$PATH