Description Usage Arguments Details Slots Methods (by generic) See Also Examples
This class defines a common interface to handle the results from multiple
runs of a single NMF algorithm, performed with the nmf
method.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | ## S4 method for signature 'NMFfitX'
runtime.all(object)
## S4 method for signature 'NMFfitX'
nrun(object)
## S4 method for signature 'NMFfitX'
consensus(object, ...)
## S4 method for signature 'NMFfitX'
fit(object)
## S4 method for signature 'NMFfitX'
minfit(object)
## S4 method for signature 'NMFfitX'
show(object)
## S4 method for signature 'NMFfitX,NMF'
nmf.equal(x, y, ...)
## S4 method for signature 'NMFfitX'
ibterms(object)
## S4 method for signature 'NMFfitX'
dispersion(object, ...)
## S4 method for signature 'NMFfitX'
summary(object, ..., with.silhouette = "both")
## S3 method for class 'NMFfitX'
silhouette(x, ...)
|
object |
an object of class |
... |
other arguments passed to subsequent calls of suitable methods, usually of the same generic. See details for each method in their dedicated section. |
x, y |
objects of that generally inherit from NMF.
Depending on the method, either or both are |
with.silhouette |
indicates which silhouette average width should
be computed. Its value is partially matched against: |
Currently, this interface is implemented by two classes,
NMFfitX1
and NMFfitXn
, which
respectively handle the case where only the best fit is kept, and the case
where the list of all the fits is returned.
See nmf
for more details on the method arguments.
runtime.all
Object of class proc_time
that
contains CPU times required to perform all the runs.
basismap:
basismap(object = NMFfitX)
: Plots a heatmap of the basis matrix of the best fit in object
.
coefmap:
coefmap(object = NMFfitX)
: Plots a heatmap of the coefficient matrix of the best fit in object
.
This method adds:
an extra special column annotation track for multi-run NMF fits,
'consensus:'
, that shows the consensus cluster associated to each sample.
a column sorting schema 'consensus'
that can be passed
to argument Colv
and orders the columns using the hierarchical clustering of the
consensus matrix with average linkage, as returned by consensushc(object)
.
This is also the ordering that is used by default for the heatmap of the consensus matrix
as ploted by consensusmap
.
consensus:
consensus(object = NMFfitX)
: Pure virtual method defined to ensure consensus
is defined for sub-classes of NMFfitX
.
It throws an error if called.
consensushc:
consensushc(object = NMFfitX)
: Compute the hierarchical clustering on the consensus matrix of object
,
or on the connectivity matrix of the best fit in object
.
consensusmap:
consensusmap(object = NMFfitX)
: Plots a heatmap of the consensus matrix obtained when fitting an NMF model with multiple runs.
cophcor:
cophcor(object = NMFfitX)
: Computes the cophenetic correlation coefficient on the consensus matrix
of object
.
All arguments in ...
are passed to the method cophcor,matrix
.
deviance:
deviance(object = NMFfitX)
: Returns the deviance achieved by the best fit object, i.e. the lowest
deviance achieved across all NMF runs.
dispersion:
dispersion(object = NMFfitX)
: Computes the dispersion on the consensus matrix obtained from multiple NMF
runs.
fit:
fit(object = NMFfitX)
: Returns the model object that achieves the lowest residual approximation
error across all the runs.
It is a pure virtual method defined to ensure fit
is defined
for sub-classes of NMFfitX
, which throws an error if called.
getRNG1:
getRNG1(object = NMFfitX)
: Returns the RNG settings used for the first NMF run of multiple NMF runs.
ibterms:
ibterms(object = NMFfitX)
: Method for multiple NMF fit objects, which returns the indexes of fixed basis
terms from the best fitted model.
metaHeatmap:
metaHeatmap(object = NMFfitX)
: Deprecated method subsituted by consensusmap
.
minfit:
minfit(object = NMFfitX)
: Returns the fit object that achieves the lowest residual approximation
error across all the runs.
It is a pure virtual method defined to ensure minfit
is defined
for sub-classes of NMFfitX
, which throws an error if called.
nmf.equal:
nmf.equal(x = NMF,y = NMFfitX)
: Compares two NMF models when at least one comes from multiple NMF runs.
nmf.equal(x = NMFfitX,y = NMF)
: Compares two NMF models when at least one comes from multiple NMF runs.
NMFfitX:
NMFfitX(object = NMFfitX)
: Provides a way to aggregate NMFfitXn
objects into an NMFfitX1
object.
nrun:
nrun(object = NMFfitX)
: Returns the number of NMF runs performed to create object
.
It is a pure virtual method defined to ensure nrun
is defined
for sub-classes of NMFfitX
, which throws an error if called.
Note that because the nmf
function allows to run the NMF
computation keeping only the best fit, nrun
may return a value
greater than one, while only the result of the best run is stored in
the object (cf. option 'k'
in method nmf
).
predict:
predict(object = NMFfitX)
: Returns the cluster membership index from an NMF model fitted with multiple
runs.
Besides the type of clustering available for any NMF models
('columns', 'rows', 'samples', 'features'
), this method can return
the cluster membership index based on the consensus matrix, computed from
the multiple NMF runs.
Argument what
accepts the following extra types:
'chc'
returns the cluster membership based on the
hierarchical clustering of the consensus matrix, as performed by
consensushc
.
'consensus'
same as 'chc'
but the levels of the membership
index are re-labeled to match the order of the clusters as they would be displayed on the
associated dendrogram, as re-ordered on the default annotation track in consensus
heatmap produced by consensusmap
.
When what
takes values other that those described above, then all extra arguments are passed to
the predict,NMF-method.
residuals:
residuals(object = NMFfitX)
: Returns the residuals achieved by the best fit object, i.e. the lowest
residual approximation error achieved across all NMF runs.
runtime.all:
runtime.all(object = NMFfitX)
: Returns the CPU time required to compute all the NMF runs.
It returns NULL
if no CPU data is available.
show:
show(object = NMFfitX)
: Show method for objects of class NMFfitX
summary:
summary(object = NMFfitX)
: Computes a set of measures to help evaluate the quality of the best
fit of the set.
The result is similar to the result from the summary
method of
NMFfit
objects.
See NMF
for details on the computed measures.
In addition, the cophenetic correlation (cophcor
) and
dispersion
coefficients of the consensus matrix are returned,
as well as the total CPU time (runtime.all
).
Other multipleNMF:
NMFfitX1-class
,
NMFfitXn-class
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # generate a synthetic dataset with known classes
n <- 20; counts <- c(5, 2, 3);
V <- syntheticNMF(n, counts)
# perform multiple runs of one algorithm (default is to keep only best fit)
res <- nmf(V, 3, nrun=3)
res
# plot a heatmap of the consensus matrix
## Not run: consensusmap(res)
# perform multiple runs of one algorithm (keep all the fits)
res <- nmf(V, 3, nrun=3, .options='k')
res
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.