Skip to content

Commit ef24d98

Browse files
committedOct 23, 2024·
Merge branch 'add_container_manifest' into 'dev'
Add initial container support See merge request tron/bnt_neoants/splice2neo!136
2 parents 0d3df77 + 09b003c commit ef24d98

File tree

5 files changed

+244
-0
lines changed

5 files changed

+244
-0
lines changed
 

‎Docker/Dockerfile

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
FROM docker://rocker/r-ver:4.2.3
2+
3+
MAINTAINER johannes.hausmann@tron-mainz.de
4+
5+
ENV SRC /usr/local/src
6+
ENV BIN /usr/local/bin
7+
8+
9+
COPY DESCRIPTION /usr/local/src
10+
11+
RUN apt update && apt install -y \
12+
build-essential \
13+
libxml2-dev \
14+
libcairo2-dev \
15+
libgit2-dev \
16+
default-libmysqlclient-dev \
17+
libpq-dev \
18+
libsasl2-dev \
19+
libsqlite3-dev \
20+
libssh2-1-dev \
21+
libxtst6 \
22+
libcurl4-openssl-dev \
23+
libharfbuzz-dev \
24+
libfribidi-dev \
25+
libfreetype6-dev \
26+
libpng-dev \
27+
libtiff5-dev \
28+
libjpeg-dev \
29+
libbz2-dev \
30+
unixodbc-dev \
31+
tini \
32+
git \
33+
locales \
34+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
35+
apt clean && \
36+
apt autoremove -y && \
37+
rm -rf /var/lib/{apt,dpkg,cache,log}/
38+
39+
RUN locale-gen en_US.UTF-8
40+
41+
RUN install2.r --error --skipinstalled -n 8 \
42+
readr \
43+
tibble \
44+
dplyr \
45+
magrittr \
46+
argparse \
47+
stringr \
48+
tidyr \
49+
purrr \
50+
devtools \
51+
remotes \
52+
BiocManager \
53+
vroom
54+
55+
56+
RUN Rscript -e 'library(remotes); remotes::install_version("Matrix", version = "1.6-5", repos = "http://cran.us.r-project.org", Ncpus=8)'
57+
RUN Rscript -e 'library(remotes); remotes::install_version("MASS", version = "7.3-60", repos = "http://cran.us.r-project.org", Ncpus=8)'
58+
RUN Rscript -e 'BiocManager::install(c("BSgenome.Hsapiens.UCSC.hg19"), Ncpus=8)'
59+
RUN export SPLICE2NEO_VERSION=$(grep 'Version:' /usr/local/src/DESCRIPTION | awk '{print $2}') && \
60+
Rscript -e "library(remotes); remotes::install_git('https://github.com/TRON-Bioinformatics/splice2neo.git', ref = 'v${SPLICE2NEO_VERSION}', Ncpus=8)"
61+
62+
RUN apt autoremove -y
63+
64+
# Remove build dependencies from container
65+
RUN apt remove -y \
66+
build-essential \
67+
libxml2-dev \
68+
libcairo2-dev \
69+
libgit2-dev \
70+
default-libmysqlclient-dev \
71+
libpq-dev \
72+
libsasl2-dev \
73+
libsqlite3-dev \
74+
libssh2-1-dev \
75+
libxtst6 \
76+
libcurl4-openssl-dev \
77+
libharfbuzz-dev \
78+
libfribidi-dev \
79+
libfreetype6-dev \
80+
libpng-dev \
81+
libtiff5-dev \
82+
libjpeg-dev \
83+
unixodbc-dev \
84+
libbz2-dev \
85+
git \
86+
locales
87+
88+
WORKDIR /
89+
ENTRYPOINT ["tini", "--"]
90+
CMD [ "/bin/bash" ]

‎Docker/README.md

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Container support
2+
3+
We provide a Singularity and a Docker image that contains all software pre-installed for running the splice2neo analysis.
4+
However, singularity is our preferred method for running splice2neo as it allows unprivileged users to run the application in a container.
5+
6+
7+
## Singularity
8+
9+
To use the the singularity image, you have to first build it from the definition file. Please make sure you have `fakeroot` permissions or ask your sysadmin to build the image.
10+
11+
```
12+
singularity build --fakeroot splice2neo.sif splice2neo.def
13+
```
14+
15+
16+
To run the analysis, bind your input directory into the container. The container ships the HG19 version of BSgenome.
17+
18+
### Script usage
19+
20+
```
21+
singularity exec -e -B `pwd` -B /path/to/your/inputs splice2neo.sif Rscript splice2neo.R
22+
```
23+
24+
### Interactive usage
25+
26+
```
27+
singularity shell -B `pwd` -B /path/to/your/inputs splice2neo.sif
28+
```
29+
30+
Within the container you can now open a R-Session and execute the commands.
31+
32+
33+
## Docker / podman
34+
35+
We use podman to build and manage our Docker images. Podman is API compatible with Docker and provides unprivileged execution of images.
36+
37+
38+
```
39+
podman build -t tronbioinformatics/splice2neo:"${TAG}" .
40+
```

