plotMarkerHeatmap: Create heatmap for showing top marker expression in...

View source: R/DEG_marker.R

plotMarkerHeatmapR Documentation

Create heatmap for showing top marker expression in conditions

Description

Create heatmap for showing top marker expression in conditions

Usage

plotMarkerHeatmap(
  object,
  result,
  topN = 5,
  lfcThresh = 1,
  padjThresh = 0.05,
  pctInThresh = 50,
  pctOutThresh = 50,
  dedupBy = c("logFC", "padj"),
  groupBy = NULL,
  groupSize = 50,
  column_title = NULL,
  ...
)

Arguments

object

A liger object, with normalized data and metadata to annotate available.

result

The data.frame returned by runMarkerDEG.

topN

Number of top features to be plot for each group. Default 5.

lfcThresh

Hard threshold on logFC value. Default 1.

padjThresh

Hard threshold on adjusted P-value. Default 0.05.

pctInThresh, pctOutThresh

Threshold on expression percentage. These mean that a feature will only pass the filter if it is expressed in more than pctInThresh percent of cells in the corresponding cluster. Similarly for pctOutThresh. Only applied when these metrics are available. Default 50 percent for both.

dedupBy

When ranking by padj and logFC and a feature is ranked as top for multiple clusters, assign this feature as the marker of a cluster when it has the largest "logFC" in the cluster or has the lowest "padj". Default "logFC".

groupBy

Cell metadata variable names for cell grouping. Downsample balancing will also be aware of this. Default "dataset" and the default cluster.

groupSize

Maximum number of cells in each group to be downsampled for plotting. Default 50.

column_title

Title on the column. Default NULL.

...

Arguments passed on to plotGeneHeatmap, .plotHeatmap

cellAnnotation

data.frame object for using external annotation, with each column a variable and each row is a cell. Row names of this data.frame will be used for matching cells involved in heatmap. For cells not found in this data.frame, NAs will be added with warning. Default NULL.

transpose

Logical, whether to "rotate" the heatmap by 90 degrees so that cell information is displayed by row. Default FALSE.

showCellLabel,showFeatureLabel

Logical, whether to show cell barcodes, gene symbols or factor names. Default TRUE for gene/factors but FALSE for cells.

cellAnnColList,featureAnnColList

List object, with each element a named vector of R-interpretable color code. The names of the list elements are used for matching the annotation variable names. The names of the colors in the vectors are used for matching the levels of a variable (factor object, categorical). Default NULL generates ggplot-flavor categorical colors.

scale

Logical, whether to take z-score to scale and center gene expression. Applied after dataScaleFunc. Default FALSE.

trim

Numeric vector of two values. Limit the z-score value into this range when scale = TRUE. Default c(-2, 2).

baseSize

One-parameter control of all text sizes. Individual text element sizes can be controlled by other size arguments. "Title" sizes are 2 points larger than "text" sizes when being controlled by this.

cellTextSize,featureTextSize,legendTextSize

Size of cell barcode labels, gene/factor labels, or legend values. Default NULL.

cellTitleSize,featureTitleSize,legendTitleSize

Size of titles of the cell slices, gene/factor slices, or the legends. Default NULL.

viridisOption,viridisDirection

See argument option and direction of viridis. Default "A" and -1.

RColorBrewerOption

When scale = TRUE, heatmap color will be mapped with brewer.pal. This is passed to name. Default "RdBu".

Value

A HeatmapList-class object.

Examples

defaultCluster(pbmc) <- pbmcPlot$leiden_cluster
pbmc <- normalize(pbmc)
plotMarkerHeatmap(pbmc, deg.marker)

rliger documentation built on Oct. 30, 2024, 1:07 a.m.