forked from alejocn5/AlexandrusPS
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
95 lines (76 loc) · 2.49 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# multistage build for docker image for AlexandrusPS pipeline
FROM ubuntu:20.04 AS base
#FROM debian:stable-slim AS base
# Environment
ENV DEBIAN_FRONTEND=noninteractive \
LANG=en_US.UTF-8 \
LC_ALL=C.UTF-8 \
LANGUAGE=en_US.UTF-8
# run time apps
RUN apt-get update && \
apt-get install -yq screen \
proteinortho \
cpanminus \
perl \
r-base && \
rm -rf /var/lib/apt/lists/*
# build layer
FROM base AS build
# Update system and install packages, libcurl for rstatix
RUN apt-get update && \
apt-get install -yq \
build-essential \
libcurl4-openssl-dev \
libnlopt-dev \
cmake \
wget && \
rm -rf /var/lib/apt/lists/*
# install R packages
RUN R -q -e 'install.packages(c("caret", "reshape2", "dplyr", "stringr", "lme4"))' && \
R -q -e 'install.packages("https://cran.r-project.org/src/contrib/Archive/pbkrtest/pbkrtest_0.4-4.tar.gz", repos=NULL, type="source")' && \
R -q -e 'install.packages("rstatix", repos = "https://cloud.r-project.org", dependencies = TRUE, version="0.7.1")' && \
rm -rf /tmp/downloaded_packages
# install PRANK
WORKDIR /programs
RUN wget http://wasabiapp.org/download/prank/prank.linux64.170427.tgz && \
tar zxf prank.linux64.170427.tgz
# install PAML
RUN wget http://abacus.gene.ucl.ac.uk/software/paml4.9j.tgz && \
tar xzf paml4.9j.tgz && \
rm -rf paml4.9j.tgz && \
cd paml4.9j/src && \
make
# run layer
FROM base AS runtime
# Copy build artifacts from build layer
COPY --from=build /usr/local /usr/local
# Install cpan modules (somehow doesn't work in build layer)
RUN cpanm Data::Dumper List::MoreUtils Array::Utils String::ShellQuote List::Util POSIX
COPY --from=build /programs /programs
# add prank to commandline
RUN cp -R ./programs/prank/bin/* ./bin/
# add paml to commandline
RUN cp -R ./programs/paml4.9j/src/baseml ./bin/ &&\
cp -R ./programs/paml4.9j/src/codeml ./bin/ &&\
cp -R ./programs/paml4.9j/src/evolver ./bin/
# Create the writable directory
RUN mkdir /tmp/screens
# Set appropriate permissions
RUN chmod 700 /tmp/screens
ENV SCREENDIR=/tmp/screens
WORKDIR /app
# copy AlexandrusPS
COPY AlexandrusPS_Positive_selection_pipeline ./AlexandrusPS_Positive_selection_pipeline
# set permissions
RUN chown -R 755:755 /app
RUN chmod 755 /app
RUN chown -R 755:755 /usr
RUN chmod 755 /usr
RUN chown -R 755:755 /programs
RUN chmod 755 /programs
RUN chmod a+x /usr/bin/prank
#RUN chown root:root /usr/bin/prank
# mark shell scripts as executable
WORKDIR /app/AlexandrusPS_Positive_selection_pipeline
RUN chmod +x *.sh
SHELL ["/bin/bash", "-c"]