-
Notifications
You must be signed in to change notification settings - Fork 125
/
Dockerfile
103 lines (85 loc) · 3.5 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
FROM mambaorg/micromamba:1.5.8 as app
# Version arguments
# ARG variables only persist during build time
ARG FREYJA_SOFTWARE_VERSION="1.5.2"
ARG IVAR_VER="1.4.3"
ARG SAMTOOLS_VER="1.21"
ARG USHER_VER="0.6.3"
# build and run as root users since micromamba image has 'mambauser' set as the $USER
USER root
# set workdir to default for building; set to /data at the end
WORKDIR /
LABEL base.image="mambaorg/micromamba:1.5.8"
LABEL dockerfile.version="1"
LABEL software="Freyja"
LABEL software.version=${FREYJA_SOFTWARE_VERSION}
LABEL description="Freyja is a tool to recover relative lineage abundances from mixed SARS-CoV-2 samples from a sequencing dataset (BAM aligned to the Hu-1 reference)"
LABEL website="https://github.com/andersen-lab/Freyja"
LABEL license="https://github.com/andersen-lab/Freyja/blob/main/LICENSE"
LABEL maintainer="Kevin Libuit"
LABEL maintainer.email="[email protected]"
LABEL maintainer2="Curtis Kapsak"
LABEL maintainer2.email="[email protected]"
LABEL maintainer3="Erin Young"
LABEL maintainer3.email="[email protected]"
# install dependencies; cleanup apt garbage
RUN apt-get update && apt-get install -y --no-install-recommends \
wget \
ca-certificates \
procps \
git && \
apt-get autoclean && rm -rf /var/lib/apt/lists/*
# Create Freyja conda environment called freyja-env from bioconda recipe
# clean up conda garbage
RUN micromamba create -n freyja-env -c conda-forge -c bioconda -c defaults \
ivar=${IVAR_VER} \
usher=${USHER_VER} \
samtools=${SAMTOOLS_VER} \
pip \
biopython \
click \
cvxpy \
epiweeks \
joblib \
matplotlib-base \
numpy \
pandas \
plotly \
pyarrow \
pysam \
pyyaml \
requests \
seaborn \
tqdm && \
micromamba clean -a -y -f
# set the environment, put new conda env in PATH by default
ENV PATH="/opt/conda/envs/freyja-env/bin:/opt/conda/envs/env/bin:${PATH}" \
LC_ALL=C.UTF-8
RUN wget -q https://github.com/andersen-lab/Freyja/archive/refs/tags/v${FREYJA_SOFTWARE_VERSION}.tar.gz && \
pip install --no-cache-dir v${FREYJA_SOFTWARE_VERSION}.tar.gz && \
rm v${FREYJA_SOFTWARE_VERSION}.tar.gz
# update barcodes
# NOTE: this will download the latest version of the `freyja/data/usher_barcodes.csv` file from GitHub
RUN freyja update
# set working directory to /data
WORKDIR /data
# default command is to pull up help options
CMD [ "freyja", "--help" ]
# new base for testing
FROM app as test
RUN freyja --help && freyja --version
# Grab test data from Freyja version 1.3.4
RUN wget -O /data/Freyja_WWSC2.bam https://github.com/StaPH-B/docker-builds/blob/master/freyja/1.3.4/tests/Freyja_WWSC2.bam?raw=true && \
wget -P /data https://raw.githubusercontent.com/StaPH-B/docker-builds/master/freyja/1.3.4/tests/Freyja_depths.tsv && \
wget -P /data https://raw.githubusercontent.com/StaPH-B/docker-builds/master/freyja/1.3.4/tests/Freyja_variants.tsv && \
wget -P /data https://raw.githubusercontent.com/StaPH-B/docker-builds/master/freyja/1.3.4/tests/nCoV-2019.reference.fasta
# Run Freyja
RUN freyja variants /data/Freyja_WWSC2.bam --variants /data/test_variants.tsv --depths /data/test_depths.tsv --ref /data/nCoV-2019.reference.fasta && \
freyja demix /data/test_variants.tsv /data/test_depths.tsv --output /data/test_demix.tsv
# Check validity of outputs
RUN head /data/test_variants.tsv && \
head /data/test_depths.tsv && \
head /data/test_demix.tsv && \
grep "Omicron" /data/test_demix.tsv
# print barcode version and freyja version
RUN freyja demix --version