plotMarkerDiffExp: Plot a heatmap to visualize the result of 'findMarkerDiffExp'

Description Usage Arguments Value Author(s)

View source: R/plotMarkerDiffExp.R

Description

This function will first reads the result saved in metadata slot, named by "findMarker" and generated by findMarkerDiffExp. Then it do the filtering on the statistics based on the input parameters and get unique genes to plot. We choose the genes that are identified as up-regulated only. As for the genes identified as up-regulated for multiple clusters, we only keep the belonging towards the one they have the highest Log2FC value. In the heatmap, there will always be a cell annotation for the cluster labeling used when finding the markers, and a feature annotation for which cluster each gene belongs to. And by default we split the heatmap by these two annotations. Additional legends can be added and the splitting can be canceled.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
plotMarkerDiffExp(
  inSCE,
  useAssay = "logcounts",
  orderBy = "size",
  log2fcThreshold = 1,
  fdrThreshold = 0.05,
  topN = 10,
  decreasing = TRUE,
  rowDataName = NULL,
  colDataName = NULL,
  featureAnnotations = NULL,
  cellAnnotations = NULL,
  featureAnnotationColor = NULL,
  cellAnnotationColor = NULL,
  colSplitBy = ifelse(is.null(orderBy), NULL, colnames(inSCE@metadata$findMarker)[5]),
  rowSplitBy = "marker",
  ...
)

Arguments

inSCE

SingleCellExperiment inherited object.

useAssay

character. A string specifying which assay to use for the expression values. Default "logcounts".

orderBy

The ordering method of the clusters on the splitted heatmap. Can be chosen from "size" or "name", specified with vector of ordered unique cluster labels, or set as NULL for unsplitted heatmap. Default "size".

log2fcThreshold

Only use DEGs with the absolute values of log2FC larger than this value. Default 1

fdrThreshold

Only use DEGs with FDR value smaller than this value. Default 0.05

topN

An integer. Only to plot this number of top markers for each cluster in maximum, in terms of log2FC value. Use NULL to cancel the top N subscription. Default 10.

decreasing

Order the cluster decreasingly. Default TRUE.

rowDataName

character. The column name(s) in rowData that need to be added to the annotation. Default NULL.

colDataName

character. The column name(s) in colData that need to be added to the annotation. Default NULL.

featureAnnotations

data.frame, with rownames containing all the features going to be plotted. Character columns should be factors. Default NULL.

cellAnnotations

data.frame, with rownames containing all the cells going to be plotted. Character columns should be factors. Default NULL.

featureAnnotationColor

A named list. Customized color settings for feature labeling. Should match the entries in the featureAnnotations or rowDataName. For each entry, there should be a list/vector of colors named with categories. Default NULL.

cellAnnotationColor

A named list. Customized color settings for cell labeling. Should match the entries in the cellAnnotations or colDataName. For each entry, there should be a list/vector of colors named with categories. Default NULL.

colSplitBy

character vector. Do semi-heatmap based on the grouping of this(these) annotation(s). Should exist in either colDataName or names(cellAnnotations). Default is the value of cluster in findMarkerDiffExp when orderBy is not NULL, or NULL otherwise.

rowSplitBy

character vector. Do semi-heatmap based on the grouping of this(these) annotation(s). Should exist in either rowDataName or names(featureAnnotations). Default "marker", which indicates an auto generated annotation for this plot.

...

Other arguments passed to plotSCEHeatmap.

Value

A Heatmap object

Author(s)

Yichen Wang


singleCellTK documentation built on Nov. 8, 2020, 5:21 p.m.