plot_gene_exprs: Plot gene expression in cells

Description Usage Arguments Value Examples

Description

plot_gene_exprs() plots levels of expression of a specified gene or genes as a color gradient. A two-dimensional dimensionality reduction object with coordinates for each cell (e.g. by t-SNE or UMAP dimensionality reduction) is required.

Usage

1
2
3
plot_gene_exprs(cds, genes, dim_reduction, color_scale = c("slategray1",
  "red"), limits = c(0, 10), rescale = F, cell_size = 0.1,
  group_vector = NULL, group_facet = NULL, title = NULL)

Arguments

cds

a CellDataSet object or equivalent

genes

a vector of gene name(s) to plot

dim_reduction

a dataframe specifying the coordinates of a dimensionality reduction output (e.g. t-SNE, UMAP etc.). Each column should specify one dimension.

color_scale

a vector of two colors for color gradient

limits

a vector containing two number specifying the lower and upper limits of the color scale respectively.

rescale

logical; whether to rescale color scale as a continuous gradient from the minimum to the maximum value of expression for specified gene; defaults to FALSE

cell_size,

the size of the point representing each cell

group_vector

a vector classifying cells e.g. genotype or condition

group_facet

input for facet_grid() argument. A group vector must be supplied

title

title of plot

Value

A ggplot2 object

Examples

1
2
3
plot_gene_exprs(myCDS, genes=c("Acta2","Myl9"), dim_reduction=tsne_proj[,c("TSNE.1", "TSNE.2")],
color_scale=c("blue","red"), limits = c(0,5), rescale= TRUE, cell_size =0.1, group_vector=pData(dat)$genotype,
group_facet="group~variable", title=NULL )

jacobheng/cellwrangler documentation built on Aug. 12, 2019, 6:49 a.m.