-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
89 lines (69 loc) · 3.23 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
FROM python:3.8
# dependencies for generating report
ENV LD_LIBRARY_PATH=/usr/local/lib
# install dnaplotlib for creating the genome diagram
# hard-pin some dependencies for onecodex 0.9.6
RUN pip install numpy pysam==0.16 biopython==1.78 PyVCF dnaplotlib onecodex[all,reports]==v0.9.6 \
nbconvert==5.6.1 click==8.0.4 Jinja2==3.0.3
USER root
RUN apt-get update \
&& apt-get autoclean \
&& apt-get install -y gnupg curl \
&& curl -sL https://deb.nodesource.com/setup_14.x | bash - \
&& apt-get install -y nodejs npm \
unzip \
default-jre \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN npm install -g --unsafe-perm vega vega-lite vega-cli canvas
WORKDIR /opt
# install Conda
RUN curl https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \
> Miniconda3-latest-Linux-x86_64.sh \
&& yes \
| bash Miniconda3-latest-Linux-x86_64.sh -b -p /opt/miniconda3
# put system path first so that conda doesn't override python
ENV PATH=$PATH:/opt/miniconda3/bin/
# install environment's dependencies
COPY environment.yml /opt/
RUN conda env create --solver libmamba -f /opt/environment.yml
# install artic into conda environment "artic"
RUN git clone https://github.com/artic-network/fieldbioinformatics.git \
&& cd fieldbioinformatics \
&& git checkout 1.2.1 \
&& conda env create --solver libmamba -f environment.yml \
&& conda run -n artic python setup.py install \
&& conda clean -a
# install snpeff
RUN curl -k -L https://sourceforge.net/projects/snpeff/files/snpEff_v4_5covid19_core.zip/download --output snpEff_v4_5covid19_core.zip\
&& unzip snpEff_v4_5covid19_core.zip \
&& mv snpEff /usr/local/bin \
&& rm snpEff_v4_5covid19_core.zip
COPY reference /reference
# ARTIC's vcf_filter.py breaks when a variant's call score is "."
# I fixed this in reference/vcf_filter_edited.py
COPY /reference/vcf_filter.edited.py /root/miniconda3/envs/artic/lib/python3.6/site-packages/artic-1.2.1-py3.6.egg/artic/vcf_filter.py
# Add ARTIC 4.1 patch as a primer scheme
RUN mkdir /primer_schemes
COPY /reference/primer_schemes/ /primer_schemes/
# install pangolin into conda environment "pangolin"
RUN conda create -n pangolin
RUN conda install --solver libmamba -c bioconda -c conda-forge -c defaults -n pangolin pangolin==4.3
# install nextclade & download sars-cov-2 dataset
RUN curl -fsSL 'https://github.com/nextstrain/nextclade/releases/download/2.14.0/nextclade-x86_64-unknown-linux-gnu' -o '/usr/local/bin/nextclade' && chmod +x /usr/local/bin/nextclade
RUN /usr/local/bin/nextclade dataset get --name 'sars-cov-2' --output-dir '/usr/local/bin/data/sars-cov-2'
# Setup onecodex_pdf export option
RUN mkdir -p /usr/local/share/fonts \
&& cp /usr/local/lib/python3.8/site-packages/onecodex/assets/fonts/*.otf /usr/local/share/fonts \
&& fc-cache
ADD jobscript.sh /usr/local/bin/
ADD covid19_call_variants.sh /usr/local/bin/
ADD covid19_call_variants.ont.sh /usr/local/bin/
ADD post_process_variants.sh /usr/local/bin/
ADD generate_tsv.py /usr/local/bin
ADD insert_coverage_stats.py /usr/local/bin
ADD report.ipynb /
ENV MPLCONFIGDIR /tmp
RUN chmod -R a+rwx /reference /primer_schemes /report.ipynb
# so we can include git hash in report for tracking
COPY .git /.git