File size: 1,209 Bytes
c038271 8e7c9f6 c038271 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
box::use(
shiny[...],
bs4Dash[box],
g3viz[...]
)
#' @export
ui <- function(id) {
ns <- NS(id)
tagList(
box(
width = 12,
status = "navy",
solidHeader = TRUE,
align = "center",
title = "Lollipop plot",
id = "lollipop_plot_box",
g3LollipopOutput(ns("lollipop_plot"), height = "700px")
)
)
}
#' @export
server <- function(id, data, selected_gene_rval) {
moduleServer(id, function(input, output, session) {
output$lollipop_plot <- renderG3Lollipop({
req(selected_gene_rval())
filter_tab <- data()[gene_name == selected_gene_rval()]
plot.options <- g3Lollipop.theme(theme.name = "cbioportal",
title.text = selected_gene_rval(),
y.axis.label = "# of Mutations")
g3viz::g3Lollipop(
mutation.dat = filter_tab,
gene.symbol = selected_gene_rval(),
gene.symbol.col = "gene_name",
aa.pos.col = "Protein_position",
protein.change.col = "HGVSp",
factor.col = "Consequence",
btn.style = "gray", # gray-style chart download buttons
plot.options = plot.options,
)
})
})
}
|