plotDR: Plot reduced dimensions

View source: R/plotDR.R

plotDRR Documentation

Plot reduced dimensions

Description

Dimension reduction plot colored by expression values or column metadata. To avoid plotting too many dots as a vector graphic, geom_point_rast from ggrastr is used to internally replace the geom_point layer.

Usage

plotDR(
  sce,
  sce_bg = NULL,
  dimred = "UMAP",
  colour_by = "condition",
  text_by = NULL,
  facet_by = NULL,
  point_shape = 19,
  point_size = 0.5,
  point_alpha = 1,
  rasterize = T,
  ...
)

Arguments

sce

A SingleCellExperiment object.

sce_bg

An optional SingleCellExperiment object for background data. If provided, the data would be depicted in a light grey in a layer behind the main plot.

dimred

A character string specifying which dimension reduction to use. Should be one of reducedDimNames(sce).

colour_by

A character string corresponding to a colData(sce) column. Specifies the color coding. If factor, a discrete color scale will be used. Otherwise, a cividis color scale will be applied by default.

text_by

A character string corresponding to a colData(sce) column. Specifies the text coding.

facet_by

A character string corresponding to a colData(sce) column. Specifies the faceting. Note: Users must provide a separate faceting command such as lemon::facet_rep_grid. Faceting does not occur internally.

point_shape, point_size, point_alpha

Parameters for the plot. Note: setting the shape to "." allows users to nicely plot a large number of dots.

rasterize

Logical. Whether the plot needs to be rasterized using ggrastr.

...

Additional arguments passed to plotReducedDim in scater.

Value

A ggplot object.


casanova-lab/iMUBAC documentation built on Sept. 13, 2022, 6:36 p.m.