-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
119 lines (98 loc) · 4.63 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
FROM rocker/rstudio:4.0.3
MAINTAINER Jeremy Leipzig <[email protected]>
#https://github.com/opencontainers/image-spec/blob/master/annotations.md
LABEL org.opencontainers.image.created="2020-12-19T19:39:14UTC"
LABEL org.opencontainers.image.title = "Leiby Placenta Reproduction"
LABEL org.opencontainers.image.description = "This generates the Leiby placenta paper analysis reverse engineered from https://doi.org/10.1186/s40168-018-0575-4"
LABEL org.opencontainers.image.url = "https://github.com/leipzig/placenta"
WORKDIR "/placenta"
COPY Snakefile .
COPY config.yaml.template config.yaml
COPY dadaFilterTrim.R .
COPY runDada.R .
COPY phyloseq.Rmd .
COPY dadaFilterTrim.R .
COPY utils utils
COPY metadata metadata
COPY dependencies dependencies
#https://github.com/biocore/qiime/archive/1.9.1.tar.gz
COPY 1.9.1.tar.gz .
RUN apt-get update && apt-get install -y build-essential
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
ENV PATH /opt/conda/bin:$PATH
RUN apt-get update --fix-missing && \
apt-get install -y wget bzip2 ca-certificates curl git awscli && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
ENV TINI_VERSION v0.16.1
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /usr/bin/tini
RUN chmod +x /usr/bin/tini
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \
/bin/bash ~/miniconda.sh -b -p /opt/conda && \
rm ~/miniconda.sh && \
/opt/conda/bin/conda clean -tipsy && \
ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \
echo "conda activate base" >> ~/.bashrc
#https://stackoverflow.com/a/62674910/264696
SHELL ["/bin/bash", "-c"]
RUN conda init bash && conda create -y --name placenta python=3.7
SHELL ["conda", "run", "-n", "placenta", "/bin/bash", "-c"]
RUN conda config --add channels defaults
RUN conda config --add channels bioconda
RUN conda config --add channels conda-forge
#main environment
RUN conda install -y mamba
RUN mamba install -y r-base==4.0.3 snakemake rpy2 pysradb bioconductor-dada2 r-dplyr parallel-fastq-dump fastx_toolkit
SHELL ["/bin/bash","-c"]
#qiime1 environment requires Python2.7
RUN conda init bash && conda create -y --name qiime1env python=2.7
SHELL ["conda", "run", "-n", "qiime1env", "/bin/bash", "-c"]
RUN conda config --add channels defaults
RUN conda config --add channels bioconda
RUN conda config --add channels conda-forge
RUN conda config --add channels anaconda
RUN conda install -y mamba
#RUN mamba install -y gxx_linux-64
RUN mamba install -y matplotlib=1.4.3 mock nose
RUN mamba install -y r-optparse
RUN mamba install -y bioconductor-metagenomeseq
RUN mamba install -y r-plyr r-RJSONIO
RUN mamba install -y bioconductor-rhdf5 bioconductor-biomformat
RUN mamba install -y numpy
RUN mamba install -y pandas==0.24.2
RUN mamba install -y scikit-bio==0.2.3
RUN mamba install -y cogent==1.5.3
RUN pip install --upgrade cython
RUN pip install biom-format==2.1.4
#this had trouble from conda so we install it from source later
#RUN mamba install -y r-biom
RUN gunzip 1.9.1.tar.gz && tar -xvf 1.9.1.tar
# make qiime work with matplotlib 1.4.3
RUN perl -p -i -e 's/axisbg/facecolor/' qiime-1.9.1/tests/test_make_2d_plots.py
RUN perl -p -i -e 's/axisbg/facecolor/' qiime-1.9.1/scripts/make_2d_plots.py
RUN perl -p -i -e 's/axisbg/facecolor/' qiime-1.9.1/qiime/make_2d_plots.py
RUN R CMD INSTALL dependencies/biom
RUN cd qiime-1.9.1 && cp ../dependencies/uclustq1.2.22_i86linux64 ./scripts/uclust && /opt/conda/envs/qiime1env/bin/python setup.py install
RUN rm 1.9.1.tar
RUN unzip dependencies/Silva_119_release.zip -d .
RUN mv Silva119_release SILVA_119_QIIME_release
### sunbeam
SHELL ["/bin/bash", "-c"]
SHELL ["conda", "run", "-n", "placenta", "/bin/bash", "-c"]
RUN conda config --add channels defaults
RUN conda config --add channels bioconda
RUN conda config --add channels conda-forge
RUN conda config --add channels eclarke
#important not to use a archive here because of weird scm rules
RUN git clone --depth 1 --branch v1.3.0 https://github.com/sunbeam-labs/sunbeam.git
RUN conda init bash && conda create -y --name sunbeam python=3.6
RUN conda install -y mamba
RUN mamba install -y snakemake pysam ruamel.yaml biopython trimmomatic fastqc blast kraken kraken-biom vsearch jellyfish \
cutadapt bwa pandas megahit prodigal setuptools_scm komplexity rust-bio-tools semantic_version
RUN cd sunbeam && pip install .
RUN chown -R root:staff /placenta
RUN chmod 775 /placenta
RUN echo "setwd('/placenta')" > /home/rstudio/.Rprofile
#ENTRYPOINT [ "/usr/bin/tini", "--" ]
#CMD ["conda", "run", "-n", "placenta", "/bin/bash", "-c","snakemake --cores all"]