mgTableBrowser: Displays a an interactive table of GSEA statistics from an...

View source: R/mgTableBrowser-module.R

mgTableBrowserR Documentation

Displays a an interactive table of GSEA statistics from an analysis.

Description

This module lists all of the genesets from an analysis that are significant given an 'fdr' and 'method' of analysis. Row selections trigger a shiny event that broadcasts the key of the geneset that was selected. You would then want to 'observeEvent(this$selected)' in your 'server.R' (or similar) so you can react to the gene set selection the user triggers.

Usage

mgTableBrowser(input, output, session, src, method, fdr, server = TRUE)

mgTableBrowserUI(id)

Arguments

input, output, session

shiny module bits

src

the SparrowResultContainer object

method

a reactive that determines which method to explore from this result

fdr

a reactive that gives the fdr threshold to filter results in the table by.

server

boolean passed to [DT::renderDataTable()] (default: 'TRUE').

id

the shiny id of the UI module

Value

a list with reactives:

$stats

The table of gene sets and their statistics that pass the prescribed fdr thershold

$selected

The geneset that is currently "active"/selected by the user. This is defined as <collection>_::_<name>

Functions

  • mgTableBrowserUI: The UI for the module.

Examples

sres <- sparrow::exampleSparrowResult()
app <- shiny::shinyApp(
  ui = shiny::shinyUI(shiny::fluidPage(
    exampleUISetup(),
    title = "GSEA Stats Table Browser Module",
    mgTableBrowserUI("mod"))),
  server = function(input, output, session) {
    src <- shiny::reactive(SparrowResultContainer(sres))
    method <- shiny::reactive("camera")
    fdr <- shiny::reactive(0.2)
    shiny::callModule(mgTableBrowser, "mod", src, method, fdr)
  })
if (interactive()) {
  shiny::runApp(app)
}

lianos/sparrow.shiny documentation built on Oct. 12, 2023, 2:43 a.m.