Commit 9caf10fe authored by jlopez's avatar jlopez
Browse files

Multiple update

parent b6a5614d
...@@ -16,6 +16,12 @@ source("./pages/pages_def_home.R", local = T) ...@@ -16,6 +16,12 @@ source("./pages/pages_def_home.R", local = T)
options(encoding = 'UTF-8') options(encoding = 'UTF-8')
jscode <- "
shinyjs.collapse = function(boxid) {
$('#' + boxid).closest('.box').find('[data-widget=collapse]').click();
}
"
#style <- tags$style(HTML(readLines("www/added_styles.css")) ) #style <- tags$style(HTML(readLines("www/added_styles.css")) )
UI <- dashboardPage( UI <- dashboardPage(
skin = "green", skin = "green",
...@@ -24,6 +30,7 @@ UI <- dashboardPage( ...@@ -24,6 +30,7 @@ UI <- dashboardPage(
dashboardBody( dashboardBody(
shinyjs::useShinyjs(), shinyjs::useShinyjs(),
extendShinyjs(text = jscode),
tags$head(tags$link(rel = "stylesheet", type = "text/css", href = "bootstrap.min.readable.css")) , tags$head(tags$link(rel = "stylesheet", type = "text/css", href = "bootstrap.min.readable.css")) ,
#tags$head(style), #tags$head(style),
......
...@@ -13,7 +13,7 @@ tabHome = fluidPage(align="left", ...@@ -13,7 +13,7 @@ tabHome = fluidPage(align="left",
radioButtons("containerType", "Container type:", choices = list("Singularity" = "singularity", "Docker" = "docker"), selected = "singularity"), radioButtons("containerType", "Container type:", choices = list("Singularity" = "singularity", "Docker" = "docker"), selected = "singularity"),
br(), br(),
#selectizeInput('rcranpackagelist', 'R CRAN:', choices = NULL, multiple=TRUE, options = list(maxItems = 30000)), #selectizeInput('rcranpackagelist', 'R CRAN:', choices = NULL, multiple=TRUE, options = list(maxItems = 30000)),
selectizeInput('rtemplate', 'R origin:', choices = c(`None` = 'none', `R from source` = 'source', `R from r-base` = 'base', `R from CRAN depo` = 'cran'), selected = "source", multiple = FALSE), selectizeInput('rtemplate', 'R origin:', choices = c(`None` = 'none', `R from source 3.4.3` = 'source', `R from source 3.4.4` = 'source2', `R from source 3.5.0` = 'source3', `R from r-base` = 'base', `R from CRAN depo` = 'cran'), selected = "source", multiple = FALSE),
#selectizeInput('biocontainers', 'BioContainers tools :', choices = getBioconductorPackage(), multiple = TRUE), #selectizeInput('biocontainers', 'BioContainers tools :', choices = getBioconductorPackage(), multiple = TRUE),
...@@ -26,6 +26,7 @@ tabHome = fluidPage(align="left", ...@@ -26,6 +26,7 @@ tabHome = fluidPage(align="left",
)), )),
column(width = 10, column(width = 10,
box( box(
id = "boxPackage",
title = "Packages and tools", title = "Packages and tools",
width = NULL, width = NULL,
collapsible = TRUE, collapsible = TRUE,
......
...@@ -102,11 +102,11 @@ createLabel <- function(result) { ...@@ -102,11 +102,11 @@ createLabel <- function(result) {
if(input$containerType == "singularity") { if(input$containerType == "singularity") {
result <- paste(result, "%labels", sep = "\n") result <- paste(result, "%labels", sep = "\n")
result <- paste(result, "\tAuthor Jimmy Lopez", sep = "\n") result <- paste(result, "\tAuthor YourName", sep = "\n")
result <- paste(result, "\tVersion v0.0.1", sep = "\n") result <- paste(result, "\tVersion v0.0.1", sep = "\n")
result <- paste0(result, "\n\tbuild_date ", format(Sys.time(), "%Y %b %d")) result <- paste0(result, "\n\tbuild_date ", format(Sys.time(), "%Y %b %d"))
} else { } else {
result <- paste(result, "LABEL Author Jimmy Lopez", sep = "\n") result <- paste(result, "LABEL Author YourName", sep = "\n")
result <- paste(result, "LABEL Version v0.0.1", sep = "\n") result <- paste(result, "LABEL Version v0.0.1", sep = "\n")
result <- paste0(result, "\n", "LABEL build_date ", format(Sys.time(), "%Y %b %d")) result <- paste0(result, "\n", "LABEL build_date ", format(Sys.time(), "%Y %b %d"))
} }
...@@ -158,6 +158,8 @@ createLibPrePost <- function(result) { ...@@ -158,6 +158,8 @@ createLibPrePost <- function(result) {
createRBase <- function(result) { createRBase <- function(result) {
result <- paste(result, '############### Install R From RBase ##############', sep = "\n")
if(input$containerType == "singularity") { if(input$containerType == "singularity") {
result <- paste(result, "\tapt-get install -y r-base r-base-dev", sep = "\n") result <- paste(result, "\tapt-get install -y r-base r-base-dev", sep = "\n")
} else { } else {
...@@ -168,21 +170,23 @@ createRBase <- function(result) { ...@@ -168,21 +170,23 @@ createRBase <- function(result) {
return(result) return(result)
} }
createRSource <- function(result) { createRSource <- function(result, Rversion) {
result <- paste(result, '############### Install R From Source ##############', sep = "\n")
if(input$containerType == "singularity") { if(input$containerType == "singularity") {
result <- paste(result, '\tcd $HOME', sep = "\n") result <- paste(result, '\tcd $HOME', sep = "\n")
result <- paste(result, '\twget https://cran.rstudio.com/src/base/R-3/R-3.4.3.tar.gz', sep = "\n") result <- paste0(result, '\n\twget https://cran.rstudio.com/src/base/R-3/R-', Rversion, '.tar.gz')
result <- paste(result, '\ttar xvf R-3.4.3.tar.gz', sep = "\n") result <- paste0(result, '\n\ttar xvf R-', Rversion, '.tar.gz')
result <- paste(result, '\tcd R-3.4.3', sep = "\n") result <- paste0(result, '\n\tcd R-', Rversion)
result <- paste(result, "\t./configure --enable-R-static-lib --with-blas --with-lapack --enable-R-shlib=yes ", sep = "\n") result <- paste(result, "\t./configure --enable-R-static-lib --with-blas --with-lapack --enable-R-shlib=yes ", sep = "\n")
result <- paste(result, "\tmake", sep = "\n") result <- paste(result, "\tmake", sep = "\n")
result <- paste(result, "\tmake install", sep = "\n") result <- paste(result, "\tmake install", sep = "\n")
} else { } else {
result <- paste(result, 'RUN cd $HOME \\', sep = "\n") result <- paste(result, 'RUN cd $HOME \\', sep = "\n")
result <- paste(result, '\t&& wget https://cran.rstudio.com/src/base/R-3/R-3.4.3.tar.gz \\', sep = "\n") result <- paste0(result, '\n\t&& wget https://cran.rstudio.com/src/base/R-3/R-', Rversion, '.tar.gz \\')
result <- paste(result, '\t&& tar xvf R-3.4.3.tar.gz \\', sep = "\n") result <- paste0(result, '\n\t&& tar xvf R-', Rversion, '.tar.gz \\')
result <- paste(result, '\t&& cd R-3.4.3 \\' , sep = "\n") result <- paste0(result, '\n\t&& cd R-', Rversion, ' \\')
result <- paste(result, "\t&& ./configure --enable-R-static-lib --with-blas --with-lapack --enable-R-shlib=yes \\", sep = "\n") result <- paste(result, "\t&& ./configure --enable-R-static-lib --with-blas --with-lapack --enable-R-shlib=yes \\", sep = "\n")
result <- paste(result, "\t&& make \\", sep = "\n") result <- paste(result, "\t&& make \\", sep = "\n")
result <- paste(result, "\t&& make install \\", sep = "\n") result <- paste(result, "\t&& make install \\", sep = "\n")
...@@ -194,6 +198,8 @@ createRSource <- function(result) { ...@@ -194,6 +198,8 @@ createRSource <- function(result) {
createRCran <- function(result) { createRCran <- function(result) {
result <- paste(result, '############### Install R From CRAN ##############', sep = "\n")
if(input$containerType == "singularity") { if(input$containerType == "singularity") {
result <- paste(result, "\tapt-get install -y software-properties-common", sep = "\n") result <- paste(result, "\tapt-get install -y software-properties-common", sep = "\n")
result <- paste(result, "\tadd-apt-repository 'deb http://cloud.r-project.org/bin/linux/ubuntu xenial/'", sep = "\n") result <- paste(result, "\tadd-apt-repository 'deb http://cloud.r-project.org/bin/linux/ubuntu xenial/'", sep = "\n")
...@@ -214,6 +220,8 @@ createRCran <- function(result) { ...@@ -214,6 +220,8 @@ createRCran <- function(result) {
createCRANPackage <- function(result) { createCRANPackage <- function(result) {
selectCRAN <- allCRAN[input$dtrcranpackage_rows_all,] selectCRAN <- allCRAN[input$dtrcranpackage_rows_all,]
selectCRAN <- selectCRAN[,"Package"] selectCRAN <- selectCRAN[,"Package"]
sizeCRAN <- length(selectCRAN) sizeCRAN <- length(selectCRAN)
...@@ -223,6 +231,8 @@ createCRANPackage <- function(result) { ...@@ -223,6 +231,8 @@ createCRANPackage <- function(result) {
if(sizeCRAN < length(allCRAN[,"Package"])) { if(sizeCRAN < length(allCRAN[,"Package"])) {
if(sizeCRAN >= 1) { if(sizeCRAN >= 1) {
result <- paste(result, '############### Install CRAN Package ##############', sep = "\n")
if(input$containerType == "singularity") { if(input$containerType == "singularity") {
listRCRAN <- '\techo install.packages\\(c(' listRCRAN <- '\techo install.packages\\(c('
} else { } else {
...@@ -255,6 +265,9 @@ createGithubPackage <- function(result) { ...@@ -255,6 +265,9 @@ createGithubPackage <- function(result) {
if(sizeGITHUB >= 1) { if(sizeGITHUB >= 1) {
result <- paste(result, '############### Install Github Package ##############', sep = "\n")
if(input$containerType == "singularity") { if(input$containerType == "singularity") {
listRGITHUB <- '\tR --slave -e "install_github(c(' listRGITHUB <- '\tR --slave -e "install_github(c('
} else { } else {
...@@ -290,6 +303,9 @@ createBioconductorPackage <- function(result) { ...@@ -290,6 +303,9 @@ createBioconductorPackage <- function(result) {
if(sizeBIO < length(allBIO[,"Package"])) { if(sizeBIO < length(allBIO[,"Package"])) {
if(sizeBIO >= 1) { if(sizeBIO >= 1) {
result <- paste(result, '############### Install Bioconductor Package ##############', sep = "\n")
if(input$containerType == "singularity") { if(input$containerType == "singularity") {
result <- paste(result, '\tR --slave -e "source(\'https://bioconductor.org/biocLite.R\'); biocLite(); "', sep = "\n") result <- paste(result, '\tR --slave -e "source(\'https://bioconductor.org/biocLite.R\'); biocLite(); "', sep = "\n")
listRBIO <- '\tR --slave -e "source(\'https://bioconductor.org/biocLite.R\'); biocLite(\\' listRBIO <- '\tR --slave -e "source(\'https://bioconductor.org/biocLite.R\'); biocLite(\\'
...@@ -360,6 +376,10 @@ createBiocontainer <- function(result, haveR) { ...@@ -360,6 +376,10 @@ createBiocontainer <- function(result, haveR) {
result <- paste0(result, "\n") result <- paste0(result, "\n")
for (tool in selectBioTool){ for (tool in selectBioTool){
result <- paste(result, '############### Install BioContainer tools ##############', sep = "\n")
result <- paste(result, getInstallToolPackageBioContainer(tool, input$containerType), sep="\n\n") result <- paste(result, getInstallToolPackageBioContainer(tool, input$containerType), sep="\n\n")
} }
} else { } else {
...@@ -405,6 +425,10 @@ createBiocontainer <- function(result, haveR) { ...@@ -405,6 +425,10 @@ createBiocontainer <- function(result, haveR) {
result <- paste0(result, "\n") result <- paste0(result, "\n")
for (tool in selectBioTool){ for (tool in selectBioTool){
result <- paste(result, '############### Install BioContainer tools ##############', sep = "\n")
result <- paste0(result, "\nRUN ", getInstallToolPackageBioContainer(tool, input$containerType)) result <- paste0(result, "\nRUN ", getInstallToolPackageBioContainer(tool, input$containerType))
} }
...@@ -427,8 +451,15 @@ createContentFile <- function() { ...@@ -427,8 +451,15 @@ createContentFile <- function() {
haveR = TRUE haveR = TRUE
if(input$rtemplate == "source") { if(input$rtemplate == "source" || input$rtemplate == "source2" || input$rtemplate == "source3") {
result <- createRSource(result) Rversion = "3.4.3"
if(input$rtemplate == "source2") {
Rversion = "3.4.4"
}else if(input$rtemplate == "source3") {
Rversion = "3.5.0"
}
result <- createRSource(result, Rversion)
} else if(input$rtemplate == "base") { } else if(input$rtemplate == "base") {
result <- createRBase(result) result <- createRBase(result)
} else if(input$rtemplate == "cran") { } else if(input$rtemplate == "cran") {
...@@ -452,8 +483,8 @@ createContentFile <- function() { ...@@ -452,8 +483,8 @@ createContentFile <- function() {
} }
observeEvent(input$createContainer, { observeEvent(input$createContainer, {
print("preview") js$collapse("boxPackage")
show("downloadContainerFile") show("downloadContainerFile")
......
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