Draws violin plot of single cell data, stratified by specified group. Hierarchically-clustered dendrogram is overlaid to illustrate relationships between groups.

expression.Plot(
  so,
  which.gene,
  e.mat = NULL,
  f.mat = NULL,
  which.group = "seurat_clusters",
  which.data = "data",
  which.assay = DefaultAssay(so),
  x.label = NULL,
  x.label.angle = NULL,
  show.violin = T,
  show.full.axis = T,
  font.size = NULL,
  verbose = T
)

Arguments

so

Seurat object

which.gene

query gene. Must be available in Seurat object.

e.mat

expression matrix (gene x cell). If not provided, computed from seurat object (more computationally heavy).

f.mat

expression fraction matrix (gene x cell). If not provided, computed from seurat object (more computationally heavy).

which.group

Group to cluster gene expression by. Must be column header in so meta data. Default is "seurat_clusters".

which.data

Specifies which seurat data used to compute e.mat and f.mat. Must be either "data" (default) or "scale". Used only if e.mat and f.mat are not provided.

which.assay

Specifies which seurat assay to used to compute e.mat. Used only if e.mat is not provided. Default is DefaultAssay(so)

x.label

x axis title (a character). Default is which.group.

x.label.angle

rotation angle for x axis title (a numeric). Default is NULL.

show.violin

Show expression as violin plot. Default is T.

show.full.axis

Show full normalized axis [0,1], rather than adapting to data. Default is T.

font.size

Size of font.

verbose

print progress. Default is T.

Value

ggplot object

Examples


# get expression plot of GPNMB stratified by cluster group.
plt.sgExp.clust <- expression.Plot.dev(so.query, which.gene = "GPNMB", which.group = "seurat_clusters", which.data = "data")
#> Error in expression.Plot.dev(so.query, which.gene = "GPNMB", which.group = "seurat_clusters",     which.data = "data"): could not find function "expression.Plot.dev"
print(plt.sgExp.clust)
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'print': object 'plt.sgExp.clust' not found