Description Usage Arguments Details Value Note Author(s) References See Also Examples
Produces a heatmap visualizing all samples and variables of a dataset. Both samples and variables are clustered using methods suitable for mixed-type data. Different types of variables are indicated by different color schemes.
1 2 3 4 5 6 7 8 9 10 | mix.heatmap(data, D.subjects, D.variables, dend.subjects, dend.variables, varweights,
dist.variables.method = c("associationMeasures", "distcor", "ClustOfVar"),
linkage="ward.D2", associationFun = association, rowlab, rowmar = 3, lab.cex = 1.5,
ColSideColors, RowSideColors,
col.cont = marray::maPalette(low = "lightblue", high = "darkblue", k = 50),
cont.fixed.range = FALSE, cont.range,
col.ord = list(low = "lightgreen", high = "darkgreen"),
col.cat = c("indianred1","darkred","orangered","orange","palevioletred1",
"violetred4","red3","indianred4"),
legend.colbar, legend.rowbar, legend.mat = FALSE, legend.cex = 1, legend.srt = 0)
|
data |
data frame where columns are variables (of different data types) and rows are observations (subjects, samples) |
D.subjects |
A previously calculated distance matrix (class |
D.variables |
A previously calculated distance matrix (of class |
dend.subjects |
A |
dend.variables |
A |
varweights |
optional vector of variable weights, used for calculating Gower's distances between subjects |
dist.variables.method |
If |
linkage |
agglomeration method used for hierarchical clustering; corresponds to parameter |
associationFun |
By default, appropriate association measures are chosen for each pair of variables, see |
rowlab |
row (variable) labels; if missing, column names of |
rowmar |
margin for row (variable) labels |
lab.cex |
size of row (variable) labels |
ColSideColors |
vector of length |
RowSideColors |
vector of length |
col.cont |
color palette for continuous variables; defaults to red-blue color palette |
cont.fixed.range |
If |
cont.range |
if |
col.ord |
List with names of colors for the lowest and highest categories of ordinal variables. A color palette will be created correspondingly based on the number of categories. Defaults to a green color palette |
col.cat |
vector of colors for categorical variables |
legend.colbar |
class labels for subject groups defined by |
legend.rowbar |
class labels for variable groups defined by |
legend.mat |
shall legend matrix for heatmap be shown? |
legend.cex |
size of legend text |
legend.srt |
legend matrix label string rotation in degrees; i.e. |
If no dendrograms or distance matrices are given, subjects and/or samples are clustered with methods for mixed-type data. Similarities between subjects are measured by Gower's general similarity coefficient with an extension of Podani for ordinal variables, see gowdis
. Similarities between variables can be assessed by combination of appropriate measures of association for different pairs of data types, see association
, or based on distance correlation. Then standard hierarchical clustering with by default Ward's minimum variance method is applied. Alternatively, variables can also be clustered by the ClustOfVar
approach.
Variables are shown as rows of the heatmap, samples as columns.
A mixed-data heatmap with dendrograms and annotation
The heatmap is currently limited to 200 variables = columns of data
= heatmap rows.
Manuela Hummel, m.hummel@dkfz.de
Hummel M, Edelmann D, Kopp-Schneider A (2017). Clustering of samples and variables with mixed-type data. PLOS ONE, 12(11):e0188274.
Gower J (1971). A general coefficient of similarity and some of its properties. Biometrics, 27:857-871.
Chavent M, Kuentz-Simonet V, Liquet B, Saracco J (2012). ClustOfVar: An R Package for the Clustering of Variables. Journal of Statistical Software, 50:1-16.
Szekely GJ, Rizzo ML, Bakirov NK (2007). Measuring and testing dependence by correlation of distances. The Annals of Statistics, 35.6:2769-2794.
Lyons R (2013). Distance covariance in metric spaces. The Annals of Probability, 41.5:3284-3305.
dist.variables
, dist.subjects
, dendro.variables
, dendro.subjects
,distmap
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | data(mixdata)
mix.heatmap(mixdata, rowmar=7, legend.mat=TRUE)
## with distance correlation
mix.heatmap(mixdata, dist.variables.method="distcor", rowmar=7, legend.mat=TRUE)
## with (random) color bars
colbar <- rep(5:7, nrow(mixdata))
rowbar <- rep(c("darkorange","grey"), ncol(mixdata))
mix.heatmap(mixdata, ColSideColors=colbar, RowSideColors=rowbar,
legend.colbar=c("1","2","3"), legend.rowbar=c("a","b"), rowmar=7)
## example with variable weights
w <- rep(1:2, each=5)
mix.heatmap(mixdata, varweights=w, rowmar=7)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.