Learn R Programming

Seurat (version 2.1.0)

SplitDotPlotGG: Split Dot plot visualization

Description

Intuitive way of visualizing how gene expression changes across different identity classes (clusters). The size of the dot encodes the percentage of cells within a class, while the color encodes the AverageExpression level of 'expressing' cells (green is high). Splits the cells into two groups based on a grouping variable. Still in BETA

Usage

SplitDotPlotGG(object, grouping.var, genes.plot, gene.groups,
  cols.use = c("green", "red"), col.min = -2.5, col.max = 2.5,
  dot.min = 0, dot.scale = 6, group.by, plot.legend = FALSE,
  do.return = FALSE, x.lab.rot = FALSE)

Arguments

object

Seurat object

grouping.var

Grouping variable for splitting the dataset

genes.plot

Input vector of genes

gene.groups

Add labeling bars to the top of the plot

cols.use

colors to plot

col.min

Minimum scaled average expression threshold (everything smaller will be set to this)

col.max

Maximum scaled average expression threshold (everything larger will be set to this)

dot.min

The fraction of cells at which to draw the smallest dot (default is 0.05).

dot.scale

Scale the size of the points, similar to cex

group.by

Factor to group the cells by

plot.legend

plots the legends

do.return

Return ggplot2 object

x.lab.rot

Rotate x-axis labels

Value

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

Examples

Run this code
# NOT RUN {
# Create a simulated grouping variable
pbmc_small@meta.data$groups <- sample(
  x = c("g1", "g2"),
  size = length(x = pbmc_small@cell.names),
  replace = TRUE
)
SplitDotPlotGG(pbmc_small, grouping.var = "groups", genes.plot = pbmc_small@var.genes[1:5])

# }

Run the code above in your browser using DataLab