plotMarkerHeatmap: Plot a heatmap of the markers for a label

View source: R/plotMarkerHeatmap.R

plotMarkerHeatmapR Documentation

Plot a heatmap of the markers for a label

Description

Create a heatmap of the log-normalized expression for the most interesting markers of a particular label.

Usage

plotMarkerHeatmap(
  results,
  test,
  label,
  other.labels = NULL,
  assay.type = "logcounts",
  display.row.names = NULL,
  use.pruned = FALSE,
  order.by = "rank.logFC.cohen",
  top = 20,
  BPPARAM = SerialParam()
)

Arguments

results

A DataFrame containing the output from SingleR, classifySingleR, combineCommonResults, or combineRecomputedResults.

test

A numeric matrix of log-normalized expression values where rows are genes and columns are cells. Each row should be named with the same gene name that was used to compute results.

Alternatively, a SummarizedExperiment object containing such a matrix.

label

String specifying the label of interest.

other.labels

Character vector specifying the other labels to be compared to label when finding interesting markers. Defaults to all available labels.

assay.type

Integer scalar or string specifying the matrix of expression values to use if test is a SummarizedExperiment.

display.row.names

Character vector of length equal to the number of rows of test, containing the names of the features to show on the heatmap (e.g., to replace IDs with symbols). If NULL, the existing row names of test are used.

use.pruned

Logical scalar indicating whether the pruned labels should be used instead.

order.by

String specifying the column of the output of scoreMarkers with which to sort for interesting markers.

top

Integer scalar indicating the top most interesting markers to show in the heatmap.

BPPARAM

A BiocParallelParam object specifying the parallelization scheme to use for marker scoring.

Details

This function creates a heatmap where each row is a marker gene for label and each column is a cell in the test dataset. The aim is to check the effectiveness of the reference-derived markers for distinguishing between labels in the test dataset. Useful markers from the reference should show strong upregulation in label compared to all other.labels. We identify such markers by scoring all reference-derived markers with scoreMarkers on the test expression. The top markers based on the specified order.by field are shown in the heatmap. If only one label is present, markers are ranked by average abundance intead.

Value

The output of pheatmap is returned showing the heatmap on the current graphics device.

Author(s)

Aaron Lun

Examples

# Running the SingleR() example.
example(SingleR, echo=FALSE)

plotMarkerHeatmap(pred, test, pred$labels[1])
plotMarkerHeatmap(pred, test, pred$labels[1], use.pruned=TRUE)
plotMarkerHeatmap(pred, test, pred$labels[1], order.by="rank.AUC")


LTLA/SingleR documentation built on Nov. 2, 2024, 10:38 a.m.