Commit b05d6af6 authored by Amine  GHOZLANE's avatar Amine GHOZLANE
Browse files

Move to shinydashboardshaman and prepare autodevops

parent 7273de4f
FROM ubuntu:18.04
MAINTAINER Amine Ghozlane "amine.ghozlane@pasteur.fr"
RUN apt-get update && apt-get install -y \
wget \
gdebi-core \
libcurl4-openssl-dev\
libcairo2-dev \
libjpeg-dev \
libtiff5-dev \
libxt-dev \
libxml2-dev \
libxml2 \
libreadline6-dev \
git \
libssl-dev \
libssh2-1-dev \
libnlopt-dev \
python3-pip \
python3-yaml \
gcc \
gfortran \
g++ \
make \
openjdk-8-jdk \
libmagick++-dev
RUN pip3 install bioblend python-daemon
#Download and install shiny server
RUN wget --no-verbose https://cran.r-project.org/src/base/R-3/R-3.6.1.tar.gz -P /opt/ && \
tar -zxf /opt/R-3.6.1.tar.gz -C /opt && rm /opt/R-3.6.1.tar.gz && \
cd /opt/R-3.6.1/ && ./configure --with-x=no && \
make -j 4 && make install && cd / && rm -rf /opt/R-3.6.1 && \
wget --no-verbose https://s3.amazonaws.com/rstudio-shiny-server-os-build/ubuntu-12.04/x86_64/VERSION -O "version.txt" && \
VERSION=$(cat version.txt) && \
wget --no-verbose "https://s3.amazonaws.com/rstudio-shiny-server-os-build/ubuntu-12.04/x86_64/shiny-server-$VERSION-amd64.deb" -O ss-latest.deb && \
gdebi -n ss-latest.deb && \
rm -f version.txt ss-latest.deb && \
wget ftp://shiny01.hosting.pasteur.fr/pub/shaman_package_201908.tar.gz -P /opt && \
mkdir /opt/packman
RUN R -e """install.packages('packrat', repos='http://cran.univ-paris1.fr/');library("packrat");packrat::unbundle('/opt/shaman_package_201908.tar.gz', '/opt/packman')"""
COPY docker_inst/shiny-server.conf /etc/shiny-server/shiny-server.conf
COPY docker_inst/.Rprofile /srv/shiny-server/
RUN git clone https://github.com/pworinger/shaman.git /srv/shiny-server/shaman && \
#git clone https://github.com/aghozlane/shaman.git /srv/shiny-server/shaman && \
git clone https://github.com/pierreLec/KronaRShy.git /srv/shiny-server/kronarshy && \
git clone https://github.com/aghozlane/shaman_bioblend.git /usr/bin/shaman_bioblend && \
mv /srv/shiny-server/shaman/* /srv/shiny-server/ && \
rm -rf /srv/shiny-server/shaman && \
chown -R shiny.shiny /srv/shiny-server/ && \
chown -R shiny.shiny /opt/packman/ && \
rm /opt/shaman_package_201908.tar.gz && \
cp /srv/shiny-server/.Rprofile /srv/shiny-server/kronarshy/.Rprofile
EXPOSE 3838
EXPOSE 5438
COPY docker_inst/shiny-server.sh /usr/bin/shiny-server.sh
COPY docker_inst/run_kronarshy.R /usr/bin/run_kronarshy.R
CMD ["/usr/bin/shiny-server.sh"]
......@@ -9,11 +9,6 @@ if(!require(shiny)){
library(shiny)
}
if(!require(shinydashboard)){
devtools::install_github('aghozlane/shinydashboard')
library(shinydashboard)
}
if(!require(rjson)){
install.packages('rjson', repos="https://cran.univ-paris1.fr/")
library(rjson)
......@@ -54,45 +49,12 @@ if (!require(circlize)) {
}
if (!require(devtools)) {
install.packages('devtools', repos="https://cran.univ-paris1.fr/")
library(devtools)
}
if(!require(treeWeightD3)){
devtools::install_github('pierreLec/treeWeightD3')
library(treeWeightD3)
}
# if (!require(BiocInstaller)){
# source("https://bioconductor.org/biocLite.R")
# biocLite("BiocInstaller")
# library(BiocInstaller)
# }
#torename
if (!require(d3heatmap)) {
#devtools::install_github('aghozlane/d3heatmap')
devtools::install_github("rstudio/d3heatmap")
library(d3heatmap)
}
# Let us use biomformat instead of biom
#torename
if (!require(biomformatshaman)){
devtools::install_github("aghozlane/biomformatshaman")
library(biomformatshaman)
}
if (!require(scatterD3)) {
#devtools::install_github('aghozlane/scatterD3')
install.packages("scatterD3", repos="https://cran.univ-paris1.fr/")
library(scatterD3)
}
if (!require(rNVD3)) {
devtools::install_github('aghozlane/rNVD3')
library(rNVD3)
}
if(!require(BiocManager)){
install.packages("BiocManager")
}
......@@ -116,11 +78,6 @@ if (!require(shinyjs)) {
library(shinyjs)
}
if(!require(d3vennR)){
devtools::install_github("timelyportfolio/d3vennR")
library(d3vennR)
}
if (!require(DT)) {
install.packages('DT', repos="https://cran.univ-paris1.fr/")
library(DT)
......@@ -136,11 +93,6 @@ if (!require(gplots)) {
library(gplots)
}
if (!require(DESeq2shaman)) {
devtools::install_github("aghozlane/DESeq2shaman")
library(DESeq2shaman)
}
if (!require(ade4)) {
install.packages('ade4', repos="https://cran.univ-paris1.fr/")
library(ade4)
......@@ -161,16 +113,6 @@ if(!require(philentropy)){
library(philentropy)
}
if(!require(PhyloTreeMetaR)){
devtools::install_github("pierreLec/PhyloTreeMetaR")
library(PhyloTreeMetaR)
}
if (!require("shinytoastr")){
devtools::install_github("mangothecat/shinytoastr")
library(shinytoastr)
}
if (!require("shinyWidgets")){
install.packages("shinyWidgets")
#devtools::install_github("aghozlane/shinyWidgets")
......@@ -270,3 +212,62 @@ if(!require("visNetwork")){
install.packages("visNetwork", repos="https://cran.univ-paris1.fr/")
library(visNetwork)
}
if (!require(devtools)) {
install.packages('devtools', repos="https://cran.univ-paris1.fr/")
library(devtools)
}
if(!require("shinydashboardshaman")){
devtools::install_github('aghozlane/shinydashboardshaman')
library(shinydashboardshaman)
}
if(!require("treeWeightD3")){
devtools::install_github('pierreLec/treeWeightD3')
library(treeWeightD3)
}
if (!require("d3heatmap")) {
#devtools::install_github('aghozlane/d3heatmap')
devtools::install_github("rstudio/d3heatmap")
library(d3heatmap)
}
# Let us use biomformat instead of biom
#torename
if (!require("biomformatshaman")){
devtools::install_github("aghozlane/biomformatshaman")
library(biomformatshaman)
}
if (!require("scatterD3")) {
#devtools::install_github('aghozlane/scatterD3')
install.packages("scatterD3", repos="https://cran.univ-paris1.fr/")
library(scatterD3)
}
if (!require("rNVD3")) {
devtools::install_github('aghozlane/rNVD3')
library(rNVD3)
}
if(!require("PhyloTreeMetaR")){
devtools::install_github("pierreLec/PhyloTreeMetaR")
library(PhyloTreeMetaR)
}
if (!require("shinytoastr")){
devtools::install_github("mangothecat/shinytoastr")
library(shinytoastr)
}
if(!require("d3vennR")){
devtools::install_github("timelyportfolio/d3vennR")
library(d3vennR)
}
if (!require("DESeq2shaman")) {
devtools::install_github("aghozlane/DESeq2shaman")
library(DESeq2shaman)
}
\ No newline at end of file
......@@ -58,42 +58,42 @@ Project_box_result <- function(masque_key,curdir){
br(),
column(width=4,
h3("OTU building process"),
shinydashboard::valueBox(ap$Count[1],tags$strong(tags$h5("Number of amplicons", style = "width: 70%;")), color = "light-blue", width = NULL, icon = uiOutput("amplicon_icon")),
shinydashboard::valueBox(ap$Count[2],tags$strong(tags$h5("Remaining amplicons after dereplication", style = "width: 70%;")), color = "light-blue", width = NULL,icon = uiOutput("dereplication_icon")),
shinydashboard::valueBox(ap$Count[3],tags$strong(tags$h5("Remaining amplicons after removing singletons", style = "width: 70%;")), color = "light-blue", width = NULL,icon = uiOutput("singleton_icon")),
shinydashboard::valueBox(ap$Count[4],tags$strong(tags$h5("Remaining amplicons after removing chimera", style = "width: 70%;")), color = "light-blue", width = NULL,icon = uiOutput("chimera_icon")),
shinydashboard::valueBox(ap$Count[5],tags$strong(tags$h5("Number of OTU", style = "width: 70%;")), color = "light-blue", width = NULL,icon = uiOutput("otu_icon"))
shinydashboardshaman::valueBox(ap$Count[1],shiny::tags$strong(shiny::tags$h5("Number of amplicons", style = "width: 70%;")), color = "light-blue", width = NULL, icon = uiOutput("amplicon_icon")),
shinydashboardshaman::valueBox(ap$Count[2],shiny::tags$strong(shiny::tags$h5("Remaining amplicons after dereplication", style = "width: 70%;")), color = "light-blue", width = NULL,icon = uiOutput("dereplication_icon")),
shinydashboardshaman::valueBox(ap$Count[3],shiny::tags$strong(shiny::tags$h5("Remaining amplicons after removing singletons", style = "width: 70%;")), color = "light-blue", width = NULL,icon = uiOutput("singleton_icon")),
shinydashboardshaman::valueBox(ap$Count[4],shiny::tags$strong(shiny::tags$h5("Remaining amplicons after removing chimera", style = "width: 70%;")), color = "light-blue", width = NULL,icon = uiOutput("chimera_icon")),
shinydashboardshaman::valueBox(ap$Count[5],shiny::tags$strong(shiny::tags$h5("Number of OTU", style = "width: 70%;")), color = "light-blue", width = NULL,icon = uiOutput("otu_icon"))
),
#column(width=5, div(img(src = "masque.png",width = "50%",height = "20%"))),
if(json_data$type == "16S"){
column(width=5,
strong(h3("16S annotation process")),
shinydashboard::valueBox(ap$Count[6],tags$strong(tags$h5("Number of OTU annotated by SILVA", style = "width: 70%;")), color = "light-blue", width = NULL,icon = uiOutput("silva_icon")),
shinydashboard::valueBox(ap$Count[7],tags$strong(tags$h5("Number of OTU annotated by Greengenes", style = "width: 70%;")), color = "light-blue", width = NULL,icon = uiOutput("greengenes_icon")),
shinydashboard::valueBox(ap$Count[8],tags$strong(tags$h5("Number of OTU annotated by RDP", style = "width: 70%;")), color = "light-blue", width = NULL,icon = uiOutput("rdp_icon"))
shinydashboardshaman::valueBox(ap$Count[6],shiny::tags$strong(shiny::tags$h5("Number of OTU annotated by SILVA", style = "width: 70%;")), color = "light-blue", width = NULL,icon = uiOutput("silva_icon")),
shinydashboardshaman::valueBox(ap$Count[7],shiny::tags$strong(shiny::tags$h5("Number of OTU annotated by Greengenes", style = "width: 70%;")), color = "light-blue", width = NULL,icon = uiOutput("greengenes_icon")),
shinydashboardshaman::valueBox(ap$Count[8],shiny::tags$strong(shiny::tags$h5("Number of OTU annotated by RDP", style = "width: 70%;")), color = "light-blue", width = NULL,icon = uiOutput("rdp_icon"))
)
}
else if(json_data$type == "18S"){
column(width=5,
strong(h3("18S annotation process")),
shinydashboard::valueBox(ap$Count[6],tags$strong(tags$h5("Number of OTU annotated by SILVA", style = "width: 70%;")), color = "light-blue", width = NULL,icon = uiOutput("silva_icon")),
shinydashboard::valueBox(ap$Count[7],tags$strong(tags$h5("Number of OTU annotated by RDP", style = "width: 70%;")), color = "light-blue", width = NULL,icon = uiOutput("rdp_icon"))
shinydashboardshaman::valueBox(ap$Count[6],shiny::tags$strong(shiny::tags$h5("Number of OTU annotated by SILVA", style = "width: 70%;")), color = "light-blue", width = NULL,icon = uiOutput("silva_icon")),
shinydashboardshaman::valueBox(ap$Count[7],shiny::tags$strong(shiny::tags$h5("Number of OTU annotated by RDP", style = "width: 70%;")), color = "light-blue", width = NULL,icon = uiOutput("rdp_icon"))
)
}
else if(json_data$type == "23S_28S"){
column(width=5,
strong(h3("23S/28S annotation process")),
shinydashboard::valueBox(ap$Count[6],tags$strong(tags$h5("Number of OTU annotated by SILVA", style = "width: 70%;")), color = "light-blue", width = NULL,icon = uiOutput("silva_icon")),
shinydashboard::valueBox(ap$Count[7],tags$strong(tags$h5("Number of OTU annotated by RDP", style = "width: 70%;")), color = "light-blue", width = NULL,icon = uiOutput("rdp_icon"))
shinydashboardshaman::valueBox(ap$Count[6],shiny::tags$strong(shiny::tags$h5("Number of OTU annotated by SILVA", style = "width: 70%;")), color = "light-blue", width = NULL,icon = uiOutput("silva_icon")),
shinydashboardshaman::valueBox(ap$Count[7],shiny::tags$strong(shiny::tags$h5("Number of OTU annotated by RDP", style = "width: 70%;")), color = "light-blue", width = NULL,icon = uiOutput("rdp_icon"))
)
}
else{
column(width=5,
strong(h3("ITS annotation process")),
shinydashboard::valueBox(ap$Count[6],tags$strong(tags$h5("Number of OTU annotated by Unite", style = "width: 70%;")), color = "light-blue", width = NULL,icon = uiOutput("unite_icon")),
shinydashboard::valueBox(ap$Count[7],tags$strong(tags$h5("Number of OTU annotated by Findley", style = "width: 70%;")), color = "light-blue", width = NULL,icon = uiOutput("findley_icon")),
shinydashboard::valueBox(ap$Count[8],tags$strong(tags$h5("Number of OTU annotated by Underhill", style = "width: 70%;")), color = "light-blue", width = NULL,icon = uiOutput("underhill_icon")),
shinydashboard::valueBox(ap$Count[9],tags$strong(tags$h5("Number of OTU annotated by RDP", style = "width: 70%;")), color = "light-blue", width = NULL,icon = uiOutput("rdp_icon"))
shinydashboardshaman::valueBox(ap$Count[6],shiny::tags$strong(shiny::tags$h5("Number of OTU annotated by Unite", style = "width: 70%;")), color = "light-blue", width = NULL,icon = uiOutput("unite_icon")),
shinydashboardshaman::valueBox(ap$Count[7],shiny::tags$strong(shiny::tags$h5("Number of OTU annotated by Findley", style = "width: 70%;")), color = "light-blue", width = NULL,icon = uiOutput("findley_icon")),
shinydashboardshaman::valueBox(ap$Count[8],shiny::tags$strong(shiny::tags$h5("Number of OTU annotated by Underhill", style = "width: 70%;")), color = "light-blue", width = NULL,icon = uiOutput("underhill_icon")),
shinydashboardshaman::valueBox(ap$Count[9],shiny::tags$strong(shiny::tags$h5("Number of OTU annotated by RDP", style = "width: 70%;")), color = "light-blue", width = NULL,icon = uiOutput("rdp_icon"))
)
},
#offset = 4,
......@@ -103,18 +103,18 @@ Project_box_result <- function(masque_key,curdir){
selectInput("masque_db","Select the database",choices=db_choices),
conditionalPanel(condition="input.masque_db=='rdp'",numericInput("rdp_thres",h6(strong("Threshold:")),0.5,step=0.01,min=0.01,max=1)),
actionButton("LoadResMasque", "Upload the results",icon=icon('upload')),
tags$style(type='text/css', "#LoadResMasque { width:100%; }"),
shiny::tags$style(type='text/css', "#LoadResMasque { width:100%; }")#,
#receiveSweetAlert(messageId = "LoadResMasque")
),
#shinydashboard::box(title="Upload the results",width = NULL, background = "light-blue",
#shinydashboardshaman::box(title="Upload the results",width = NULL, background = "light-blue",
#selectInput("masque_database","Select the database",choices=c("Silva" = "silva","Greengenes" = "greengenes", "MARDE"="merde")),
#tags$style(type='text/css', "#masque_database { width:100%; margin-top: 5px;}"),
#shiny::tags$style(type='text/css', "#masque_database { width:100%; margin-top: 5px;}"),
#actionButton("RunResMasque",label = "Upload the results",icon=icon('upload')),
#tags$style(type='text/css', "#RunResMasque { width:100%; margin-top: 15px;}")
#shiny::tags$style(type='text/css', "#RunResMasque { width:100%; margin-top: 15px;}")
#),
box(id="box-zip",title="Download .zip file",width = NULL, status = "success",
downloadButton('Download_masque_zip', 'Download the results'),
tags$style(type='text/css', "#Download_masque_zip { width:100%;}")
shiny::tags$style(type='text/css', "#Download_masque_zip { width:100%;}")
)
)
)
......
library(packrat)
packrat::init("/opt/packman/shaman/")
library(packrat)
packrat::init("/opt/packman/shaman/")
library(shiny)
runApp("/srv/shiny-server/kronarshy/", port=5438, host="0.0.0.0")
\ No newline at end of file
# Define the user we should use when spawning R Shiny processes
run_as shiny;
# Define a top-level server which will listen on a port
server {
# Instruct this server to listen on port 80. The app at dokku-alt need expose PORT 80, or 500 e etc. See the docs
listen 80;
# Define the location available at the base URL
location / {
# Run this location in 'site_dir' mode, which hosts the entire directory
# tree at '/srv/shiny-server'
site_dir /srv/shiny-server;
# Define where we should put the log files for this location
log_dir /var/log/shiny-server;
# Should we list the contents of a (non-Shiny-App) directory when the user
# visits the corresponding URL?
#directory_index on;
}
}
# Define a top-level server which will listen on a port
server {
# Instruct this server to listen on port 80. The app at dokku-alt need expose PORT 80, or 500 e etc. See the docs
listen 5438;
# Define the location available at the base URL
location / {
# Run this location in 'site_dir' mode, which hosts the entire directory
# tree at '/srv/shiny-server'
site_dir /srv/shiny-server/kronarshy;
# Define where we should put the log files for this location
log_dir /var/log/shiny-server/kronarshy;
# Should we list the contents of a (non-Shiny-App) directory when the user
# visits the corresponding URL?
#directory_index on;
}
}
#!/bin/sh
mkdir -p /srv/shiny-server/www/masque/todo /srv/shiny-server/www/masque/doing /srv/shiny-server/www/masque/error /srv/shiny-server/www/masque/done
chown shiny.shiny /srv/shiny-server/www/masque/todo /srv/shiny-server/www/masque/doing /srv/shiny-server/www/masque/error /srv/shiny-server/www/masque/done
exec nohup /usr/bin/python3 /usr/bin/shaman_bioblend/shaman_bioblend.py -w /srv/shiny-server/www/masque/ -s -d &
# Make sure the directory for individual app logs exists
mkdir -p /var/log/shiny-server
chown shiny.shiny /var/log/shiny-server
exec shiny-server >> /var/log/shiny-server.log 2>&1
exec nohup /usr/bin/Rscript /usr/bin/run_kronarshy.R&
......@@ -457,13 +457,13 @@ shinyServer(function(input, output,session) {
data = tmp$data
check = tmp$check
cond = (!is.null(data$counts) && nrow(data$counts)>0 && !is.null(data$taxo) && nrow(data$taxo)>0)
res = shinydashboard::valueBox(paste0(0, "%"),h6(strong("Annotated features")), color = "light-blue",width=NULL,icon = icon("list"))
res = shinydashboardshaman::valueBox(paste0(0, "%"),h6(strong("Annotated features")), color = "light-blue",width=NULL,icon = icon("list"))
if(cond)
{
percent = round(100*tmp$percent,2)
if(percent==0) res = shinydashboard::valueBox(paste0(percent, "%"),h6(strong("Annotated features")), color = "red",width=NULL,icon = icon("list"))
if(percent!=0) res = shinydashboard::valueBox(paste0(percent, "%"),h6(strong("Annotated features")), color = "green",width=NULL,icon = icon("list"))
if(percent==0) res = shinydashboardshaman::valueBox(paste0(percent, "%"),h6(strong("Annotated features")), color = "red",width=NULL,icon = icon("list"))
if(percent!=0) res = shinydashboardshaman::valueBox(paste0(percent, "%"),h6(strong("Annotated features")), color = "green",width=NULL,icon = icon("list"))
}
......@@ -1203,12 +1203,12 @@ shinyServer(function(input, output,session) {
res = NULL
error_progress = values$error_progress
num = round(as.numeric(values$num),1)
res = shinydashboard::valueBox("0 %",h6(strong("Waiting for the data...")), color = "light-blue",width=NULL,icon = uiOutput("spinner_icon"))
res = shinydashboardshaman::valueBox("0 %",h6(strong("Waiting for the data...")), color = "light-blue",width=NULL,icon = uiOutput("spinner_icon"))
CMP = isolate(CheckMasque(input, values, check_mail=FALSE))
Error = CMP$Error
if(num>=100) res = shinydashboard::valueBox(paste("100 %"),h6(strong("Analysis completed ! Check your mail.")), color = "green",width=NULL,icon = uiOutput("check_icon"))
else if(is.null(Error) || num>=1) res = shinydashboard::valueBox(paste(values$num,"%"),h6(strong("Analysis in progress...")), color = "green",width=NULL,icon = uiOutput("spinner_anim"))
else if(!is.null(Error) && num>=1 || error_progress) res = shinydashboard::valueBox(paste(values$num,"%"),h6(strong("Workflow failed during progression...")), color = "red",width=NULL,icon = uiOutput("spinner_anim"))
if(num>=100) res = shinydashboardshaman::valueBox(paste("100 %"),h6(strong("Analysis completed ! Check your mail.")), color = "green",width=NULL,icon = uiOutput("check_icon"))
else if(is.null(Error) || num>=1) res = shinydashboardshaman::valueBox(paste(values$num,"%"),h6(strong("Analysis in progress...")), color = "green",width=NULL,icon = uiOutput("spinner_anim"))
else if(!is.null(Error) && num>=1 || error_progress) res = shinydashboardshaman::valueBox(paste(values$num,"%"),h6(strong("Workflow failed during progression...")), color = "red",width=NULL,icon = uiOutput("spinner_anim"))
return(res)
})
......@@ -2093,11 +2093,11 @@ shinyServer(function(input, output,session) {
#### Ajout fontion check target
#infoBox(h6(strong("Target file")), subtitle = h6("Your target file is OK"), icon = icon("thumbs-o-up"),color = "green",width=NULL,fill=TRUE)
labeled = round(labeled,2)
if(labeled>0) res = shinydashboard::valueBox(paste0(labeled, "%"),h6(strong("Labeled features")), color = "green",width=NULL,icon = icon("list"))
else res = shinydashboard::valueBox(paste0(labeled, "%"),h6(strong("Labeled features")), color = "red",width=NULL,icon = icon("list"))
if(labeled>0) res = shinydashboardshaman::valueBox(paste0(labeled, "%"),h6(strong("Labeled features")), color = "green",width=NULL,icon = icon("list"))
else res = shinydashboardshaman::valueBox(paste0(labeled, "%"),h6(strong("Labeled features")), color = "red",width=NULL,icon = icon("list"))
}
#else infoBox(h6(strong("Target file")), subtitle = h6("Label of the target file must correspond to count table column names") ,color = "light-blue",width=NULL,fill=TRUE, icon = icon("warning"))
else res = shinydashboard::valueBox(paste0(0, "%"),h6(strong("Labeled features")), color = "light-blue",width=NULL,icon = icon("list"))
else res = shinydashboardshaman::valueBox(paste0(0, "%"),h6(strong("Labeled features")), color = "light-blue",width=NULL,icon = icon("list"))
return(res)
}
)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment