The module is meant to be displayed in "a box" so that the user can examine the coherent (or not) behavior of the geneset across a contrast with respect to the background distribution of all genes in the contrast.

geneSetContrastView(
  input,
  output,
  session,
  src,
  server = TRUE,
  maxOptions = Inf,
  sep = "_::_",
  feature.link.fn = ncbi.entrez.link,
  feature_table_filter = "none",
  itools = c("wheel_zoom", "box_select", "reset", "save")
)

geneSetContrastViewUI(id, height = "590px", width = "400px")

updateActiveGeneSetInContrastView(session, viewer, geneset, src)

Arguments

input

the shiny-required bits for the module

output

the shiny-required bits for the module

session

the shiny session

src

a `SparrowResultContainer`

server

logical indicating wether the options should be generated in the server module, default: `TRUE`

maxOptions

a paremeter used to customize the `GeneSetSelect::selectizeInput` UI element to configure the maximum number of elements to include in the select dropdown, the remainder of the genesets will be loaded from the server side. Default: `Inf` for all.

sep

the string used to concatenate geneset `collection` and `name` to generate a uniqe string for a geneset

a function that takes a name of a column and returns a url linked version of the element that will provide more info for the particular feature

feature_table_filter

filter param for [renderFeatureStatsDataTable()]

itools

the plotly tools to show in the geneset contrast visual

id

the shiny id of the module

height, width

the height and width of the module

viewer

a `geneSetContrastViewModule`

geneset

the key of a geneset to select

Value

returns a list of reactive elements:

gs

the [geneSetSelect()] module

selected

a character vector of feature_ids currently brushed in the contrast view

A `tagList` of html stuff to dump into the UI.

Details

Embedded within this module is the [geneSetSelect()] module, which provides the list of genesets the user can examine, as well as the title of the current geneset under scrutiny.

Below the geneSet picker, we embed an [iplot()] view of the result so the user can observe the behavior of the geneset across the contrast. The user can pick the type of plot to show (density or boxplot) as well as which statistics to use for plotting (logFC or t-statistics).

An `updateActiveGeneSetInContrastView` function is provided to enable interactions external to this module the ability to update the geneset selected in the [geneSetSelect()] module.

Functions

  • geneSetContrastViewUI: the UI for the module

  • updateActiveGeneSetInContrastView: allows you to update the active geneset in a contrast view module externally.

Examples

sres <- sparrow::exampleSparrowResult()
app <- shiny::shinyApp(
  ui = shiny::shinyUI(shiny::fluidPage(
    exampleUISetup(),
    title = "Gene Set Contrast View",
    geneSetContrastViewUI("mod"))),
  server = function(input, output, session) {
    src <- shiny::reactive(SparrowResultContainer(sres))
    shiny::callModule(geneSetContrastView, "mod", src)
  })
if (interactive()) {
  shiny::runApp(app)
}