Bootstrap: yum
OSVersion: 8
MirrorURL: http://mirror.centos.org/centos-8/8/BaseOS/x86_64/os/
Include: yum

%files
    Assembly_companion.py /opt/

%environment
    export PATH=/opt/usr/local/bin:$PATH
    export PATH=/opt/bwa:$PATH
    export PATH=/opt/fastp:$PATH
    export PATH=/opt/FastQC:$PATH
    export PATH=/opt/SPAdes-3.15.3-Linux/bin:$PATH  
    export PATH=/opt/Flye/bin:$PATH
    export PATH=/opt/canu/build/bin:$PATH
    export TOOLDIR=/usr/local/samtools
    export PATH=/usr/local/samtools/bamtools/bin:$PATH
    export PATH=/opt/quast:$PATH

%post
    #Update part
    #permission part
    chmod -R 777 /opt #chmod775 can be enough
    chmod -R 777 /root #chmod775 can be enough
    #modules
    yum install -y git
    yum install -y automake autoconf
    yum install -y make
    yum install -y zlib-devel    
    #yum install -y bzip2-devel
    yum install -y glibc-devel
    yum install -y xz-devel
    yum install -y zip unzip
    yum install -y gcc gcc-c++ make 
    yum install -y epel-release
    yum install -y cmake3
    #ln -s /usr/bin/cmake3 /usr/bin/cmake
    yum install -y rsync
    #yum install -y https://repo.ius.io/ius-release-el7.rpm
    yum install -y python3.8
    yum install -y wget
    yum install -y epel-release
    yum install -y boost boost-thread boost-devel
    yum install -y perl-CPAN
    yum install -y cpanminus
    yum install -y patch
    yum install -y java-11-openjdk-devel
    yum install -y capnproto
    yum install -y perl-LWP-Protocol-https    
    yum install -y tar
    yum install -y bzip2
    yum -y install glibc-locale-source
    yum install -y zlib-devel bzip2-devel
    yum install curl-devel -y
    localedef -i en_US -f UTF-8 en_US.UTF-8
    pip3 install click
    ln -s /usr/bin/python3.8 /usr/bin/python    

    #bwa
    cd /opt/
    git clone https://github.com/lh3/bwa.git
    cd bwa; make
    export PATH=/opt/bwa:$PATH

    #fastp
    cd /opt/
    mkdir fastp
    cd fastp/
    wget http://opengene.org/fastp/fastp
    chmod a+x ./fastp
    export PATH=/opt/fastp:$PATH

    #fastqc
    cd /opt/
    wget https://www.bioinformatics.babraham.ac.uk/projects/fastqc/fastqc_v0.11.7.zip
    unzip fastqc_v0.11.7.zip
    cd FastQC
    chmod 755 fastqc
    export PATH=/opt/FastQC:$PATH

    #spades
    cd /opt/
    wget http://cab.spbu.ru/files/release3.15.3/SPAdes-3.15.3-Linux.tar.gz
    tar -xzf SPAdes-3.15.3-Linux.tar.gz
    export PATH=/opt/SPAdes-3.15.3-Linux/bin:$PATH

    #flye
    cd /opt/
    git clone https://github.com/fenderglass/Flye
    cd Flye/
    make
    export PATH=/opt/Flye/bin:$PATH

    #canu
    cd /opt/
    git clone https://github.com/marbl/canu.git
    cd canu/src
    make -j 2
    export PATH=/opt/canu/build/bin:$PATH 

    #htslib
    cd /usr/local/
    mkdir samtools
    cd /usr/local/samtools/
    wget https://github.com/samtools/htslib/releases/download/1.13/htslib-1.13.tar.bz2
    tar -vxjf htslib-1.13.tar.bz2
    mv htslib-1.13 htslib
    cd htslib
    ./configure --disable-bz2
    make
    make install
    chmod -R 777 /usr/local/samtools/htslib/htslib
    #bcftools
    cd /usr/local/samtools/
    wget https://github.com/samtools/bcftools/releases/download/1.13/bcftools-1.13.tar.bz2
    tar -vxjf bcftools-1.13.tar.bz2
    mv bcftools-1.13 bcftools
    cd bcftools
    make
    make install
    #samtools
    cd /usr/local/samtools/
    wget https://github.com/samtools/samtools/releases/download/1.13/samtools-1.13.tar.bz2
    tar -vxjf samtools-1.13.tar.bz2
    mv samtools-1.13 samtools
    cd samtools
    ./configure --without-curses
    make
    make install
    #bamtools
    cd /usr/local/samtools/
    git clone git://github.com/pezmaster31/bamtools.git
    cd bamtools
    mkdir build
    cd build
    cmake -DCMAKE_INSTALL_PREFIX=/usr/local/samtools/bamtools ..
    make
    make install

    #pilon
    cd /opt/
    wget https://github.com/broadinstitute/pilon/releases/download/v1.24/pilon-1.24.jar

    #quast
    cd /opt/
    git clone https://github.com/ablab/quast
    cd quast/
    ./setup.py install
    export PATH=/opt/quast:$PATH

    #companion
    cd /opt/
    mkdir companion
    mv Assembly_companion.py companion/

%runscript
    echo "This container contains : "

%help
    This is a container for
 
%labels
    Author Luc Cornet
    Version v0.0.1
