Learn R Programming

NMF (version 0.2.2)

NMF-utils: Class and Utility Methods for NMF objects

Description

Define generic interface methods for class NMF, which is the base -- virtual -- class of the results from any NMF algorithms implemented within package NMF's framework.

Usage

## S3 method for class 'NMF':
clusters(x, what = c('samples', 'features'), ...)

## S3 method for class 'NMF':
connectivity(x, ...)

cophcor(object, ...)

dispersion(object, ...)

## S3 method for class 'NMF,factor':
entropy(x, class, ...)

## S3 method for class 'NMFfit':
residuals(object, track=FALSE)

rss(object, ...)
## S3 method for class 'NMF':
rss(object, target)

## S3 method for class 'NMF':
featureScore(x, ...)

## S3 method for class 'NMF':
extractFeatures(x, ...)

## S3 method for class 'NMF':
metaHeatmap(object, what=c('samples', 'features'), filter=FALSE, ...)

## S3 method for class 'NMF,factor':
purity(x, class, ...)

## S3 method for class 'NMF':
sparseness(x, what = c('features', 'samples'), ...)

syntheticNMF(n, r, p, offset=NULL, noise=FALSE, return.factors=FALSE)

Arguments

class
A factor giving a known class membership for each sample.
filter
if TRUE, only the features that are basis-specific are used. Those features are those returned by function extractFeatures.
n
Number of rows of the synthetic target matrix.
noise
if TRUE, a random noise is added the target matrix.
object
A matrix or an object that inherits from class NMF or NMFfit -- depending on the method.
offset
a vector giving the offset to add to the synthetic target matrix. Its length should be equal to the number of rows n.
p
Number of columns of the synthetic target matrix. Not used if parameter r is a vector (see description of argument r).
r
Underlying factorization rank. If a single numeric is given, the classes are randomly generated from a multinomial distribution. If a numerical vector is given, then it should contain the counts in the different classes (i.e integers
return.factors
If TRUE, the underlying matrices W and H are also returned.
target
the target object estimated by model object. It can be a matrix or an ExpressionSet.
track
if TRUE, the whole residuals track is returned. Otherwise only the last residuals computed is returned.
what
Specifies on which matrix (basis components or mixture coefficients) the computation should be performed.
x
An object that inherits from class NMF.
...
Graphical parameters passed to function heatmap.2

Details

[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

References

Metagenes and molecular pattern discovery using matrix factorization Brunet, J.~P., Tamayo, P., Golub, T.~R., and Mesirov, J.~P. (2004) Proc Natl Acad Sci U S A 101(12), 4164--4169. Sparse non-negative matrix factorizations via alternating non-negativity-constrained least squares for microarray data analysis Kim, H. & Park, H. (2007) Bioinformatics. http://dx.doi.org/10.1093/bioinformatics/btm134. Hoyer, P. O. (2004) Non-negative Matrix Factorization with Sparseness Constraints Journal of Machine Learning Research 5 (2004) 1457--1469

See Also

NMF

Examples

Run this code
# generate a synthetic dataset with known classes
n <- 50; counts <- c(5, 5, 8);
V <- syntheticNMF(n, counts, noise=TRUE)
metaHeatmap(V)

# build the class factor
groups <- as.factor(do.call('c', lapply(seq(3), function(x) rep(x, counts[x]))))

# perform default NMF
res <- nmf(V, 2)
res

metaHeatmap(res, class=groups)
metaHeatmap(res, 'features')
clusters(res)
entropy(res, class=groups)
purity(res, class=groups)

# perform NMF with the right number of basis components
res <- nmf(V, 3)

metaHeatmap(res)
metaHeatmap(res, 'features')
entropy(res, class=groups)
purity(res, class=groups)

Run the code above in your browser using DataLab