Skip to content

Commit 6624df2

Browse files
committed
[MODIF] update singularity
1 parent 3407fad commit 6624df2

File tree

2 files changed

+124
-120
lines changed

2 files changed

+124
-120
lines changed

Singularity

+80-73
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,80 @@
1-
BootStrap: docker
2-
From: ubuntu:latest
3-
4-
%labels
5-
AUTHOR Nicolas Servant
6-
7-
%pre
8-
apt-get install -y debootstrap
9-
10-
%files
11-
environment.yml /opt/environment.yml
12-
13-
%post
14-
apt-get update
15-
apt-get install -y wget
16-
apt-get install -y gzip
17-
apt-get install -y bzip2
18-
apt-get install -y curl
19-
apt-get install -y unzip
20-
21-
## g++
22-
apt-get install -y build-essential
23-
24-
# install anaconda
25-
if [ ! -d /usr/local/anaconda ]; then
26-
wget https://repo.continuum.io/miniconda/Miniconda3-4.5.4-Linux-x86_64.sh \
27-
-O ~/anaconda.sh && \
28-
bash ~/anaconda.sh -b -p /usr/local/anaconda && \
29-
rm ~/anaconda.sh
30-
fi
31-
32-
# set anaconda path
33-
export PATH=$PATH:/usr/local/anaconda/bin
34-
conda update conda
35-
36-
conda config --add channels r
37-
conda config --add channels defaults
38-
conda config --add channels conda-forge
39-
conda config --add channels bioconda
40-
41-
# Let us save some space
42-
conda clean --packages -y
43-
44-
# external tools
45-
echo "Installing conda environment ... "
46-
conda env create -f /opt/environment.yml
47-
echo "source activate HiC-Pro_v3.1.0" > ~/.bashrc
48-
49-
# Install HiC-pro
50-
echo "Installing latest HiC-Pro release ..."
51-
VERSION=$(curl -s https://github.com/nservant/HiC-Pro/releases/latest | egrep -o 'v3.[0-9]*.[0-9]*')
52-
echo "v"$VERSION".zip" | wget --base=http://github.com/nservant/HiC-Pro/archive/ -i - -O hicpro_latest.zip && unzip hicpro_latest.zip
53-
#VERSION="devel_py3"
54-
#echo $VERSION".zip" | wget --base=http://github.com/nservant/HiC-Pro/archive/ -i - -O hicpro_latest.zip && unzip hicpro_latest.zip
55-
56-
cd $(echo HiC-Pro-$VERSION)
57-
make configure
58-
make install
59-
60-
# Let us save some space
61-
conda clean --packages -y
62-
conda clean --all -y
63-
rm -rf /usr/local/anaconda/pkgs
64-
65-
%test
66-
INSTALLED_HICPRO_VERSION=$(find /usr/local/bin -name HiC-Pro | xargs dirname)
67-
$INSTALLED_HICPRO_VERSION/HiC-Pro -h
68-
69-
%environment
70-
export PATH=$PATH:/usr/local/anaconda/bin
71-
INSTALLED_VERSION=$(find /usr/local/bin -name HiC-Pro | xargs dirname)
72-
export PATH=$PATH:$INSTALLED_VERSION
73-
export LANG=C
1+
BootStrap: docker
2+
From: ubuntu:latest
3+
4+
%labels
5+
AUTHOR Nicolas Servant
6+
7+
%files
8+
environment.yml /opt/environment.yml
9+
10+
%environment
11+
export LANG=en_US.utf-8
12+
export INSTALLED_VERSION=$(find /usr/local/bin -name HiC-Pro | xargs dirname)
13+
export PATH=$PATH:${INSTALLED_VERSION}:${INSTALLED_VERSION}/utils/
14+
export PATH=/usr/local/conda/bin:$PATH
15+
source /opt/etc/bashrc
16+
17+
%post
18+
apt-get update && \
19+
apt-get install -y \
20+
wget \
21+
debootstrap \
22+
gzip \
23+
bzip2 \
24+
curl \
25+
unzip \
26+
g++ \
27+
28+
# use bash as /bin/sh instead of dash (otherwise source /opt/etc/bashrc will not work)
29+
echo "dash dash/sh boolean false" | debconf-set-selections
30+
DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash
31+
32+
# install miniconda
33+
if [ ! -d /usr/local/miniconda ]; then
34+
wget https://repo.continuum.io/miniconda/Miniconda3-py39_4.10.3-Linux-x86_64.sh -O miniconda.sh && \
35+
sh miniconda.sh -b -p /usr/local/conda && \
36+
rm miniconda.sh && \
37+
ln -s /usr/local/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
38+
find /usr/local/conda/ -follow -type f -name '*.a' -delete && \
39+
find /usr/local/conda/ -follow -type f -name '*.js.map' -delete && \
40+
/usr/local/conda/bin/conda clean -afy
41+
fi
42+
43+
# set miniconda path
44+
export PATH=/usr/local/conda/bin:$PATH
45+
conda update conda
46+
conda clean --packages -y
47+
48+
#bashrc
49+
echo "#! /bin/bash\n\n" > ~/.bashrc
50+
conda init bash
51+
52+
# external tools
53+
echo "Installing conda environment ... "
54+
conda env create -f /opt/environment.yml -n hicpro
55+
echo "conda activate hicpro" >> ~/.bashrc
56+
57+
# Install HiC-pro
58+
export PATH=/usr/local/conda/envs/hicpro/bin:$PATH
59+
echo "Installing latest HiC-Pro release ..."
60+
#VERSION=$(curl -s https://github.com/nservant/HiC-Pro/releases/latest | egrep -o 'v3.[0-9]*.[0-9]*')
61+
VERSION="3.1.0"
62+
echo "v"$VERSION".zip" | wget --base=http://github.com/nservant/HiC-Pro/archive/ -i - -O hicpro_latest.zip && unzip hicpro_latest.zip
63+
64+
cd $(echo HiC-Pro-$VERSION)
65+
make configure
66+
make install
67+
68+
# Let us save some space
69+
conda clean --packages -y
70+
conda clean --all -y
71+
rm -rf /usr/local/miniconda/pkgs
72+
apt-get clean
73+
74+
mkdir /opt/etc/
75+
cp ~/.bashrc /opt/etc/bashrc
76+
77+
%test
78+
INSTALLED_HICPRO_VERSION=$(find /usr/local/bin -name HiC-Pro | xargs dirname)
79+
${INSTALLED_HICPRO_VERSION}/HiC-Pro -h
80+

0 commit comments

Comments
 (0)