Output and render functions for using geneviewer within Shiny applications and interactive Rmd documents.
Usage
GC_chartOutput(outputId, width = "100%", height = "400px")
renderGC_chart(expr, env = parent.frame(), quoted = FALSE)
Arguments
- outputId
Output variable to read from.
- width,
height Must be a valid CSS unit (like '100 or a number, which will be coerced to a string and have 'px' appended.
- height
Height of the output widget, must be a valid CSS unit (like '100 have 'px' appended.
- expr
An expression that generates a GC chart.
- env
The environment in which to evaluate expr.
- quoted
Is expr a quoted expression (with quote())? This is useful if you want to save an expression in a variable.
Examples
if (interactive()) {
library(shiny)
library(geneviewer)
ui <- fluidPage(
titlePanel("Omphalotin Gene Cluster Visualization"),
mainPanel(
GC_chartOutput("gcChart", width = "100%", height = "500px")
)
)
server <- function(input, output) {
output$gcChart <- renderGC_chart({
GC_chart(
ophA_clusters, # Ensure 'ophA_clusters' data is defined or available
cluster = "cluster",
group = "class"
) %>%
GC_title(title = c("<i>O. olearius</i>", "<i>D. bispora</i>")) %>%
GC_labels("name") %>%
GC_legend(position = "bottom") %>%
GC_scaleBar() %>%
GC_clusterLabel(title = "ophA")
})
}
shinyApp(ui = ui, server = server)
}