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

Description Usage Arguments Details Slots Methods (by generic) See Also Examples

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).

Usage

 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
33
34
35
36
37
38
## S4 method for signature 'NMFfitXn'
show(object)

## S4 method for signature 'NMFfitXn'
nbasis(x, ...)

## S4 method for signature 'NMFfitXn'
nrun(object)

## S4 method for signature 'NMFfitXn'
algorithm(object)

## S4 method for signature 'NMFfitXn'
seeding(object)

## S4 method for signature 'NMFfitXn'
modelname(object)

## S4 method for signature 'NMFfitXn'
seqtime(object)

## S4 method for signature 'NMFfitXn'
runtime.all(object, null = FALSE, warning = TRUE)

## S4 method for signature 'NMFfitXn'
minfit(object)

## S4 method for signature 'NMFfitXn'
fit(object)

## S4 method for signature 'NMFfitXn'
consensus(object, ..., no.attrib = FALSE)

## S4 method for signature 'NMFfitXn,ANY'
purity(x, y, method = "best", ...)

## S4 method for signature 'NMFfitXn,ANY'
entropy(x, y, method = "best", ...)

Arguments

object

an object of class NMFfitXn

x

an NMFfitXn object.

...

other arguments passed to subsequent calls of suitable methods, usually of the same generic.

null

a logical that indicates if the sequential time should be returned if no time data is available in slot ‘runtime.all’.

warning

a logical that indicates if a warning should be thrown if the sequential time is returned instead of the real CPU time.

no.attrib

a single logical that indicates that no extra attributes should be attached to the result matrix. If TRUE, then the following attributes are attached:

  • nrun: number of algorithm runs performed;

  • nbasis: number of basis components of the fitted model;

Also, in this case, the result gains an extra S3 class NMF.consensus.

y

an object that act as a suitable reference for the computation of performance measures. For purity and entropy this would typically be a factor that indicates known column clusters.

method

a character string that specifies how the value is computed. It may be either 'best' or 'mean' to compute the best or mean purity respectively.

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.

Slots

.Data

standard slot that contains the S3 list object data. See R documentation on S3/S4 classes for more details (e.g., setOldClass).

Methods (by generic)

See Also

Other multipleNMF: NMFfitX-class, NMFfitX1-class

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# 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
## Not run:  consensusmap(res, annCol=groups) 

renozao/NMF documentation built on June 14, 2020, 9:35 p.m.