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

rework histFocusScript

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