Commit cbcf74eb authored by Midoux Cedric's avatar Midoux Cedric

clustScript

parent eb23ee7e
library(shinydashboard)
library(glue)
shinyServer
(function(input, output, session)
......@@ -123,6 +124,22 @@ shinyServer
})
}
scriptHead = paste0(
"# Loading packages\n",
"source(\"https://raw.githubusercontent.com/mahendra-mariadassou/phyloseq-extended/master/R/load-extra-functions.R\")\n",
"\n",
"# Loading data\n",
paste0(
"load(\"",
paste("Easy16S-data", Sys.Date(), "RData", sep = "."),
"\") # if necessary, adapt the file path\n"
),
"\n",
"# View data\n",
"data\n",
"\n"
)
output$downloadData <- {
downloadHandler(
filename = function() {
......@@ -155,7 +172,7 @@ shinyServer
validate(
need(
data16S(),
"Firstly, you should select a demo dataset or upload an abundance BIOM file.\nFor example, with Galaxy, a BIOM file can be obtained at the end of FROGS workflow with the 'FROGS BIOM to std BIOM' tool.\n Make sure that the phyloseq object in the RData file is called 'data'."
"Firstly, you should select a demo dataset or upload an abundance BIOM file.\nFor example, with Galaxy, a BIOM file can be obtained at the end of FROGS workflow with the 'FROGS BIOM to std BIOM' tool. \nMake sure that the phyloseq object in the RData file is called 'data'."
)
)
data16S()
......@@ -224,40 +241,24 @@ shinyServer
output$histScript <- renderText({
paste0(
"# Loading packages\n",
"source(\"https://raw.githubusercontent.com/mahendra-mariadassou/phyloseq-extended/master/R/load-extra-functions.R\")\n",
"\n",
"# Loading data\n",
paste0(
"load(\"",
paste("Easy16S-data", Sys.Date(), "RData", sep = "."),
"\") # if necessary, adapt the file path\n"
),
"\n",
"# View data\n",
"data\n",
"\n",
scriptHead,
"# Plot barplot\n",
"p <- plot_bar(physeq = data",
ifelse(
is.null(checkNull(input$barFill)),
glue(", fill = \"{input$barFill}\""),
ifelse(is.null(checkNull(input$barX)),
"",
paste0(",\n fill = \"", input$barFill, "\"")
),
ifelse(is.null(checkNull(input$barX)), "", paste0(",\n x = ", input$barX)),
glue(", x = \"{input$barX}\"")),
ifelse(
is.null(checkNull(input$barTitle)),
"",
paste0(",\n title = \"", input$barTitle, "\"")
glue(", title = \"{input$barTitle}\"")
),
")\n",
ifelse(
is.null(checkNull(input$barGrid)),
"",
paste0(
"p <- p + facet_grid(\". ~ ",
input$barGrid,
"\", scales = \"free_x\")\n"
glue(
"p <- p + facet_grid(\". ~ {input$barGrid}\", scales = \"free_x\")"
)
),
"\n",
......@@ -385,7 +386,26 @@ shinyServer
"clustCol",
label = "Color : ",
choices = c("..." = 0, sample_variables(data16S()))
),
collapsedBox(verbatimTextOutput("clustScript"), title = "RCode")
)
})
output$clustScript <- renderText({
paste0(
scriptHead,
"# Plot barplot\n",
"p <- plot_clust(physeq = data",
glue(", dist = \"{input$clustDist}\""),
glue(", method = \"{input$clustMethod}\""),
ifelse(
is.null(checkNull(input$clustCol)),
"",
glue(", color = \"{input$clustCol}\"")
),
")\n",
"\n",
"plot(p)"
)
})
......
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