NMF
, which is
the base -- virtual -- class of the results from any NMF algorithms implemented
within package NMF's framework.## S3 method for class 'NMF':
connectivity(x, ...)
## S3 method for class 'NMF,factor':
entropy(x, class, ...)
## S3 method for class 'NMF':
evar(object, target)
## 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(object, method=c('kim', 'max'))
## S3 method for class 'NMF':
extractFeatures(object, method=c('kim', 'max')
, format=c('list', 'combine', 'subset'))
## S3 method for class 'NMF':
metaHeatmap(object, what=c('samples', 'features'), filter=FALSE, ...)
## S3 method for class 'NMF':
nmfApply(object, MARGIN, FUN, ...)
## S3 method for class 'NMFfit':
plot(x, ...)
## S3 method for class 'NMF':
predict(object, what = c('samples', 'features'), prob=FALSE)
## S3 method for class 'NMF,factor':
purity(x, class, ...)
randomize(x, ...)
## S3 method for class 'NMF':
sparseness(x)
syntheticNMF(n, r, p, offset=NULL, noise=FALSE, return.factors=FALSE)
factor
giving a known class membership for each sample.
In methods entropy
and purity
, argument class
is coerce to a
factor if necessary.what='features'
. It specifies how to filter the features that
will appear in the heatmap. When FALSE
(default), all the features are used.
Other possible values are:
TRUE
: only thelist
(default) a list with one element per basis vector, each containing
the indices of the basis-specific features.combine
a single intege+
, %*%
, etc., the function name must be
backquoted or quoted.
See link[base]{apply}
for more details.1
indicates rows, 2
' indicates columns,
c(1,2)
indicates rows and columns.
See link[base]{apply}
for more details.kim
(default) to use Kim and Park (2007) scoring schema and feature selection
method.
The features are first scored using the funTRUE
, a random noise is added the target matrix.matrix
or an object that inherits from class
NMF
or NMFfit
-- depending on the method.n
.r
is a vector (see description of argument r
).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 integersTRUE
, the underlying matrices W
and
H
are also returned.object
. It can be
a matrix
or an ExpressionSet
.TRUE
, the whole residuals track is returned.
Otherwise only the last residuals computed is returned.what='features'
)
or mixture coefficients (what='samples'
) the computation should be performed.randomize
: the matrix
or ExpressionSet
object whose
entries will be randomised.
for plot
: An object that inherits from class NMFfit
.
otherwismetaHeatmap
: Graphical parameters passed to functionheatmap.2
nmfApply
: optional arguments to funcNMF , summary
# generate a synthetic dataset with known classes: 50 features, 18 samples (5+5+8)
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')
# see the predicted clusters of samples
predict(res)
# compute entropy and purity
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