Commit 7882da3a authored by Midoux Cedric's avatar Midoux Cedric

rework histFocusScript

parent a36798bd
...@@ -343,36 +343,39 @@ shinyServer ...@@ -343,36 +343,39 @@ shinyServer
}) })
output$histFocusScript <- renderText({ output$histFocusScript <- renderText({
paste0( scriptArgs <- c(
scriptHead, "physeq = data",
"# Plot filtered barplot\n", glue("taxaRank1 = \"{input$focusRank}\""),
"p <- plot_composition(physeq = data", glue("taxaSet1 = \"{input$focusTaxa}\""),
glue(", taxaRank1 = \"{input$focusRank}\""),
glue(", taxaSet1 = \"{input$focusTaxa}\""),
glue( glue(
", taxaRank2 = \"{rank_names(data16S())[which(rank_names(data16S()) == input$focusRank) + 1]}\"" "taxaRank2 = \"{rank_names(data16S())[which(rank_names(data16S()) == input$focusRank) + 1]}\""
), ),
glue(", numberOfTaxa = {input$focusNbTaxa}"), glue("numberOfTaxa = {input$focusNbTaxa}"),
glue( glue(
", fill = \"{rank_names(data16S())[which(rank_names(data16S()) == input$focusRank) + 1]}\"" "fill = \"{rank_names(data16S())[which(rank_names(data16S()) == input$focusRank) + 1]}\""
), )
ifelse(is.null(checkNull(input$focusX)), )
"", if (!is.null(checkNull(input$focusX))) {
glue(", x = \"{input$focusX}\"")), scriptArgs <- c(scriptArgs, glue("x = \"{input$focusX}\""))
")\n", }
ifelse( script <- c(
is.null(checkNull(input$focusGrid)), scriptHead,
"", "# Plot filtered barplot",
glue(
"p <- plot_composition({glue_collapse(scriptArgs, sep=', ')})"
)
)
if (!is.null(checkNull(input$focusGrid))) {
script <- c(
script,
glue( glue(
"p <- p + facet_grid(\". ~ {input$focusGrid}\", scales = \"free_x\")" "p <- p + facet_grid(\". ~ {input$focusGrid}\", scales = \"free_x\")"
) )
), )
### }
# x = ifelse(is.null(checkNull(input$focusX)), "Sample", input$focusX) script <- c(script, "", "plot(p)")
###
"\n", return(glue_collapse(script, sep = "\n"))
"plot(p)"
)
}) })
output$histFocus <- renderPlot({ output$histFocus <- renderPlot({
......
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