geneBrowserTableServer: Shiny Module – gene browser table selection

View source: R/gene_browser.R

geneBrowserTableUIR Documentation

Shiny Module – gene browser table selection

Description

Shiny Module – gene browser table selection

Usage

geneBrowserTableUI(id, cntr_titles)

geneBrowserTableServer(
  id,
  cntr,
  annot,
  annot_linkout = NULL,
  primary_id = "PrimaryID",
  gene_id = NULL,
  cols_to_hide = c("stat", "lfcSE", "symbol", "entrez")
)

Arguments

id

identifier for the namespace of the module

cntr_titles

named character vector for contrast choices

cntr

a list of data frames containing the DE analysis results, or a list of lists of data frames

annot

annotation data frame containing column 'PrimaryID' ( or another specified by the parameter primary_id) corresponding to the rownames of the contrast data frames

annot_linkout

a list; see Details.

primary_id

name of the column which holds the primary identifiers

gene_id

must be either NULL or a reactiveValues object. If not NULL, then a button is displayed; clicking on it will modify the gene_id reactive value (possibly triggering an event in another module).

cols_to_hide

columns in the contrasts data frames to hide in the table. Default is for DESeq2 derived contrasts.

Details

The basic data set structure that this module takes is a named list of data frames. These data frames will be shown in the browser when the specific contrast (corresponding to a name in the list) is selected from the configuration sidebar. The data frames must contain a column called "PrimaryID" (this identifier can be changed with the parameter primary_id). This is necessary in order to link the table rows with e.g. plotting genes with geneBrowserPlotServer.

Log2 fold changes must be stored in a column called "log2FoldChange", and p-values in a column called "padj". These are the default column names returned by DESeq2.

Alternatively, tmodBrowserTableServer takes a list of lists of data frames; that is, it allows to group the results of differential gene analysis.

The linkout feature (parameter annot_linkout) allows to define how the different columns from the annotation data frame are represented as linkouts to external data bases.

The parameter annot_linkout is a named list. Names must correspond to columns from the annotation data frame. The elements of the list are character strings containing URLs with the ⁠%s⁠ placeholder. For example, if the column ENSEMBL contains ENSEMBL identifiers, you can link out by specifying

annot_linkout=list(ENSEMBL="https://www.ensembl.org/id/%s")

Value

geneBrowserTableServer returns NULL. geneBrowserTableUI returns the interface.

Examples

if(interactive()) {
  data(C19)
  ui <- fluidPage(
           geneBrowserTableUI("gb", names(C19$contrasts))
        )

  server <- function(input, output) {
    geneBrowserTableServer("gb", cntr=C19$contrasts,
                                 annot=C19$annotation)
  }

  shinyApp(ui, server)
}

bihealth/bioshmods documentation built on July 1, 2023, 4:32 a.m.