#################################################################
# Dockerfile
#
# Software:         Visualization Plugins
# Software Version: v0.0.8
# Description:      Visualization Plugins
# Website:          https://github.com/Barski-lab/visualization_plugins.git
# Provides:         Visualization Plugins
# Base Image:       ubuntu:20.04
# Build Cmd:        docker build --platform linux/amd64 --no-cache --rm -t biowardrobe2/visualization:v0.0.8 -f visualization-Dockerfile .
# Pull Cmd:         docker pull --platform linux/amd64 biowardrobe2/visualization:v0.0.8
# Run Cmd:          docker run --platform linux/amd64 --rm -ti biowardrobe2/visualization:v0.0.8 /bin/bash
#################################################################
#
# v0.0.8
# - Updated volcano_plot to the latest
#
# v0.0.7
# - Filtering by p-value in MA-plot
#
# v0.0.6
# - Added MA-plot
#
# v0.0.5
# - Bug fixes in volcano plot
#
# v0.0.4
# - Updated volcano plot
#   To build, need to clone private repository to the current directory
#   https://github.com/scrowley-Datirium/volcano_plot
#
# v0.0.3
# - Volcano plot always reads data from the deseq_report.tsv file
# - volcano_plot.sh need to copy all related to the Volcano Plot
#   files into the current directory, because glob can't accept
#   the absolute path, so we need to use relative to the current
#   working directory locations.
#
# v0.0.2
# - make volcano plot configurable
#
#################################################################

### Base Image
FROM ubuntu:20.04
LABEL maintainer="misha.kotliar@gmail.com"
ENV DEBIAN_FRONTEND noninteractive


################## BEGIN INSTALLATION ######################

WORKDIR /opt/volcano_plot

ENV VP_COMMIT "SDAP-1056-pval-update"

COPY ./volcano_plot/ /opt/volcano_plot
COPY ./scripts/volcano_plot.sh /usr/local/bin/volcano_plot.sh
COPY ./scripts/ma_plot.sh /usr/local/bin/ma_plot.sh

### Installing dependencies
RUN apt-get update && \
    apt-get install git -y && \
### Installing Visualization Plugins
    cd /opt/volcano_plot && \
    git checkout ${VP_COMMIT} && \
    rm -rf .git && \
    rm README.md README_old.md LICENSE && \
### Installing scripts
    chmod +x /opt/volcano_plot/setVars.sh && \
    chmod +x /opt/volcano_plot/MA_PLOT_set_vars.sh && \
    chmod +x /usr/local/bin/volcano_plot.sh && \
    chmod +x /usr/local/bin/ma_plot.sh && \
### Cleaning
    apt-get clean && \
    apt-get purge && \
    rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* && \
    strip /usr/local/bin/*; true