Plot spatial gene expression.

featurePlot(
  sce,
  feature,
  assay.type = "logcounts",
  diverging = FALSE,
  low = NULL,
  high = NULL,
  mid = NULL,
  color = NULL,
  platform = NULL,
  is.enhanced = NULL,
  ...
)

Arguments

sce

SingleCellExperiment. If feature is specified and is a string, it must exist as a row in the specified assay of sce.

feature

Feature vector used to color each spot. May be the name of a gene/row in an assay of sce, or a vector of continuous values.

assay.type

String indicating which assay in sce the expression vector should be taken from.

diverging

If true, use a diverging color gradient in featurePlot() (e.g. when plotting a fold change) instead of a sequential gradient (e.g. when plotting expression).

low, mid, high

Optional hex codes for low, mid, and high values of the color gradient used for continuous spot values.

color

Optional hex code to set color of borders around spots. Set to NA to remove borders.

platform

Spatial sequencing platform. If "Visium", the hex spot layout will be used, otherwise square spots will be plotted.
NOTE: specifying this argument is only necessary if sce was not created by spatialCluster() or spatialEnhance().

is.enhanced

True if sce contains subspot-level data instead of spots. Spatial sequencing platform. If true, the respective subspot lattice for each platform will be plotted.
NOTE: specifying this argument is only necessary if sce was not created by spatialCluster() or spatialEnhance().

...

Additional arguments for geom_polygon(). size, to specify the linewidth of these borders, is likely the most useful.

Value

Returns a ggplot object.

See also

Other spatial plotting functions: clusterPlot()

Examples

sce <- exampleSCE() featurePlot(sce, "gene_2")