matrixAppServer: Shiny app server for exploration of relationships in...

View source: R/matrixApp.R

matrixAppServerR Documentation

Shiny app server for exploration of relationships in annotated data with an interactive matrix

Description

See matrixCtrlUI

Usage

matrixAppServer(
  id,
  M,
  N,
  P,
  cdata,
  metadata,
  vkey,
  factorx,
  colorby,
  colorscales = list(default = list(colorscale_named(pal = "RdBu"), zmin = -1, zmax =
    1)),
  informd = system.file("info/interactive_matrix.Rmd", package = "DIVE"),
  appdata = NULL
)

Arguments

id

Character ID for specifying namespace, see shiny::NS.

M

A data matrix, e.g. a correlation matrix, which must have row and column names.

N

A matrix of the same dimensions as 'M' to be used as a filter layer, e.g. sample size.

P

A matrix of the same dimensions as 'M' to be used as a filter layer, e.g. p-values.

cdata

The data used for generating the matrix, necessary for allowing user-uploaded data for mutable 'M'.

metadata

Optional, a 'data.table' with different types of metadata/annotation to be used as filters. If not given, the only filter option will be the row names in M. Column names will be the names of the filter group.

vkey

The column in metadata that maps to row/col names in M, i.e. the key column such as VarID. If metadata is not given, should be something like "Name" because the only selection possible is by row names.

factorx

Optional, a function that returns a boolean for whether a variable should be plotted as factor when given the variable name. Useful when for some reason factor variables are numeric or character instead of already factor-encoded. By default, variables are merely checked using base::is.factor, which works when the data is already factor-encoded.

colorby

A named list where name matches the (factor) variable in cdata to use for color grouping. If there is a named vector, this is passed into scale_color_manual to be used for custom color mapping, e.g. 'list(MyGroupingVar = c(A = "red", B = "blue"))' (useful for enforcing a consistent/meaningful color scheme), or use ‘list(MyGroupingVar = NULL)' if custom color scaling isn’t necessary. See also details.

colorscales

Optional, a list of custom colorscale functions that takes a numeric matrix and returns either a named colorscale or custom colorscale used for heatmap. If not given, two default colorscale functions are used.

informd

Relative path to the Rmarkdown file, whose contents will be displayed in the modal.

appdata

Optional, the path of one or more files that can be mock-uploaded. See details.


avucoh/DIVE documentation built on Aug. 29, 2023, 6:02 p.m.