Skip to contents

Plots a heatmap of cell neighborhoods

Usage

neighborhoodHeatmap(
  object,
  nn,
  feature,
  col.name = NULL,
  subsample = 0,
  summarize = FALSE,
  summary.fun = "mean",
  scaling = "none",
  cuts = c(0.01, 0.99),
  bottom_pad = 0.2,
  left_pad = 0.2,
  top_pad = 0.2,
  right_pad = 0.2,
  pad_units = "cm",
  ...
)

Arguments

object

A SpatialMap object

nn

A NN graph name

feature

The name of the cellMetadata feature (e.g. cell type) used for defining neighborhoods.

col.name

If a custom col.name was specified when running neighborhoodClusters, you'll need to specify it again here. Default (NULL) is to look for the default value from neighborhoodClusters.

subsample

The heatmap can get very large with large numbers of cells. This is an integer; the matrix will be randomely subsampled to contain this many points.

summarize

Whether to summarize feature counts per neighborhood, rather than explicitly plotting every cell (or, if using subsampling, a subset of cells)

summary.fun

The function used to summarize counts for visualization. Ignored if summarize = FALSE

scaling

Character describing the style of scaling to employ

cuts

Quantile values to cut. If NULL, trim will not happen.

bottom_pad

Padding to add to bottom of plot. Useful if text is getting cut off.

left_pad

Padding to add to left side of plot. Useful if text is getting cut off.

top_pad

Padding to add to top of plot. Useful if text is getting cut off.

right_pad

Padding to add to right side of plot. Useful if text is getting cut off.

pad_units

What units of measurement should the padding values be interpreted as? See ?grid::unit for a list of allowed values.

...

Arguments passed to ComplexHeatmap Heatmap()

Value

A ComplexHeatmap object

Details

See vignette("AnalysisGuide6_Neighborhoods") for a representative workflow that uses this function.

Scroll to top