plot_embedding: Plot low-dimensional cell embedding

View source: R/plot_embedding.R

plot_embeddingR Documentation

Plot low-dimensional cell embedding

Description

This function creates a plot of a cell embedding stored in a Seurat object. Cells can be colored by gene expression or metadata.

Usage

plot_embedding(
  object = NULL,
  color = "",
  split.by = NULL,
  label = FALSE,
  embedding = tail(names(object@reductions), 1),
  ann_colors = NULL,
  pt.aggr = TRUE,
  pt.aggr.breaks = 300,
  pt.size = 1,
  pt.stroke = 0.1,
  dim.1 = 1,
  dim.2 = 2,
  brush = NULL,
  cells = NULL,
  n.cells = NULL,
  assay = Seurat::DefaultAssay(object),
  slot = "data",
  theme.size = 15,
  label.size = 6,
  split.by.rows = NULL,
  split.by.max = 20,
  dict = object@misc$features,
  from = 1,
  to = 2,
  alpha = 1,
  shape = 20,
  color.transform = "",
  pl.title = NULL,
  legend.position = "right",
  legend.cols = NULL
)

Arguments

object

Seurat object

color

Gene or metadata to color cells

split.by

Metadata to split plot by

label

Type of group labels (text or label)

embedding

Name of the embedding (e.g. 'umap')

ann_colors

Named vector of annotation colors

pt.aggr

Whether to summarize overlapping points

pt.aggr.breaks

Number of breaks to summarize overlapping points. Less breaks result in a coarser image, summarizing more points.

pt.size

Point size

dim.1

Matrix column to use for x-axis

dim.2

Matrix column to use for y-axis

brush

Brushed points (xmin, xmax, ymin, ymax)

cells

Character of cell barcodes to plot

n.cells

Number of cells to plot (randomly sampled)

assay

Assay with expression data (e.g. RNA)

slot

Slot of expression data (counts, data, scale.data)

dict

Dictionary for the convert_features function

from

From argument for convert_features

to

To argument for convert_features

alpha

Transparency of points (0-1)

color.transform

Transformation of values used for color. Options include log, log2, log1p, log10

legend.position

Position of the color legend.


OliverDietrich/SeuratHelper documentation built on Jan. 20, 2024, 2:57 a.m.