Commit e9de9648 authored by Midoux Cedric's avatar Midoux Cedric
Browse files

histScript

No related merge requests found
Showing with 57 additions and 3 deletions
+57 -3
...@@ -210,16 +210,66 @@ shinyServer ...@@ -210,16 +210,66 @@ shinyServer
"barGrid", "barGrid",
label = "Subplot : ", label = "Subplot : ",
choices = c("..." = 0, sample_variables(data16S())) choices = c("..." = 0, sample_variables(data16S()))
) ),
,
selectInput( selectInput(
"barX", "barX",
label = "X : ", label = "X : ",
choices = c("..." = 0, sample_variables(data16S())) choices = c("..." = 0, sample_variables(data16S()))
),
box(
title = "RCode",
width = NULL,
status = "primary",
collapsible = TRUE,
collapsed = TRUE,
verbatimTextOutput("histScript")
) )
) )
}) })
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",
"# Plot barplot\n",
"p <- plot_bar(physeq = data",
ifelse(
is.null(checkNull(input$barFill)),
"",
paste0(",\n fill = \"", input$barFill, "\"")
),
ifelse(is.null(checkNull(input$barX)), "", paste0(",\n x = ", input$barX)),
ifelse(
is.null(checkNull(input$barTitle)),
"",
paste0(",\n title = \"", input$barTitle, "\"")
),
")\n",
ifelse(
is.null(checkNull(input$barGrid)),
"",
paste0(
"p <- p + facet_grid(\". ~ ",
input$barGrid,
"\", scales = \"free_x\")\n"
)
),
"\n",
"plot(p)"
)
})
output$histo <- renderPlot({ output$histo <- renderPlot({
validate(need(data16S(), validate(need(data16S(),
"Requires an abundance dataset")) "Requires an abundance dataset"))
...@@ -854,7 +904,11 @@ shinyServer ...@@ -854,7 +904,11 @@ shinyServer
axes = as.numeric(input$acpAxes), axes = as.numeric(input$acpAxes),
title = checkNull(input$acpTitle), title = checkNull(input$acpTitle),
color = checkNull(input$acpCol), color = checkNull(input$acpCol),
replicate = if (is.null(checkNull(input$acpRep))) { NULL } else { checkNull(input$acpRep) }, replicate = if (is.null(checkNull(input$acpRep))) {
NULL
} else {
checkNull(input$acpRep)
},
shape = checkNull(input$acpShape), shape = checkNull(input$acpShape),
label = checkNull(input$acpLabel) label = checkNull(input$acpLabel)
) )
......
Supports Markdown
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