Commit d462227a authored by Midoux Cedric's avatar Midoux Cedric

histFocusScript

parent cbcf74eb
......@@ -28,7 +28,7 @@ shinyServer
options = list(
dom = "lBtip",
pageLength = 10,
lengthMenu = list(c(10, 25, 50, 100, -1), list('10', '25', '50', '100', 'All')),
lengthMenu = list(c(10, 25, 50, 100,-1), list('10', '25', '50', '100', 'All')),
buttons = list(
'colvis',
list(
......@@ -293,7 +293,8 @@ shinyServer
})
output$histFocusUIfocusTaxa <- renderUI({
validate(need(data16S(), ""))
validate(need(data16S(), ""),
need(input$focusRank, ""))
selectInput(
"focusTaxa",
label = "Selected taxa : ",
......@@ -330,9 +331,61 @@ shinyServer
choices = c("..." = 0, sample_variables(data16S())))
})
output$histoFocus <- renderPlot({
validate(need(data16S(),
"Requires an abundance dataset"))
output$histFocusUI <- renderUI({
validate(need(data16S(), ""))
box(
title = "Setting : ",
width = NULL,
status = "primary",
uiOutput("histFocusUIfocusRank"),
uiOutput("histFocusUIfocusTaxa"),
uiOutput("histFocusUIfocusNbTaxa"),
uiOutput("histFocusUIfocusGrid"),
uiOutput("histFocusUIfocusX"),
collapsedBox(verbatimTextOutput("histFocusScript"), title = "RCode")
)
})
output$histFocusScript <- renderText({
paste0(
scriptHead,
"# Plot filtered barplot\n",
"p <- plot_composition(physeq = data",
glue(", taxaRank1 = \"{input$focusRank}\""),
glue(", taxaSet1 = \"{input$focusTaxa}\""),
glue(
", taxaRank2 = \"{rank_names(data16S())[which(rank_names(data16S()) == input$focusRank) + 1]}\""
),
glue(", numberOfTaxa = {input$focusNbTaxa}"),
glue(
", fill = \"{rank_names(data16S())[which(rank_names(data16S()) == input$focusRank) + 1]}\""
),
ifelse(is.null(checkNull(input$focusX)),
"",
glue(", x = \"{input$focusX}\"")),
")\n",
ifelse(
is.null(checkNull(input$focusGrid)),
"",
glue(
"p <- p + facet_grid(\". ~ {input$focusGrid}\", scales = \"free_x\")"
)
),
###
# x = ifelse(is.null(checkNull(input$focusX)), "Sample", input$focusX)
###
"\n",
"plot(p)"
)
})
output$histFocus <- renderPlot({
validate(
need(data16S(),
"Requires an abundance dataset"),
need(input$focusRank, ""),
need(input$focusTaxa, "")
)
p <- plot_composition(
physeq = data16S(),
taxaRank1 = input$focusRank,
......
......@@ -104,17 +104,8 @@ shinyUI(dashboardPage(
uiOutput("histUI")),
tabPanel(
"Filtered barplot",
withLoader(plotOutput("histoFocus", height = 700)),
box(
title = "Paramètres",
width = NULL,
status = "primary",
uiOutput("histFocusUIfocusRank"),
uiOutput("histFocusUIfocusTaxa"),
uiOutput("histFocusUIfocusNbTaxa"),
uiOutput("histFocusUIfocusGrid"),
uiOutput("histFocusUIfocusX")
)
withLoader(plotOutput("histFocus", height = 700)),
uiOutput("histFocusUI")
),
tabPanel("Heatmap",
withLoader(plotOutput("Heatmap", height = 700)),
......
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