Learn R Programming

NMF (version 0.2.2)

NMFfitXn-class: Structure for Storing All Fits from Multiple NMF Runs

Description

This class is used to return the result from a multiple run of a single NMF algorithm performed with function nmf with option keep.all=TRUE (cf. nmf).

Arguments

Details

It extends both classes NMFfitX and list, and stores the result of each run (i.e. a NMFfit object) in its list structure.

IMPORTANT NOTE: This class is designed to be read-only, even though all the list-methods can be used on its instances. Adding or removing elements would most probably lead to incorrect results in subsequent calls. Capability for concatenating and merging NMF results is for the moment only used internally, and should be included and supported in the next release of the package.

See Also

Other multipleNMF: NMFfitX1-class, NMFfitX-class

Examples

Run this code
# roxygen generated flag
options(R_CHECK_RUNNING_EXAMPLES_=TRUE)

# generate a synthetic dataset with known classes
n <- 20; counts <- c(5, 2, 3);
V <- syntheticNMF(n, counts)

# get the class factor
groups <- V$pData$Group

# perform multiple runs of one algorithm, keeping all the fits
res <- nmf(V, 3, nrun=3, .options='k') # .options=list(keep.all=TRUE) also works
res

summary(res)
# get more info
summary(res, target=V, class=groups)

# compute/show computational times
runtime.all(res)
seqtime(res)

# plot the consensus matrix, computed on the fly
consensusmap(res, annCol=groups)

Run the code above in your browser using DataLab