aheatmap
. Some
convenience heatmap functions have been implemented for
NMF models, which redefine default values for some of the
arguments of aheatmap
, hence tuning the
output specifically for NMF models.basismap(object, ...) ## S3 method for class 'NMF':
basismap(object, color = "YlOrRd:50",
scale = "r1", Rowv = TRUE, Colv = NA,
subsetRow = FALSE, annRow = NA, annCol = NA,
tracks = "basis", main = "Basis components",
info = FALSE, ...)
coefmap(object, ...)
## S3 method for class 'NMF':
coefmap(object, color = "YlOrRd:50",
scale = "c1", Rowv = NA, Colv = TRUE, annRow = NA,
annCol = NA, tracks = "basis",
main = "Mixture coefficients", info = FALSE, ...)
consensusmap(object, ...)
## S3 method for class 'NMFfitX':
consensusmap(object, annRow = NA,
annCol = NA,
tracks = c("basis:", "consensus:", "silhouette:"),
main = "Consensus matrix", info = FALSE, ...)
## S3 method for class 'matrix':
consensusmap(object,
color = "-RdYlBu",
distfun = function(x) as.dist(1 - x),
hclustfun = "average", Rowv = TRUE, Colv = "Rowv",
main = if (is.null(nr) || nr > 1) "Consensus matrix" else "Connectiviy matrix",
info = FALSE, ...)
## S3 method for class 'NMFfitX':
coefmap(object, Colv = TRUE,
annRow = NA, annCol = NA,
tracks = c("basis", "consensus:"), ...)
aheatmap
.FALSE
(default), all rows are used. Besides the
values supported by argument subsetRow
of
aheatma
TRUE
then the name of the algorithm
that fitted the NMF model is displayed at the bottom of
the plot, if available. Other wise it is passed as is to
aheatmap
.TRUE
orNULL
(to be
consistent withRowv
(modulo the expected length for vector specifications),
and allow specifying the
distance/clustering/ordering/display parameters to be
used forannCol
apply.dist
(e.g. "euclidean" or "maximum").hclust
(e.g.'average'
).aheatmap
. We
therefore strongly recommend to use fully named arguments
when calling these functions. basimap
default values for the following arguments
of aheatmap
:
scale='r1'
);subsetRow
, that are
passed toextractFeatures
. See argument
description here and therein. This track is specified in argumenttracks
(see
its argument description). By default, a matching column
annotation track is also displayed, but may be disabled
usingtracks=':basis'
.
object
is a fitted NMF
model. coefmap
redefines default values for the following
arguments of aheatmap
:
scale='c1'
); This track is specified in argumenttracks
(see
its argument description). By default, a matching row
annotation track is also displayed, but can be disabled
usingtracks='basis:'
.
object
is a fitted NMF model. consensusmap
redefines default values for the
following arguments of aheatmap
:
'basis:'
and'consensus:'
, that show, for each column (i.e.
each sample), the dominant basis component in the best
fit and the hierarchical clustering of the consensus
matrix respectively (using 1-consensus as distance and
average linkage). These tracks are specified in argumenttracks
,
which behaves as inbasismap
.
object
is a fitted NMF model.# roxygen generated flag
options(R_CHECK_RUNNING_EXAMPLES_=TRUE)
#----------
# heatmap-NMF
#----------
## More examples are provided in demo `heatmaps`
demo(heatmaps)
##
# random data with underlying NMF model
v <- syntheticNMF(20, 3, 10)
# estimate a model
x <- nmf(v, 3)
#----------
# basismap
#----------
# show basis matrix
basismap(x)
# without the default annotation tracks
basismap(x, tracks=NA)
#----------
# coefmap
#----------
# coefficient matrix
coefmap(x)
# without the default annotation tracks
coefmap(x, tracks=NA)
#----------
# consensusmap
#----------
res <- nmf(x, 3, nrun=3)
consensusmap(res)
Run the code above in your browser using DataLab