Skip to content

Commit a10d56c

Browse files
authored
Merge pull request #1523 from StaPH-B/cjk-snpdists
adds snp-dists 1.2.0
2 parents 7453c20 + 02f2065 commit a10d56c

File tree

3 files changed

+115
-1
lines changed

3 files changed

+115
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ To learn more about the docker pull rate limits and the open source software pro
318318
| [Smalt](https://hub.docker.com/r/staphb/smalt) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/smalt)](https://hub.docker.com/r/staphb/smalt) | <details><summary>Click to see all versions</summary> <ul><li>[0.7.6](./build-files/smalt/0.7.6/)</li></ul> </details> | https://www.sanger.ac.uk/tool/smalt-0/ |
319319
| [snpeff](https://hub.docker.com/r/staphb/snpeff) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/snpeff)](https://hub.docker.com/r/staphb/snpeff) | <details><summary>Click to see all versions</summary> <ul><li>[5.1](./build-files/snpeff/5.1/)</li><li>[5.2a](./build-files/snpeff/5.2a/)</li><li>[5.2f](./build-files/snpeff/5.2f/)</li></ul> </details> | https://pcingola.github.io/SnpEff |
320320
| [Snippy](https://hub.docker.com/r/staphb/snippy) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/snippy)](https://hub.docker.com/r/staphb/snippy) | <details><summary>Click to see all versions</summary> <ul><li>[4.4.5](./build-files/snippy/4.4.5/)</li><li>[4.5.1](./build-files/snippy/4.5.1/)</li><li>[4.6.0](./build-files/snippy/4.6.0/)</li></ul> </details> | https://github.com/tseemann/snippy |
321-
| [snp-dists](https://hub.docker.com/r/staphb/snp-dists) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/snp-dists)](https://hub.docker.com/r/staphb/snp-dists) | <details><summary>Click to see all versions</summary> <ul><li>[0.6.2](./build-files/snp-dists/0.6.2/)</li><li>[0.8.2](./build-files/snp-dists/0.8.2/)</li></ul> </details> | https://github.com/tseemann/snp-dists |
321+
| [snp-dists](https://hub.docker.com/r/staphb/snp-dists) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/snp-dists)](https://hub.docker.com/r/staphb/snp-dists) | <details><summary>Click to see all versions</summary> <ul><li>[0.6.2](./build-files/snp-dists/0.6.2/)</li><li>[0.8.2](./build-files/snp-dists/0.8.2/)</li><li>[1.2.0](./build-files/snp-dists/1.2.0/)</li></ul> </details> | https://github.com/tseemann/snp-dists |
322322
| [SNP-sites](https://hub.docker.com/r/staphb/snp-sites) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/snp-sites)](https://hub.docker.com/r/staphb/snp-sites) | <details><summary>Click to see all versions</summary> <ul><li>[2.3.3](./build-files/snp-sites/2.3.3/)</li><li>[2.5.1](./build-files/snp-sites/2.5.1/)</li></ul> </details> | https://github.com/sanger-pathogens/snp-sites |
323323
| [SNVPhyl-tools](https://hub.docker.com/r/staphb/snvphyl-tools) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/snvphyl-tools)](https://hub.docker.com/r/staphb/snvphyl-tools) | <details><summary>Click to see all versions</summary> <ul><li>[1.8.2](./build-files/snvphyl-tools/1.8.2/)</li></ul> </details> | https://github.com/phac-nml/snvphyl-tools |
324324
| [SPAdes](https://hub.docker.com/r/staphb/spades/) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/spades)](https://hub.docker.com/r/staphb/spades) | <details><summary>Click to see all versions</summary> <ul><li>[3.8.2](./build-files/spades/3.8.2/)</li><li>[3.12.0](./build-files/spades/3.12.0/)</li><li>[3.13.0](./build-files/spades/3.13.0/)</li><li>[3.14.0](./build-files/spades/3.14.0/)</li><li>[3.14.1](./build-files/spades/3.14.1/)</li><li>[3.15.0](./build-files/spades/3.15.0/)</li><li>[3.15.1](./build-files/spades/3.15.1/)</li><li>[3.15.2](./build-files/spades/3.15.2/)</li><li>[3.15.3](./build-files/spades/3.15.3/)</li><li>[3.15.4](./build-files/spades/3.15.4/)</li><li>[3.15.5](./build-files/spades/3.15.5/)</li><li>[4.0.0](./build-files/spades/4.0.0/)</li><li>[4.1.0](./build-files/spades/4.1.0/)</li><li>[4.2.0](./build-files/spades/4.2.0/)</li></ul></details> | https://github.com/ablab/spades </br> http://cab.spbu.ru/software/spades/ |
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
ARG SNP_DISTS_VER=1.2.0
2+
3+
### Builder stage
4+
FROM ubuntu:noble AS builder
5+
6+
ARG SNP_DISTS_VER
7+
8+
# install dependencies needed for compilation; cleanup apt garbage
9+
RUN apt-get update && apt-get install -y --no-install-recommends \
10+
wget \
11+
ca-certificates \
12+
procps \
13+
make \
14+
zlib1g \
15+
gcc \
16+
libz-dev \
17+
build-essential \
18+
git && \
19+
apt-get autoclean && rm -rf /var/lib/apt/lists/*
20+
21+
# install (recent version of) bats for testing framework since version in apt for ubuntu:noble does not include the "bats --abort" option
22+
RUN git clone https://github.com/bats-core/bats-core.git && \
23+
cd bats-core && \
24+
./install.sh /usr/local
25+
26+
# install snp-dists; run make check and bats tests
27+
# decided to run bats tests here since it uses binaries located within /snp-dists-<ver>/bin/ rather than installed version in /usr/local/bin/
28+
RUN echo "Installing snp-dists version ${SNP_DISTS_VER}" && \
29+
wget -q https://github.com/tseemann/snp-dists/archive/v${SNP_DISTS_VER}.tar.gz && \
30+
tar -xzf v${SNP_DISTS_VER}.tar.gz && \
31+
rm -v v${SNP_DISTS_VER}.tar.gz && \
32+
cd /snp-dists-${SNP_DISTS_VER} && \
33+
make && \
34+
make check && \
35+
make PREFIX=/usr/local install && \
36+
echo "Running BATS tests..." && \
37+
bats -T --abort test/test.sh
38+
39+
### app stage
40+
FROM ubuntu:noble AS app
41+
42+
ARG SNP_DISTS_VER
43+
44+
LABEL base.image="ubuntu:noble"
45+
LABEL dockerfile.version="1"
46+
LABEL software="snp-dists"
47+
LABEL software.version="${SNP_DISTS_VER}"
48+
LABEL description="Convert a FASTA alignment to SNP distance matrix"
49+
LABEL website="https://github.com/tseemann/snp-dists"
50+
LABEL license="https://github.com/tseemann/snp-dists/blob/master/LICENSE"
51+
LABEL maintainer="Curtis Kapsak"
52+
LABEL maintainer.email="[email protected]"
53+
54+
# install dependencies; cleanup apt garbage
55+
RUN apt-get update && apt-get install -y --no-install-recommends \
56+
wget \
57+
ca-certificates \
58+
procps \
59+
zlib1g \
60+
libgomp1 && \
61+
apt-get autoclean && rm -rf /var/lib/apt/lists/*
62+
63+
COPY --from=builder /usr/local/bin/snp-dists /usr/local/bin/snp-dists
64+
65+
# make /data and set as default working directory
66+
RUN mkdir -v /data
67+
WORKDIR /data
68+
69+
# set locale for singularity compatibility; no need to set PATH as /usr/local/bin is already there
70+
ENV LC_ALL=C
71+
72+
CMD ["snp-dists", "--help"]
73+
74+
### Test stage
75+
FROM app AS test
76+
77+
ARG SNP_DISTS_VER
78+
79+
RUN apt-get update && apt-get install -y --no-install-recommends \
80+
wget \
81+
ca-certificates && \
82+
apt-get autoclean && rm -rf /var/lib/apt/lists/*
83+
84+
# setting working directory to /test
85+
WORKDIR /test
86+
87+
# Run a simple test from snp-dists testing framework
88+
RUN echo "Testing snp-dists with one test from testing framework..." && \
89+
wget -q https://raw.githubusercontent.com/tseemann/snp-dists/refs/heads/master/test/good.aln && \
90+
wget -q https://raw.githubusercontent.com/tseemann/snp-dists/refs/heads/master/test/good.res && \
91+
snp-dists -b good.aln > good.out && \
92+
diff -bB good.out good.res && \
93+
echo "snp-dists version ${SNP_DISTS_VER} test completed successfully!"
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# snp-dists docker image
2+
3+
Main tool: [snp-dists](https://github.com/tseemann/snp-dists)
4+
5+
Full documentation: [https://github.com/tseemann/snp-dists](https://github.com/tseemann/snp-dists)
6+
7+
> *Convert a FASTA alignment to SNP distance matrix*
8+
9+
## Example Usage
10+
11+
```bash
12+
# run snp-dists on the test alignment file bundled with snp-dists
13+
wget -q https://raw.githubusercontent.com/tseemann/snp-dists/refs/heads/master/test/good.aln
14+
snp-dists good.aln > good.out
15+
cat good.out
16+
seq1 seq2 seq3 seq4
17+
seq1 0 1 2 3
18+
seq2 1 0 3 4
19+
seq3 2 3 0 4
20+
seq4 3 4 4 0
21+
```

0 commit comments

Comments
 (0)