Plot feature

plotFeature(object, ...)

# S4 method for SingleCellExperiment
plotFeature(object, features,
  reducedDim = "TSNE", color = getOption("acid.continuous.color",
  default = ggplot2::scale_colour_gradient(low = "gray75", high =
  "purple")), pointSize = getOption("acid.pointSize", default = 0.75),
  pointAlpha = getOption("acid.pointAlpha", default = 0.85),
  pointsAsNumbers = getOption("acid.pointsAsNumbers", default = FALSE),
  label = getOption("acid.label", default = TRUE),
  labelSize = getOption("acid.labelSize", default = 6L),
  dark = getOption("acid.dark", default = FALSE),
  legend = getOption("acid.legend", default = TRUE),
  expression = c("mean", "sum"))

# S4 method for Seurat
plotFeature(object, features, reducedDim = "TSNE",
  color = getOption("acid.continuous.color", default =
  ggplot2::scale_colour_gradient(low = "gray75", high = "purple")),
  pointSize = getOption("acid.pointSize", default = 0.75),
  pointAlpha = getOption("acid.pointAlpha", default = 0.85),
  pointsAsNumbers = getOption("acid.pointsAsNumbers", default = FALSE),
  label = getOption("acid.label", default = TRUE),
  labelSize = getOption("acid.labelSize", default = 6L),
  dark = getOption("acid.dark", default = FALSE),
  legend = getOption("acid.legend", default = TRUE),
  expression = c("mean", "sum"))

Arguments

object

Object.

features

character. Features to plot (e.g. gene expression, PC scores, number of genes detected).

reducedDim

character(1). Name of reduced dimension matrix slotted in reducedDims(). Includes TNSE, UMAP, PCA, for example.

color

ScaleDiscrete. Desired ggplot2 color scale. Must supply discrete values. When set NULL, the default ggplot2 color palette will be used. If manual color definitions are desired, we recommend using ggplot2::scale_color_manual().

To set the discrete color palette globally, use:

options(acid.color.discrete = ggplot2::scale_color_viridis_d())
pointSize

numeric(1). Point size for dots in the plot.

pointAlpha

numeric(1) (0-1). Alpha transparency level. Useful when there many points in the dataset (e.g. single-cell data), and some points can be masked.

pointsAsNumbers

logical(1). Plot the points as numbers (TRUE) or dots (FALSE).

label

logical(1). Superimpose sample text labels on the plot.

labelSize

integer(1). Size of the text label.

dark

logical(1). Plot against a dark background using the theme_midnight() ggplot2 theme.

legend

logical(1). Show plot legend.

expression

character(1). Calculation to apply. Uses match.arg() internally and defaults to the first argument in the character vector.

...

Additional arguments.

Value

ggplot (1 feature) or list (multiple features).

See also

Examples

data(seurat) plotFeature(seurat, features = c("nCount_RNA", "nFeature_RNA"))