Last chance! 50% off unlimited learning
Sale ends in
This function draws a heat map ordered according to hierarchical clusterings, similarly to heatmap
. It offers more control on layout and allows multiple row annotations.
hclust.ward
is derivated from 'stats' package hclust
, with an alternative default (as arguments can not be passed to it).
dist.COR
mimics 'stats' package dist
, computing distances as 1 - Pearson's correlation coefficient.
clusterize(expr, side = NULL, cex.col = NA, cex.row = NA, mai.left = NA,
mai.bottom = NA, mai.right = 0.1, mai.top = 0.1, side.height = 1, side.col = NULL,
side.srt = 0, side.cex = 1, col.heatmap = heat(), zlim = "0 centered",
zlim.trim = 0.02, norm = c("rows", "columns", "none"), norm.clust = TRUE,
norm.robust = FALSE, customLayout = FALSE, getLayout = FALSE, plot = TRUE,
widths = c(1, 4), heights = c(1, 4), order.genes = NULL, order.samples = NULL,
fun.dist = dist.COR, fun.hclust = hclust.ward, clust.genes = NULL,
clust.samples = NULL)
dist.COR(input)
hclust.ward(input)
A numeric matrix, holding features (genes) in columns and observations (samples) in rows. Rows and columns will be ordered according to hierarchical clustering results.
To be passed to heat.map
.
To be passed to heat.map
.
To be passed to heat.map
.
To be passed to heat.map
.
To be passed to heat.map
.
To be passed to heat.map
.
To be passed to heat.map
.
To be passed to heat.map
.
To be passed to heat.map
.
To be passed to heat.map
.
To be passed to heat.map
.
To be passed to heat.map
.
To be passed to heat.map
.
To be passed to heat.map
.
To be passed to heat.map
.
Single logical value, whether to apply normalization before clustering or after. Normalization applied depends on norm
.
To be passed to heat.map
.
Single logical value, as layout
does not allow nested calls, set this to TRUE to make your own call to layout and embed this plot in a wider one.
Single logical value, whether to only return the layout
arguments that would be used with the set of arguments provided or not. It can prove useful to build custom layouts, e.g. merging this plot to an other. See also customLayout
.
To be passed to heat.map
.
To be passed to layout
.
To be passed to layout
.
A function taking the gene dendrogram and expr
as arguments, and returning the same dendrogram ordered in a custom way.
A function taking the sample dendrogram and expr
as arguments, and returning the same dendrogram ordered in a custom way.
A function to be used for distance computation in clustering. Default value uses 1 - Pearson's correlation as distance. See dist
for further details.
A function to be used for agglomeration in clustering. See hclust
for further details.
If not NULL
, an object coercible to the dendrogram
class (typically the output from hclust()
) to use instead of a fresh hierarchical clustering of genes. The FALSE
value can also be used to disable computation and/or plotting of the dendrogram.
If not NULL
, an object coercible to the dendrogram
class (typically the output from hclust()
) to use instead of a fresh hierarchical clustering of samples. The FALSE
value can also be used to disable computation and/or plotting of the dendrogram.
clusterize
invisibly returns the same list as heat.map
, plus :
The gene dendrogram.
The sample dendrogram.
# NOT RUN {
# Data with features in columns
data(rosenwald)
group <- rosenwald.cli$group
expr <- t(rosenwald.expr)[,1:100]
# NA imputation (feature's mean to minimize impact)
f <- function(x) { x[ is.na(x) ] <- round(mean(x, na.rm=TRUE), 3); x }
expr <- apply(expr, 2, f)
# Simple heat map
clusterize(expr)
# With annotation (row named data.frame)
side <- data.frame(group, row.names=rownames(expr))
clusterize(expr, side=side)
# }
Run the code above in your browser using DataLab