-
Notifications
You must be signed in to change notification settings - Fork 180
/
Copy pathSingularity
80 lines (65 loc) · 2.53 KB
/
Singularity
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
BootStrap: docker
From: ubuntu:latest
%labels
AUTHOR Nicolas Servant
%files
environment.yml /opt/environment.yml
%environment
export LANG=en_US.utf-8
export INSTALLED_VERSION=$(find /usr/local/bin -name HiC-Pro | xargs dirname)
export PATH=$PATH:${INSTALLED_VERSION}:${INSTALLED_VERSION}/utils/
export PATH=/usr/local/conda/bin:$PATH
source /opt/etc/bashrc
%post
apt-get update && \
apt-get install -y \
wget \
debootstrap \
gzip \
bzip2 \
curl \
unzip \
g++ \
# use bash as /bin/sh instead of dash (otherwise source /opt/etc/bashrc will not work)
echo "dash dash/sh boolean false" | debconf-set-selections
DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash
# install miniconda
if [ ! -d /usr/local/miniconda ]; then
wget https://repo.continuum.io/miniconda/Miniconda3-py39_4.10.3-Linux-x86_64.sh -O miniconda.sh && \
sh miniconda.sh -b -p /usr/local/conda && \
rm miniconda.sh && \
ln -s /usr/local/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
find /usr/local/conda/ -follow -type f -name '*.a' -delete && \
find /usr/local/conda/ -follow -type f -name '*.js.map' -delete && \
/usr/local/conda/bin/conda clean -afy
fi
# set miniconda path
export PATH=/usr/local/conda/bin:$PATH
conda update conda
conda clean --packages -y
#bashrc
echo "#! /bin/bash\n\n" > ~/.bashrc
conda init bash
# external tools
echo "Installing conda environment ... "
conda env create -f /opt/environment.yml -n hicpro
echo "conda activate hicpro" >> ~/.bashrc
# Install HiC-pro
export PATH=/usr/local/conda/envs/hicpro/bin:$PATH
echo "Installing latest HiC-Pro release ..."
#VERSION=$(curl -s https://github.com/nservant/HiC-Pro/releases/latest | egrep -o 'v3.[0-9]*.[0-9]*')
VERSION="3.1.0"
echo "v"$VERSION".zip" | wget --base=http://github.com/nservant/HiC-Pro/archive/ -i - -O hicpro_latest.zip && unzip hicpro_latest.zip
cd $(echo HiC-Pro-$VERSION)
make configure
make install
# Let us save some space
conda clean --packages -y
conda clean --all -y
rm -rf /usr/local/miniconda/pkgs
apt-get clean
mkdir /opt/etc/
cp ~/.bashrc /opt/etc/bashrc
%test
INSTALLED_HICPRO_VERSION=$(find /usr/local/bin -name HiC-Pro | xargs dirname)
${INSTALLED_HICPRO_VERSION}/HiC-Pro -h