forked from StaPH-B/docker-builds
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
116 lines (96 loc) · 3.92 KB
/
Dockerfile
File metadata and controls
116 lines (96 loc) · 3.92 KB
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
# for easy upgrade later. ARG variables only persist during build time
ARG BCFTOOLS_VER="1.23"
FROM ubuntu:jammy AS builder
# re-instantiate variable
ARG BCFTOOLS_VER
# install dependencies, cleanup apt garbage
RUN apt-get update && apt-get install --no-install-recommends -y \
wget \
ca-certificates \
perl \
bzip2 \
autoconf \
automake \
make \
gcc \
zlib1g-dev \
libbz2-dev \
liblzma-dev \
libcurl4-gnutls-dev \
libssl-dev \
libperl-dev \
libgsl0-dev \
libdeflate-dev \
procps && \
rm -rf /var/lib/apt/lists/* && apt-get autoclean
# download, compile, and install bcftools
RUN wget https://github.com/samtools/bcftools/releases/download/${BCFTOOLS_VER}/bcftools-${BCFTOOLS_VER}.tar.bz2 && \
tar -xjf bcftools-${BCFTOOLS_VER}.tar.bz2 && \
rm -v bcftools-${BCFTOOLS_VER}.tar.bz2 && \
cd bcftools-${BCFTOOLS_VER} && \
./configure --enable-libgsl --enable-perl-filters &&\
make && \
make install && \
make test
### start of app stage ###
FROM ubuntu:jammy AS app
# re-instantiate variable
ARG BCFTOOLS_VER
# putting the labels in
LABEL base.image="ubuntu:jammy"
LABEL dockerfile.version="1"
LABEL software="bcftools"
LABEL software.version="${BCFTOOLS_VER}"
LABEL description="Variant calling and manipulating files in the Variant Call Format (VCF) and its binary counterpart BCF"
LABEL website="https://github.com/samtools/bcftools"
LABEL license="https://github.com/samtools/bcftools/blob/develop/LICENSE"
LABEL maintainer="Erin Young"
LABEL maintainer.email="eriny@utah.gov"
LABEL maintainer2="Curtis Kapsak"
LABEL maintainer2.email="kapsakcj@gmail.com"
# install dependencies required for running bcftools
# https://github.com/samtools/bcftools/blob/develop/INSTALL#L29
RUN apt-get update && apt-get install --no-install-recommends -y \
perl\
zlib1g \
gsl-bin \
bzip2 \
liblzma5 \
libcurl3-gnutls \
libdeflate0 \
procps \
&& apt-get autoclean && rm -rf /var/lib/apt/lists/*
# copy in bcftools executables from builder stage
COPY --from=builder /usr/local/bin/* /usr/local/bin/
# copy in bcftools plugins from builder stage
COPY --from=builder /usr/local/libexec/bcftools/* /usr/local/libexec/bcftools/
# set locale settings for singularity compatibility
ENV LC_ALL=C
# set final working directory
WORKDIR /data
# default command is to pull up help optoins
CMD ["bcftools", "--help"]
### start of test stage ###
FROM app AS test
# running --help and listing plugins
RUN bcftools --help && bcftools plugin -lv
# install wget for downloading test files
RUN apt-get update && apt-get install -y wget vcftools
RUN echo "Downloading test SC2 BAM and FASTA and running bcftools mpileup and bcftools call test commands..." && \
wget -q https://raw.githubusercontent.com/artic-network/artic-ncov2019/master/primer_schemes/nCoV-2019/V4/SARS-CoV-2.reference.fasta && \
wget -q https://raw.githubusercontent.com/StaPH-B/docker-builds/master/tests/SARS-CoV-2/SRR13957123.primertrim.sorted.bam && \
bcftools mpileup -A -d 200 -B -Q 0 -f SARS-CoV-2.reference.fasta SRR13957123.primertrim.sorted.bam | \
bcftools call -mv -Ov -o SRR13957123.vcf
RUN echo "Testing plugins..." && \
bcftools +counts SRR13957123.vcf
RUN echo "Testing bcftools polysomy..." && \
wget -q https://samtools.github.io/bcftools/howtos/cnv-calling/usage-example.tgz &&\
tar -xvf usage-example.tgz &&\
zcat test.fcr.gz | ./fcr-to-vcf -b bcftools -a map.tab.gz -o outdir/ &&\
bcftools cnv -o cnv/ outdir/test.vcf.gz &&\
bcftools polysomy -o psmy/ outdir/test.vcf.gz &&\
head psmy/dist.dat
RUN echo "Reading test data from Google Cloud to validate GCS support" && \
bcftools head -h 20 gs://genomics-public-data/references/hg38/v0/1000G_phase1.snps.high_confidence.hg38.vcf.gz
RUN echo "Reading test data from S3 to validate AWS support" && \
bcftools head -h 20 s3://human-pangenomics/T2T/CHM13/assemblies/variants/GATK_CHM13v2.0_Resource_Bundle/resources-broad-hg38-v0-1000G_phase1.snps.high_confidence.hg38.t2t-chm13-v2.0.vcf.gz