Description Usage Arguments Details Value Methods (by generic) References See Also Examples
connectivity
is an S4 generic that computes the connectivity matrix
based on the clustering of samples obtained from a model's predict
method.
The consensus matrix has been proposed by Brunet et al. (2004) to help
visualising and measuring the stability of the clusters obtained by
NMF approaches.
For objects of class NMF
(e.g. results of a single NMF run, or NMF
models), the consensus matrix reduces to the connectivity matrix.
1 2 3 4 5 6 7 8 9 10 11 12 | connectivity(object, ...)
## S4 method for signature 'ANY'
connectivity(object, ...)
## S4 method for signature 'factor'
connectivity(object, ...)
## S4 method for signature 'numeric'
connectivity(object, ...)
consensus(object, ...)
|
object |
an object with a suitable |
... |
extra arguments to allow extension.
They are passed to |
The connectivity matrix of a given partition of a set of samples (e.g. given as a cluster membership index) is the matrix C containing only 0 or 1 entries such that:
C_{ij} = 1 if sample i belongs to the same cluster as sample j, 0 otherwise
a square matrix of dimension the number of samples in the model, full of 0s or 1s.
connectivity:
connectivity(object = NMF)
: Computes the connectivity matrix for an NMF model, for which cluster
membership is given by the most contributing basis component in each sample.
See predict,NMF-method
.
connectivity(object = ANY)
: Default method which computes the connectivity matrix
using the result of predict(x, ...)
as cluster membership index.
connectivity(object = factor)
: Computes the connectivity matrix using x
as cluster membership index.
connectivity(object = numeric)
: Equivalent to connectivity(as.factor(x))
.
consensus:
consensus(object = NMFfitX)
: Pure virtual method defined to ensure consensus
is defined for sub-classes of NMFfitX
.
It throws an error if called.
consensus(object = NMF)
: This method is provided for completeness and is identical to
connectivity
, and returns the connectivity matrix,
which, in the case of a single NMF model, is also the consensus matrix.
consensus(object = NMFfit)
: Shorcut for consensus(fit(object), ...)
consensus(object = NMFfitX1)
: Returns the consensus matrix computed while performing all NMF runs,
amongst which object
was selected as the best fit.
The result is the matrix stored in slot ‘consensus’.
This method returns NULL
if the consensus matrix is empty.
consensus(object = NMFfitXn)
: Computes the consensus matrix of the set of fits stored in object
, as
the mean connectivity matrix across runs.
This method returns NULL
on an empty object.
The result is a matrix with several attributes attached, that are used by
plotting functions such as consensusmap
to annotate the plots.
Brunet J, Tamayo P, Golub TR, Mesirov JP (2004). “Metagenes and molecular pattern discovery using matrix factorization.” _Proceedings of the National Academy of Sciences of the United States of America_, *101*(12), 4164-9. ISSN 0027-8424, doi: 10.1073/pnas.0308531101 (URL: https://doi.org/10.1073/pnas.0308531101).
1 2 3 4 5 | # clustering of random data
h <- hclust(dist(rmatrix(10,20)))
connectivity(stats::cutree(h, 2))
connectivity(gl(2, 4))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.