View source: R/geneSetContrastView-module.R
geneSetContrastView | R Documentation |
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)
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 |
feature.link.fn |
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 |
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.
returns a list of reactive elements:
the [geneSetSelect()] module
a character vector of feature_ids currently brushed in the contrast view
A 'tagList' of html stuff to dump into the UI.
geneSetContrastViewUI
: the UI for the module
updateActiveGeneSetInContrastView
: allows you to update the active
geneset in a contrast view module externally.
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)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.