bismark_0.24.2.def 4.11 KB
Newer Older
1 2 3 4 5 6 7 8 9
# bismark container definition file - see %help section
# Created : 2024-06-12
# Last updated : 2024-06-13
# authors : valentin.vautrot@u-bourgogne.fr

BootStrap: docker
From: ubuntu:22.04

%help 
10
Description : This is a singularity/apptainer container packing bismark v0.24.2. It can be run by mounting a host bowtie2 installation directory, preferably towards /usr/bin/bowtie2/ destination to avoid PATH problems. Python2 is installed with the required librairies to run a version of bowtie2 present on the ccub. DMRFinder is installed in /usr/bin/DMRfinder/ along with R v.4.4.0 and the bioconductor DSS package.
11 12
Use "singularity test <path/to/this/container.sif>" to see --version calls of installed softwares.
This container has no runscripts.
13 14
Usage exemple : singularity exec -e --bind /work/gad/shared/bin/bowtie2-2.3.2/:/usr/bin/bowtie2 <path/to/this/container.sif> bismark [--<options>] --genome <path/to/bismark/converted/genome> <fastq.file>
Usage exemple2 : singularity exec -e <path/to/this/container.sif> samtools view -h <bismark.output.bamfile>  |  python extract_CpG_data.py  -i -  -o <CpG.file.output.name>  -v
15 16 17 18 19 20 21 22 23 24
Authors : valentin.vautrot@u-bourgogne.fr

%post
export DEBIAN_FRONTEND=noninteractive

apt-get update
apt-get install -y --no-install-recommends apt-utils
apt-get install -y --no-install-recommends \
    locales \
    language-pack-fr \
25 26
    software-properties-common \
    dirmngr \
27 28 29 30
    wget \
    samtools \
    python2.7 \
    python2.7-dev \
31 32
    libtbb2 \
    git
33

34 35
ln -s /usr/bin/python2.7 /usr/bin/python

36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
# install perl and required librairies and tools
apt-get install -y --no-upgrade --no-install-recommends \
    perl \
    build-essential \
    cpanminus \
    pkg-config \
    libgd3 \
    libgd-dev \
    libpng16-16 \
    libimage-png-libpng-perl \
    libfont-freetype-perl

# install GD for perl
cpan -v
cpanm -v
cpan App::cpanminus
cpanm ExtUtils::PkgConfig
cpanm GD
cpanm GD::Graph

56 57 58 59 60 61 62 63
# get bismark code (no repo)
wget -P /usr/bin/bismark --no-check-certificate https://github.com/FelixKrueger/Bismark/archive/refs/tags/v0.24.2.tar.gz
tar -xvzf /usr/bin/bismark/v0.24.2.tar.gz -C /usr/bin/
rm -rf /usr/bin/bismark/

# create mount directory for bowtie2 bind, to avoid problems
mkdir /usr/bin/bowtie2

64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
# add DMRFinder scripts
git clone https://github.com/jsh58/DMRfinder.git /usr/bin/DMRfinder/
# correct DMRfinder bug
sed -i 's/level <- levels(res\$chr)/level <- levels(as.factor(res\$chr))/' /usr/bin/DMRfinder/findDMRs.r 

# Install R for DMRfinder and DSS Bioconductor package
wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/"

apt-get install -y --no-upgrade --no-install-recommends -t jammy-cran40 r-base-core=4.4.0-1.2204.0 r-base-dev=4.4.0-1.2204.0

apt-get install -y --no-upgrade --no-install-recommends libcurl4-openssl-dev zlib1g-dev libxml2-dev libssl-dev libfontconfig1-dev libharfbuzz-dev libfribidi-dev libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev libbz2-dev gfortran

echo "installed R version :"
R --version

# # install R packages :
Rscript -e 'install.packages("BiocManager", dependencies=TRUE)'
Rscript -e 'BiocManager::install("DSS", version = "3.19")'
83

84 85 86 87 88 89 90 91 92 93 94 95 96
%environment
export PATH=${PATH}:/usr/bin/samtools/:/usr/bin/Bismark-0.24.2/:/usr/bin/bowtie2/:/usr/bin/python:/usr/bin/python2.7:/usr/lib/x86_64-linux-gnu/:/usr/lib/python2.7/
export PYTHON=/usr/bin/python
export LANGUAGE=fr_FR.UTF-8
export LC_ALL=fr_FR.UTF-8
export LANG=fr_FR.UTF-8
export LC_CTYPE=fr_FR.UTF-8

%test
samtools --version
echo "############################"
bismark --version
echo "############################"
97 98 99
echo "installed R version :"
R --version
echo "############################"
100
echo "PATH variable : $PATH "
101 102 103 104 105 106 107 108
echo "############################"
echo "python version :"
python --version
echo "############################"
echo "DMRfinder scripts versions :"
python /usr/bin/DMRfinder/extract_CpG_data.py --version  
python /usr/bin/DMRfinder/combine_CpG_sites.py --version
Rscript /usr/bin/DMRfinder/findDMRs.r --version
109 110 111

%labels
Author valentin.vautrot
112
container_version 0.3
113
Ubuntu_version 22.04