Bootstrap: docker
From: ubuntu:22.04



%labels
MAINTAINER Ndomassi tando, Aurore Comte, Julie Orjuela, Sebastien Ravel
software="Conda4Culebront"
description="Conda dependances for CulebrONT"
website="https://culebront-pipeline.readthedocs.io/en/latest/"

%environment
export PATH="$PATH:/usr/local/mamba/mamba/bin"
export PATH="$PATH:/usr/local/mamba/mamba/envs/flye/bin"
export PATH="$PATH:/usr/local/mamba/mamba/envs/canu/bin"
export PATH="$PATH:/usr/local/mamba/mamba/envs/miniasm-minimap2-minipolish-racon-nanopolish/bin"
export PATH="$PATH:/usr/local/mamba/mamba/envs/raven/bin"
export PATH="$PATH:/usr/local/mamba/mamba/envs/smartdenovo/bin"
export PATH="$PATH:/usr/local/mamba/mamba/envs/circlator/bin"
export PATH="$PATH:/usr/local/mamba/mamba/envs/medaka/bin"
export PATH="$PATH:/usr/local/mamba/mamba/envs/samtools-bwa-merqury/bin"
export PATH="$PATH:/usr/local/mamba/mamba/envs/samtools-bwa-merqury/share/merqury"
export MERQURY="/usr/local/mamba/mamba/envs/samtools-bwa-merqury/share/merqury"
export PATH="$PATH:/usr/local/mamba/mamba/envs/quast/bin"
export PATH="$PATH:/usr/local/mamba/mamba/envs/diamond/bin"
export PATH="$PATH:/usr/local/mamba/mamba/envs/mauve/bin"
export PATH="$PATH:/usr/local/mamba/mamba/envs/mummer/bin"
export PATH="$PATH:/usr/local/mamba/mamba/envs/blobtools/bin"
export PATH="$PATH:/usr/local/mamba/mamba/envs/pilon/bin"
export PATH="$PATH:/usr/local/mamba/mamba/envs/shasta/bin"
export PATH="$PATH:/usr/local/mamba/mamba/envs/assemblytics/bin"
export PATH="$PATH:/usr/local/mamba/mamba/envs/assemblytics/bin/R"

export PATH="/usr/local/mamba/mamba/envs/quarto/bin:$PATH"

export PATH="$PATH:/usr/local/mamba/mamba/bin"
export PATH="/usr/local/mamba/mamba/envs/busco/bin:$PATH"
#export LD_LIBRARY_PATH="/usr/local/mamba/mamba/envs/busco/lib/"
export CPATH="/usr/local/mamba/mamba/envs/busco/include:$CPATH"
export LC_ALL=C


touch ~/.Rprofile
echo ".libPaths(c('/usr/local/mamba/mamba/envs/busco/lib/R/library', '/usr/local/mamba/mamba/envs/assemblytics/lib/R/library','/usr/local/mamba/mamba/envs/samtools-bwa-merqury/lib/R/library'))" > ~/.Rprofile

SHELL=/bin/bash
%post
rm /root/.bashrc
apt update -y
apt install -y wget libcurl4
apt upgrade -y

export DEBIAN_FRONTEND=noninteractive
ln -fs /usr/share/zoneinfo/Europe/Paris /etc/localtime
apt install -y tzdata
dpkg-reconfigure --frontend noninteractive tzdata

apt-get clean

mkdir /usr/local/mamba && cd /usr/local/mamba

wget "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
bash Miniforge3-$(uname)-$(uname -m).sh -b -p "/usr/local/mamba/mamba"
export PATH="$PATH:/usr/local/mamba/mamba/bin" >> $SINGULARITY_ENVIRONMENT


echo "
channel_priority: strict
channels:
  - conda-forge
  - bioconda
  - defaults
" > ~/.condarc

# quarto

