#' plot_DEU
#' @import shiny methods
#' @export
plot_DEU <- function(model_input, top_input) {
ds <- readRDS(model_input)
exon_data <- readRDS(top_input)
shinyApp(
ui = fluidPage(
# tags$head(tags$style(HTML("#gene_info {overflow-y: scroll;
# height:10em;}"))),
fluidRow(
column(3, selectInput('Contrast', 'Contrast', names(exon_data)),
uiOutput("select_gene"))),
fluidRow(shinycssloaders::withSpinner(plotOutput('my_plot'))),
fluidRow(textOutput("gene_info"))
),
server = function(input, output, session) {
# exon_data <- reactiveValues(x = readRDS("top_exon.rds"))
# Combine the selected variables into a new data frame
data <- eventReactive(input$Contrast, {
out <- exon_data[[input$Contrast]]
out})
model <- eventReactive(input$Contrast, {
out <- ds[[input$Contrast]]
out})
output$select_gene <- renderUI({
input$Contrast
column(4, selectInput('Gene', 'Gene', data()$genes, selected = "58234"))})
output$gene_info <- renderText(data()$GENENAME[which(data()$genes == input$Gene)])
observe({
input$Gene
input$Contrast
isolate({
what <- data()$genes
my_model <- model()
output$my_plot <- renderPlot(edgeR::plotSpliceDGE(my_model, input$Gene))
})})
}
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.