featurePlot: Plot spatial gene expression.

View source: R/spatialPlot.R

featurePlotR Documentation

Plot spatial gene expression.

Description

Plot spatial gene expression.

Usage

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

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().

nsubspots.per.edge

Number of subspots per edge of the square. Only valid when platform is 'ST' or 'VisiumHD'.

...

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")


edward130603/BayesSpace documentation built on Oct. 23, 2024, 7:04 a.m.