View source: R/plot_functions.R
expression.Plot | R Documentation |
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
)
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. |
ggplot object
# 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")
print(plt.sgExp.clust)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.