‎Docker/build_docker.sh

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
#
3+
# Maintainer: Johannes Hausmann <johannes.hausmann@posteo.de>
4+
# Build OCI images for splice2neo
5+
6+
cp ../DESCRIPTION DESCRIPTION
7+
8+
export TAG=$(grep 'Version:' DESCRIPTION | awk '{print $2}')
9+
10+
podman build -t tronbioinformatics/splice2neo:"${TAG}" .
11+
#podman build -t tronbioinformatics/splice2neo:latest .
12+
13+
rm DESCRIPTION

‎Docker/splice2neo.def

+100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
Bootstrap: docker
2+
From: rocker/r-ver:4.2.3
3+
Stage: spython-base
4+
5+
%files
6+
../DESCRIPTION /usr/local/src/
7+
%labels
8+
MAINTAINER johannes.hausmann@tron-mainz.de
9+
%post
10+
11+
12+
SRC=/usr/local/src
13+
BIN=/usr/local/bin
14+
15+
16+
apt update && apt install -y \
17+
build-essential \
18+
libxml2-dev \
19+
libcairo2-dev \
20+
libgit2-dev \
21+
default-libmysqlclient-dev \
22+
libpq-dev \
23+
libsasl2-dev \
24+
libsqlite3-dev \
25+
libssh2-1-dev \
26+
libxtst6 \
27+
libcurl4-openssl-dev \
28+
libharfbuzz-dev \
29+
libfribidi-dev \
30+
libfreetype6-dev \
31+
libpng-dev \
32+
libtiff5-dev \
33+
libjpeg-dev \
34+
unixodbc-dev \
35+
libbz2-dev \
36+
git && \
37+
apt clean && \
38+
apt autoremove -y
39+
40+
install2.r --error --skipinstalled -n 8 \
41+
readr \
42+
tibble \
43+
dplyr \
44+
magrittr \
45+
argparse \
46+
stringr \
47+
tidyr \
48+
purrr \
49+
devtools \
50+
remotes \
51+
BiocManager \
52+
vroom
53+
54+
export SPLICE2NEO_VERSION=$(grep 'Version:' /usr/local/src/DESCRIPTION | awk '{print $2}') && \
55+
R --no-save <<__EOF__
56+
57+
BiocManager::install("BSgenome.Hsapiens.UCSC.hg38", Ncpus=8)
58+
59+
library(remotes)
60+
remotes::install_version("Matrix", version = "1.6-5", repos = "http://cran.us.r-project.org")
61+
remotes::install_version("MASS", version = "7.3-60", repos = "http://cran.us.r-project.org")
62+
remotes::install_git('https://github.com/TRON-Bioinformatics/splice2neo.git', ref = "v${SPLICE2NEO_VERSION}")
63+
64+
__EOF__
65+
66+
67+
apt autoremove -y
68+
69+
# Remove build dependencies from container
70+
apt remove -y \
71+
build-essential \
72+
libxml2-dev \
73+
libcairo2-dev \
74+
libgit2-dev \
75+
default-libmysqlclient-dev \
76+
libpq-dev \
77+
libsasl2-dev \
78+
libsqlite3-dev \
79+
libssh2-1-dev \
80+
libxtst6 \
81+
libcurl4-openssl-dev \
82+
libharfbuzz-dev \
83+
libfribidi-dev \
84+
libfreetype6-dev \
85+
libpng-dev \
86+
libtiff5-dev \
87+
libjpeg-dev \
88+
unixodbc-dev \
89+
libbz2-dev
90+
91+
92+
%environment
93+
export SRC=/usr/local/src
94+
export BIN=/usr/local/bin
95+
%runscript
96+
cd /
97+
exec tini -- /bin/bash "$@"
98+
%startscript
99+
cd /
100+
exec tini -- /bin/bash "$@"

‎README.md

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ coverage](https://codecov.io/gh/TRON-Bioinformatics/splice2neo/branch/master/gra
1111
[![](https://img.shields.io/badge/devel%20version-0.6.6-blue.svg)](https://github.com/TRON-Bioinformatics/splice2neo)
1212
[![](https://img.shields.io/badge/lifecycle-experimental-blue.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
1313
[![](https://img.shields.io/github/last-commit/TRON-Bioinformatics/splice2neo.svg)](https://github.com/TRON-Bioinformatics/splice2neo/commits/dev)
14+
[![Docker](https://img.shields.io/badge/docker-%230db7ed.svg?style=for-the-badge&logo=docker&logoColor=white)](https://hub.docker.com/r/tronbioinformatics/splice2neo/tags)
1415
<!-- badges: end -->
1516

1617
Documentation: <https://tron-bioinformatics.github.io/splice2neo/>

0 commit comments

Comments
 (0)
Please sign in to comment.