-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSingularity.samtools
82 lines (59 loc) · 1.5 KB
/
Singularity.samtools
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
# Author: B.M. Anderson
# Singularity recipe for creating a container for using HTSlib and Samtools
Bootstrap: docker
From: ubuntu:20.04
%labels
MAINTAINER bmichanderson
PROGRAM samtools
VERSION 1.20
%help
This container is for using samtools
Execute it with:
singularity exec -H "$(pwd)" samtools.sif samtools [args]
Or run it with:
singularity run samtools.sif [args]
%post
export DEBIAN_FRONTEND=noninteractive
# install dependencies
apt update && apt install -y \
autoconf \
automake \
build-essential \
cmake \
gcc \
libbz2-dev \
libcurl4-openssl-dev \
liblzma-dev \
libncurses5-dev \
libssl-dev \
make \
perl \
wget \
zlib1g-dev
# HTSlib
H_VER=1.20
URL=https://github.com/samtools/htslib/releases/download/${H_VER}/htslib-${H_VER}.tar.bz2
wget "$URL"
tar -xjf htslib-"$H_VER".tar.bz2 && rm htslib-"$H_VER".tar.bz2
cd htslib-"$H_VER"
./configure --prefix=/usr
make
make install
cd .. && rm -r htslib-"$H_VER"
# Samtools
S_VER=1.20
URL=https://github.com/samtools/samtools/releases/download/${S_VER}/samtools-${S_VER}.tar.bz2
wget "$URL"
tar -xjf samtools-"$S_VER".tar.bz2 && rm samtools-"$S_VER".tar.bz2
cd samtools-"$S_VER"
./configure --with-htslib=system --prefix=/usr
make
make install
cd .. && rm -r samtools-"$S_VER"
# clean-up
apt autoremove -y && apt clean all
%environment
# Set up environmental variables within the container
%runscript
# This will be executed when the container is run (singularity run [container])
samtools "$@"