reactiveGeneSetDb: A UI for a GeneSetDb that enables users to select gene sets...

View source: R/reactiveGeneSetDb-module.R

reactiveGeneSetDbR Documentation

A UI for a GeneSetDb that enables users to select gene sets used for testing.

Description

This can be instantiated from a "static" or "reactive" GeneSetDb object. It allows users to customize which genesets are active by:

Usage

reactiveGeneSetDb(
  input,
  output,
  session,
  gdb,
  min.gs.size = 2L,
  max.gs.size = Inf,
  default_collections = NULL,
  ...
)

reactiveGeneSetDbUI(id, min = 2, max = 100L, ...)

Arguments

input, output, session

shiny module bits

gdb

A static or reactive GeneSetDb object

min.gs.size, max.gs.size

the default minimum and maximum geneset size set in the UI when 'gdb' is first loaded or changes (when reactive)

default_collections

a character vector of collections that are by default selected for use

...

pass through args

id

shiny module namespace

min, max

ranges for the min/max geneset slider

Details

1. Filtering out entire collections; and 2. Filtering genesets based on min and max (gene) size.

Value

A list of reactive elements wired to the input 'gdb':

gdb

a 'reactive(gdb)'

geneSets

a 'reacvtive(geneSets(gdb))'

min.gs.size,max.gs.size

reactives that indicate current selection of minimum and maximum gene set sizes to be used in 'sparrow::conform(gdb, ...)'

.state

a 'shiny::reactiveList' that contains the state of this module

.ns

the shiny namespace for this module

Functions

  • reactiveGeneSetDbUI: the UI for the module

Examples

sres <- sparrow::exampleSparrowResult()
gdb <- sparrow::geneSetDb(sres)
app <- shiny::shinyApp(
  ui = shiny::shinyUI(shiny::fluidPage(
    exampleUISetup(),
    title = "Configure GeneSetDb",
    reactiveGeneSetDbUI("mod"))),
  server = function(input, output, session) {
    shiny::callModule(reactiveGeneSetDb, "mod", gdb)
  })
if (interactive()) {
  shiny::runApp(app)
}

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