geneBrowserTableUI | R Documentation |
Shiny Module – gene browser table selection
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")
)
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 |
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 |
cols_to_hide |
columns in the contrasts data frames to hide in the table. Default is for DESeq2 derived contrasts. |
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")
geneBrowserTableServer
returns NULL. geneBrowserTableUI
returns the interface.
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)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.