Seurat (version 2.3.4)

DimPlot: Dimensional reduction plot

Description

Graphs the output of a dimensional reduction technique (PCA by default). Cells are colored by their identity class.

Usage

DimPlot(object, reduction.use = "pca", dim.1 = 1, dim.2 = 2,
  cells.use = NULL, pt.size = 1, do.return = FALSE, do.bare = FALSE,
  cols.use = NULL, group.by = "ident", pt.shape = NULL,
  do.hover = FALSE, data.hover = "ident", do.identify = FALSE,
  do.label = FALSE, label.size = 4, no.legend = FALSE,
  coord.fixed = FALSE, no.axes = FALSE, dark.theme = FALSE,
  plot.order = NULL, cells.highlight = NULL, cols.highlight = "red",
  sizes.highlight = 1, plot.title = NULL, vector.friendly = FALSE,
  png.file = NULL, png.arguments = c(10, 10, 100), na.value = "grey50",
  ...)

Arguments

object

Seurat object

reduction.use

Which dimensionality reduction to use. Default is "pca", can also be "tsne", or "ica", assuming these are precomputed.

dim.1

Dimension for x-axis (default 1)

dim.2

Dimension for y-axis (default 2)

cells.use

Vector of cells to plot (default is all cells)

pt.size

Adjust point size for plotting

do.return

Return a ggplot2 object (default : FALSE)

do.bare

Do only minimal formatting (default : FALSE)

cols.use

Vector of colors, each color corresponds to an identity class. By default, ggplot assigns colors.

group.by

Group (color) cells in different ways (for example, orig.ident)

pt.shape

If NULL, all points are circles (default). You can specify any cell attribute (that can be pulled with FetchData) allowing for both different colors and different shapes on cells.

do.hover

Enable hovering over points to view information

data.hover

Data to add to the hover, pass a character vector of features to add. Defaults to cell name and ident. Pass 'NULL' to clear extra information.

do.identify

Opens a locator session to identify clusters of cells.

do.label

Whether to label the clusters

label.size

Sets size of labels

no.legend

Setting to TRUE will remove the legend

coord.fixed

Use a fixed scale coordinate system (for spatial coordinates). Default is FALSE.

no.axes

Setting to TRUE will remove the axes

dark.theme

Use a dark theme for the plot

plot.order

Specify the order of plotting for the idents. This can be useful for crowded plots if points of interest are being buried. Provide either a full list of valid idents or a subset to be plotted last (on top).

cells.highlight

A list of character or numeric vectors of cells to highlight. If only one group of cells desired, can simply pass a vector instead of a list. If set, colors selected cells to the color(s) in cols.highlight and other cells black (white if dark.theme = TRUE); will also resize to the size(s) passed to sizes.highlight

cols.highlight

A vector of colors to highlight the cells as; will repeat to the length groups in cells.highlight

sizes.highlight

Size of highlighted cells; will repeat to the length groups in cells.highlight

plot.title

Title for plot

vector.friendly

FALSE by default. If TRUE, points are flattened into a PNG, while axes/labels retain full vector resolution. Useful for producing AI-friendly plots with large numbers of cells.

png.file

Used only if vector.friendly is TRUE. Location for temporary PNG file.

png.arguments

Used only if vector.friendly is TRUE. Vector of three elements (PNG width, PNG height, PNG DPI) to be used for temporary PNG. Default is c(10,10,100)

na.value

Color value for NA points when using custom scale.

...

Extra parameters to FeatureLocator for do.identify = TRUE

Value

If do.return==TRUE, returns a ggplot2 object. Otherwise, only graphical output.

See Also

FeatureLocator

Examples

Run this code
# NOT RUN {
DimPlot(object = pbmc_small)

# }

Run the code above in your browser using DataCamp Workspace