plot_density | R Documentation |
Create a density plot of expression values for the given expression matrix.
plot_density(x, ...)
## Default S3 method:
plot_density(x)
## S3 method for class 'matrix'
plot_density(x, metadata = NULL, colBy = NULL, ...)
## S3 method for class 'data.frame'
plot_density(x, metadata = NULL, colBy = NULL, ...)
## S3 method for class 'SummarizedExperiment'
plot_density(x, assay = "counts", colBy = NULL, ...)
x |
gene by sample matrix or |
... |
Additional parameters passed to |
metadata |
data.frame containing metadata per sample. rownames of metadata must match the colnames of the input matrix. Default NULL, each sample in the matrix will be plotted. |
colBy |
metadata column used to color density lines. Default NULL, each sample in the matrix will be plotted. |
assay |
assay of the SummarizedExperiment object. Default "counts" |
ggplot object
# Create metadata for plotting
metadata <- data.frame(row.names = colnames(GSE161650_lc))
metadata$Group <- rep(c("DMSO", "THZ1"), each = 3)
# Plot the density by sample
plot_density(GSE161650_lc)
# Color each sample by their Group in metadata
plot_density(GSE161650_lc, metadata, colBy = "Group")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.