Commit d462227a authored by Midoux Cedric's avatar Midoux Cedric

histFocusScript

parent cbcf74eb
...@@ -28,7 +28,7 @@ shinyServer ...@@ -28,7 +28,7 @@ shinyServer
options = list( options = list(
dom = "lBtip", dom = "lBtip",
pageLength = 10, 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( buttons = list(
'colvis', 'colvis',
list( list(
...@@ -293,7 +293,8 @@ shinyServer ...@@ -293,7 +293,8 @@ shinyServer
}) })
output$histFocusUIfocusTaxa <- renderUI({ output$histFocusUIfocusTaxa <- renderUI({
validate(need(data16S(), "")) validate(need(data16S(), ""),
need(input$focusRank, ""))
selectInput( selectInput(
"focusTaxa", "focusTaxa",
label = "Selected taxa : ", label = "Selected taxa : ",
...@@ -330,9 +331,61 @@ shinyServer ...@@ -330,9 +331,61 @@ shinyServer
choices = c("..." = 0, sample_variables(data16S()))) choices = c("..." = 0, sample_variables(data16S())))
}) })
output$histoFocus <- renderPlot({ output$histFocusUI <- renderUI({
validate(need(data16S(), validate(need(data16S(), ""))
"Requires an abundance dataset")) 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( p <- plot_composition(
physeq = data16S(), physeq = data16S(),
taxaRank1 = input$focusRank, taxaRank1 = input$focusRank,
......
...@@ -104,17 +104,8 @@ shinyUI(dashboardPage( ...@@ -104,17 +104,8 @@ shinyUI(dashboardPage(
uiOutput("histUI")), uiOutput("histUI")),
tabPanel( tabPanel(
"Filtered barplot", "Filtered barplot",
withLoader(plotOutput("histoFocus", height = 700)), withLoader(plotOutput("histFocus", height = 700)),
box( uiOutput("histFocusUI")
title = "Paramètres",
width = NULL,
status = "primary",
uiOutput("histFocusUIfocusRank"),
uiOutput("histFocusUIfocusTaxa"),
uiOutput("histFocusUIfocusNbTaxa"),
uiOutput("histFocusUIfocusGrid"),
uiOutput("histFocusUIfocusX")
)
), ),
tabPanel("Heatmap", tabPanel("Heatmap",
withLoader(plotOutput("Heatmap", height = 700)), 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