R/AllGenerics.R, R/plotHeatmap.R
plotDissimilarity.RdPlots a sample dissimilarity matrix, stored in metadata(x), as a
heatmap. Samples are ordered by hierarchical clustering so that similar
samples are next to each other.
plotDissimilarity(x, ...)
# S4 method for class 'SummarizedExperiment'
plotDissimilarity(x, name, col.var = NULL, ...)Additional arguments passed to the facetting, for example
scales and space (both default "free").
Character scalar. Name of the dissimilarity matrix in
metadata(x). The matrix must be a dist object, as returned by
addDissimilarity, with one row per
sample of x.
NULL or character vector. Variables from
colData(x) used for facetting. Because both axes are samples, the
same variables split both the rows and the columns.
(Default: NULL)
A ggplot2 object.
data(GlobalPatterns)
tse <- GlobalPatterns
tse <- transformAssay(tse, method = "relabundance")
# Calculate Bray-Curtis dissimilarity and store it in metadata
tse <- addDissimilarity(tse, method = "bray", assay.type = "relabundance")
plotDissimilarity(tse, "bray")
# Split rows and columns by sample type
plotDissimilarity(tse, "bray", col.var = "SampleType")