NMFfitX1-class: Structure for Storing the Best Fit Amongst 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 the – default – option keep.all=FALSE (cf. nmf).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## S4 method for signature 'NMFfitX1'
show(object)

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

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

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

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

## S4 method for signature 'NMFfitX1,NMFfitX1'
nmf.equal(x, y, ...)

Arguments

object

an object of class NMFfitX.

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.

x, y

objects of class NMFfitX1, whose fitted models are compared.

...

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

Details

It extends both classes NMFfitX and NMFfit, and stores a the result of the best fit in its NMFfit structure.

Beside the best fit, this class allows to hold data about the computation of the multiple runs, such as the number of runs, the CPU time used to perform all the runs, as well as the consensus matrix.

Due to the inheritance from class NMFfit, objects of class NMFfitX1 can be handled exactly as the results of single NMF run – as if only the best run had been performed.

Slots

consensus

object of class matrix used to store the consensus matrix based on all the runs.

nrun

an integer that contains the number of runs performed to compute the object.

rng1

an object that contains RNG settings used for the first run. See getRNG1.

Methods (by generic)

See Also

Other multipleNMF: NMFfitX-class, NMFfitXn-class

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
# 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 only the best fit (default)
#i.e.: the implicit nmf options are .options=list(keep.all=FALSE) or .options='-k'
res <- nmf(V, 3, nrun=3) 
res

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

# show computational time
runtime.all(res)

# plot the consensus matrix, as stored (pre-computed) in the object
## Not run:  consensusmap(res, annCol=groups) 

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