View source: R/plotDensities.R
plotDensities | R Documentation |
Plot densities
plotDensities(
x,
cepoOutput,
nGenes = 2,
assay = "logcounts",
celltypeColumn,
celltype = NULL,
genes = NULL,
plotType = c("histogram", "density"),
color = NULL
)
x |
a |
cepoOutput |
an output from Cepo or doLimma/doVoom/doTtest/doWilcoxon functions |
nGenes |
number of top genes from each celltype to plot. Default to 2. |
assay |
a character ('logcounts' by default), indicating the name of the assays(x) element which stores the expression data (i.e., assays(x)$name_assays_expression). We strongly encourage using normalized data, such as counts per million (CPM) or log-CPM. |
celltypeColumn |
a character, indicating the name of the name of the cell type column in the colData(x). |
celltype |
a character, indicating the name of the cell type to plot. Default is NULL which selects all celltypes in the cepoOutput. |
genes |
a character vector, indicating the name of the genes to plot. Default to NULL, so that 2 top genes from each celltype will be plotted. |
plotType |
Either 'histogram' or 'density' |
color |
a named color vector. The names should correspond to the |
A ggplot
object
with cell-type specific densities for a gene.
A ggplot
object.
library(SingleCellExperiment)
data('cellbench', package = 'Cepo')
cellbench
cepoOutput <- Cepo(logcounts(cellbench), cellbench$celltype)
plotDensities(
x = cellbench,
cepoOutput = cepoOutput,
assay = 'logcounts',
plotType = 'histogram',
celltypeColumn = 'celltype'
)
plotDensities(
x = cellbench,
cepoOutput = cepoOutput,
genes = c('PLTP', 'CPT1C', 'MEG3', 'SYCE1', 'MICOS10P3', 'HOXB7'),
assay = 'logcounts',
plotType = 'histogram',
celltypeColumn = 'celltype'
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.