plotAssayDensities | R Documentation |
Plot Densities for any assay within a SummarizedExperiment
plotAssayDensities(x, ...)
## S4 method for signature 'SummarizedExperiment'
plotAssayDensities(
x,
assay = "counts",
colour,
linetype,
group,
trans = NULL,
n_max = Inf,
...
)
x |
A SummarizedExperiment object |
... |
Passed to density |
assay |
An assay within x |
colour |
Optional column in colData to colour lines by. To remove any
colours, set this argument to |
linetype |
Any optional column in colData used to determine linetype |
group |
Used by geom_line. Defaults to the sample names but setting to NULL will over-write this and only groups specified by colour or linetype will be drawn |
trans |
character(1). Any transformative function to be applied to the
data before calculating the density, e.g. |
n_max |
Maximum number of points to use when calculating densities |
Uses ggplot2 to create a density plot for all samples within the selected assay
A ggplot2
object. Scales and labels can be added using conventional
ggplot2
syntax.
data("se")
se$treatment <- c("E2", "E2", "E2", "E2DHT", "E2DHT", "E2DHT")
## Plot individual samples
plotAssayDensities(se, colour = "treatment")
## Plot combined within treatment groups
plotAssayDensities(se, colour = "treatment", group = "treatment")
## Use a data transformation
plotAssayDensities(se, trans = "log1p", colour = "treat")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.