mamba create -n quarto --no-default-packages
mamba init bash
. /root/.bashrc
mamba activate quarto
wget https://quarto.org/download/latest/quarto-linux-amd64.deb
dpkg -i quarto-linux-amd64.deb
rm quarto-linux-amd64.deb
quarto install tool tinytex --quiet
mamba clean -afyq
mamba deactivate

mamba create -n flye --no-default-packages
mamba install flye=2.9.2 -n flye -q -y
mamba clean -afyq

mamba create -n canu --no-default-packages
mamba install canu=2.2 -n canu -q -y
mamba clean -afyq

mamba create -n miniasm-minimap2-minipolish-racon-nanopolish --no-default-packages
mamba install miniasm=0.3_r179 -n miniasm-minimap2-minipolish-racon-nanopolish -q -y
mamba install minimap2=2.26 -n miniasm-minimap2-minipolish-racon-nanopolish -q -y
mamba install minipolish=0.1.3 -n miniasm-minimap2-minipolish-racon-nanopolish -q -y
mamba install racon=1.4.3 -n miniasm-minimap2-minipolish-racon-nanopolish -q -y
mamba install nanopolish=0.13.2 -n miniasm-minimap2-minipolish-racon-nanopolish -q -y
mamba clean -afyq

mamba create -n raven --no-default-packages
mamba install raven-assembler=1.8.1 -n raven -q -y
mamba clean -afyq

mamba create -n smartdenovo --no-default-packages
mamba install smartdenovo=1.0.0 -n smartdenovo -q -y
mamba clean -afyq

mamba create -n circlator --no-default-packages
mamba install circlator=1.5.5 -n circlator -q -y
mamba clean -afyq

mamba create -n medaka --no-default-packages
mamba install medaka=1.8.0 -n medaka -q -y
mamba clean -afyq

mamba create -n samtools-bwa-merqury --no-default-packages
mamba install samtools=1.17 -n samtools-bwa-merqury -q -y
mamba install bwa=0.7.17 -n samtools-bwa-merqury -q -y
mamba install openjdk=11 -n samtools-bwa-merqury -q -y
mamba install merqury=1.3 -n samtools-bwa-merqury -q -y
mamba clean -afyq

mamba create -n quast --no-default-packages
mamba install quast=5.2.0 -n quast -q -y
mamba clean -afyq

mamba create -n diamond --no-default-packages
mamba install diamond=2.1.7 -n diamond -q -y
mamba clean -afyq

mamba create -n mauve --no-default-packages
mamba install mauve=2.4.0.snapshot_2015_02_13 -n mauve -q -y
mamba clean -afyq

mamba create -n mummer --no-default-packages
mamba install mummer4=4.0.0rc1 -n mummer -q -y
mamba clean -afyq

mamba create -n blobtools --no-default-packages
mamba install blobtools=1.1.1 -n blobtools -q -y
mamba clean -afyq

mamba create -n busco --no-default-packages
mamba install r-plyr=1.8.8 -n busco -q -y
mamba install busco=5.4.7 -n busco -q -y
mamba clean -afyq

mamba activate busco
python3 -m pip install -U nbformat pandas tabulate
python3 -m pip install -U notebook itables matplotlib
mamba deactivate

mamba create -n pilon --no-default-packages
mamba install pilon=1.24-0 -n pilon -q -y
sed -i "s/-Xmx1g/-Xmx8g/g" /usr/local/mamba/mamba/envs/pilon/bin/pilon
cp /usr/local/mamba/mamba/envs/pilon/share/pilon-1.24-0/pilon.jar /usr/local/mamba/mamba/envs/pilon/bin/pilon.jar
mamba clean -afyq

mamba create -n shasta --no-default-packages
mamba install shasta=0.11.1 -n shasta -q -y
mamba clean -afyq

mamba create -n assemblytics --no-default-packages
mamba install r-plyr -n assemblytics -q -y
mamba install assemblytics=1.2.1 -n assemblytics -q -y
mamba clean -afyq

%runscript
exec /bin/bash "$@"
