R/plotAssayDensities.R
plotAssayDensities-methods.Rd
Plot Densities for any assay within a SummarizedExperiment
plotAssayDensities(x, ...)
# S4 method for class 'SummarizedExperiment'
plotAssayDensities(
x,
assay = "counts",
colour,
linetype,
group,
trans = NULL,
n_max = Inf,
...
)
A SummarizedExperiment object
Passed to density
An assay within x
Optional column in colData to colour lines by. To remove any
colours, set this argument to NULL
Any optional column in colData used to determine linetype
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
character(1). Any transformative function to be applied to the
data before calculating the density, e.g. trans = "log2"
Maximum number of points to use when calculating densities
A ggplot2
object. Scales and labels can be added using conventional
ggplot2
syntax.
Uses ggplot2 to create a density plot for all samples within the selected assay
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")