Algorithms and framework for Nonnegative Matrix Factorization (NMF).

Gaujoux R and Seoighe C (2010). “A flexible R package for nonnegative matrix factorization.” BMC Bioinformatics, 11(1), pp. 367. ISSN 1471-2105, http://dx.doi.org/10.1186/1471-2105-11-367, http://www.biomedcentral.com/1471-2105/11/367.

Background

Nonnegative Matrix Factorization (NMF) is an unsupervised learning technique that has been applied successfully in several fields, including signal processing, face recognition and text mining. Recent applications of NMF in bioinformatics have demonstrated its ability to extract meaningful information from high-dimensional data such as gene expression microarrays. Developments in NMF theory and applications have resulted in a variety of algorithms and methods. However, most NMF implementations have been on commercial platforms, while those that are freely available typically require programming skills. This limits their use by the wider research community.

Results

Our objective is to provide the bioinformatics community with an open-source, easy-to-use and unified interface to standard NMF algorithms, as well as with a simple framework to help implement and test new NMF methods. For that purpose, we have developed a package for the R/BioConductor platform. The package ports public code to R, and is structured to enable users to easily modify and/or add algorithms. It includes a number of published NMF algorithms and initialization methods and facilitates the combination of these to produce new NMF strategies. Commonly used benchmark data and visualization methods are provided to help in the comparison and interpretation of the results.

Conclusions

The NMF package helps realize the potential of Nonnegative Matrix Factorization, especially in bioinformatics, providing easy access to methods that have already yielded new insights in many applications.

Availability

Documentation, source code and sample data are available from:

Help topics

  • advanced-NMF(which.best)
    Advanced Usage of the Package NMF
  • aheatmap
    Annotated Heatmaps
  • algorithmic-NMF(algorithm, algorithm<-, algorithm<--methods, algorithm-methods, algorithm<-,NMFfit,ANY-method, algorithm,NMFfit-method, algorithm,NMFfitXn-method, algorithm<-,NMFSeed,function-method, algorithm,NMFSeed-method, algorithm<-,NMFStrategyFunction,function-method, algorithm,NMFStrategyFunction-method, algorithm<-,NMFStrategyOctave,character-method, compare, compare-methods, compare,NMFfitXn-method, logs, logs,ANY-method, logs-methods, modelname, modelname,ANY-method, modelname-methods, modelname,NMFfit-method, modelname,NMFfitXn-method, modelname,NMFStrategy-method, niter, niter<-, niter<--methods, niter-methods, niter,NMFfit-method, niter<-,NMFfit,numeric-method, nrun, nrun,ANY-method, nrun-methods, nrun,NMFfit-method, nrun,NMFfitX1-method, nrun,NMFfitX-method, nrun,NMFfitXn-method, objective, objective<-, objective<--methods, objective-methods, objective<-,NMFfit,ANY-method, run, run-methods, runtime, runtime.all, runtime.all-methods, runtime.all,NMFfit-method, runtime.all,NMFfitX-method, runtime-methods, runtime,NMFfit-method, seeding, seeding<-, seeding<--methods, seeding-methods, seeding<-,NMFfit-method, seeding,NMFfit-method, seeding,NMFfitXn-method, seqtime, seqtime-methods, seqtime,NMFfitXn-method, seqtime,NMFList-method)
    Generic Interface for Algorithms
  • algorithm,NMFList-method
    Returns the method names used to compute the NMF fits in the list.
  • algorithm,NMFStrategyOctave-method
    Returns the name of the Octave/Matlab function that implements the NMF algorithm -- as stored in
  • basis(.basis, .basis<-, basis<-, basis<-,ANY-method, basis,ANY-method, .basis<--methods, .basis-methods, basis<--methods, basis-methods, .basis<-,NMFfit,matrix-method, .basis,NMFfit-method, basis,NMFfitXn-method, .basis<-,NMF,matrix-method, .basis,NMF-method, basis,NMF-method, .basis<-,NMFstd,matrix-method, .basis,NMFstd-method, coef, .coef, .coef<-, coef<-, coef<-,ANY-method, coefficients, coefficients-methods, coefficients,NMF-method, .coef<--methods, .coef-methods, coef<--methods, coef-methods, .coef<-,NMFfit,matrix-method, .coef,NMFfit-method, coef,NMFfitXn-method, .coef<-,NMF,matrix-method, .coef,NMF-method, coef,NMF-method, .coef<-,NMFstd,matrix-method, .coef,NMFstd-method, loadings,NMF-method, scoef, scoef,matrix-method, scoef-methods, scoef,NMF-method)
    Accessing NMF Factors
  • basiscor(basiscor,matrix,NMF-method, basiscor-methods, basiscor,NMF,matrix-method, basiscor,NMF,missing-method, basiscor,NMF,NMF-method, profcor, profcor,matrix,NMF-method, profcor-methods, profcor,NMF,matrix-method, profcor,NMF,missing-method, profcor,NMF,NMF-method)
    Correlations in NMF Models
  • basisnames(basisnames<-, basisnames<-,ANY-method, basisnames,ANY-method, basisnames<--methods, basisnames-methods, dimnames-NMF, dimnames<-,NMF-method, dimnames,NMF-method)
    Dimension names for NMF objects
  • bioc-NMF(.atrack,ExpressionSet-method, featureNames,NMFfitX-method, featureNames<-,NMF-method, featureNames,NMF-method, metagenes, metagenes<-, metaprofiles, metaprofiles<-, nmeta, nmf,ExpressionSet,ANY,ANY-method, nmf,matrix,ExpressionSet,ANY-method, nmfModel,ANY,ExpressionSet-method, nmfModel,ExpressionSet,ANY-method, nneg,ExpressionSet-method, rnmf,ANY,ExpressionSet-method, rposneg,ExpressionSet-method, run,NMFStrategy,ExpressionSet,ANY-method, sampleNames<-,NMF,ANY-method, sampleNames,NMFfitX-method, sampleNames,NMF-method, seed,ExpressionSet,ANY,ANY-method)
    Specific NMF Layer for Bioconductor
  • canFit(canFit,character,ANY-method, canFit-methods, canFit,NMFStrategy,character-method, canFit,NMFStrategy,NMF-method)
    Testing Compatibility of Algorithm and Models
  • compare-NMF(compare,list-method, compare,NMFfit-method, consensusmap,list-method, consensusmap,NMF.rank-method, plot,NMFList,missing-method, summary,NMFList-method)
    Comparing Results from Different NMF Runs
  • connectivity(connectivity,ANY-method, connectivity,factor-method, connectivity-methods, connectivity,NMF-method, connectivity,numeric-method, consensus, consensus-methods, consensus,NMFfitX-method, consensus,NMF-method)
    Clustering Connectivity and Consensus Matrices
  • consensushc(consensushc,matrix-method, consensushc-methods, consensushc,NMFfitX-method, consensushc,NMF-method)
    Hierarchical Clustering of a Consensus Matrix
  • consensus,NMFfitX1-method
    Returns the consensus matrix computed while performing all NMF runs,
  • consensus,NMFfitXn-method(plot.NMF.consensus)
    Computes the consensus matrix of the set of fits stored in
  • cophcor(cophcor,matrix-method, cophcor-methods, cophcor,NMFfitX-method)
    Cophenetic Correlation Coefficient
  • deviance(deviance-methods, deviance,NMFfit-method, deviance,NMFfitX-method, deviance,NMF-method, deviance,NMFStrategy-method, nmfDistance)
    Distances and Objective Functions
  • dispersion(dispersion,matrix-method, dispersion-methods, dispersion,NMFfitX-method)
    Dispersion of a Matrix
  • esGolub
    Golub ExpressionSet
  • fcnnls(fcnnls,ANY,numeric-method, fcnnls,matrix,matrix-method, fcnnls-methods, fcnnls,numeric,matrix-method)
    Fast Combinatorial Nonnegative Least-Square
  • .fcnnls
    Internal Routine for Fast Combinatorial Nonnegative Least-Squares
  • featureScore(extractFeatures, extractFeatures,matrix-method, extractFeatures-methods, extractFeatures,NMF-method, featureScore,matrix-method, featureScore-methods, featureScore,NMF-method)
    Feature Selection in NMF Models
  • fit(fit<-, fit<--methods, fit-methods, fit,NMFfit-method, fit<-,NMFfit,NMF-method, fit,NMFfitX1-method, fit,NMFfitX-method, fit,NMFfitXn-method, minfit, minfit-methods, minfit,NMFfit-method, minfit,NMFfitX1-method, minfit,NMFfitX-method, minfit,NMFfitXn-method)
    Extracting Fitted Models
  • fitted(fitted-methods, fitted,NMFfit-method, fitted,NMF-method, fitted,NMFns-method, fitted,NMFOffset-method, fitted,NMFstd-method)
    Fitted Matrix in NMF Models
  • getRNG1(.getRNG, getRNG1-methods, getRNG1,NMFfitX1-method, getRNG1,NMFfitX-method, getRNG1,NMFfitXn-method, .getRNG-methods, .getRNG,NMFfitXn-method)
    Extracting RNG Data from NMF Objects
  • heatmap-NMF(basismap, basismap-methods, basismap,NMFfitX-method, basismap,NMF-method, coefmap, coefmap-methods, coefmap,NMFfitX-method, coefmap,NMF-method, consensusmap, consensusmap,matrix-method, consensusmap-methods, consensusmap,NMFfitX-method, consensusmap,NMF-method)
    Heatmaps of NMF Factors
  • ibterms(bterms, cterms, ibasis, ibterms-methods, ibterms,NMFfit-method, ibterms,NMFfitX-method, ibterms,NMF-method, ibterms,NMFstd-method, icoef, icterms, icterms-methods, icterms,NMFfit-method, icterms,NMF-method, icterms,NMFstd-method, iterms, nbterms, ncterms, nterms)
    Fixed Terms in NMF Models
  • is.nmf(hasBasis, hasCoef, is.empty.nmf, isNMFfit, is.partial.nmf)
    Testing NMF Objects
  • match_atrack
    Extending Annotation Vectors
  • methods-NMF(existsNMFMethod, getNMFMethod, removeNMFMethod, selectNMFMethod)
    Registry for NMF Algorithms
  • nbasis(dim-NMF, dim,NMFfitXn-method, dim,NMF-method, nbasis,ANY-method, nbasis-methods, nbasis,NMFfitXn-method)
    Dimension of NMF Objects
  • nmf(nmf,data.frame,ANY,ANY-method, nmf,formula,ANY,ANY-method, nmf,matrix,data.frame,ANY-method, nmf,matrix,matrix,ANY-method, nmf,matrix,missing,ANY-method, nmf,matrix,NMF,ANY-method, nmf,matrix,NULL,ANY-method, nmf,matrix,numeric,character-method, nmf,matrix,numeric,function-method, nmf,matrix,numeric,list-method, nmf,matrix,numeric,missing-method, nmf,matrix,numeric,NMFStrategy-method, nmf,matrix,numeric,NULL-method, nmf-methods)
    Running NMF algorithms
  • nmfAlgorithm
    Listing and Retrieving NMF Algorithms
  • nmfAlgorithm.SNMF_R(nmfAlgorithm.SNMF_L, SNMF/L-nmf, SNMF/R-nmf)
    NMF Algorithm - Sparse NMF via Alternating NNLS
  • nmfApply
    Apply Function for NMF Objects
  • nmfCheck
    Checking NMF Algorithm
  • NMF-class(.DollarNames,NMF-method, misc, $<-,NMF-method, $,NMF-method)
    Generic Interface for Nonnegative Matrix Factorisation Models
  • NMF-defunct(metaHeatmap, metaHeatmap,matrix-method, metaHeatmap-methods, metaHeatmap,NMFfitX-method, metaHeatmap,NMF-method)
    Defunct Functions and Classes in the NMF Package
  • NMF-deprecated
    Deprecated Functions in the Package NMF
  • nmf.equal(nmf.equal,list,list-method, nmf.equal,list,missing-method, nmf.equal-methods, nmf.equal,NMFfit,NMFfit-method, nmf.equal,NMFfit,NMF-method, nmf.equal,NMFfitX1,NMFfitX1-method, nmf.equal,NMFfitX,NMF-method, nmf.equal,NMF,NMFfit-method, nmf.equal,NMF,NMFfitX-method, nmf.equal,NMF,NMF-method)
    Testing Equality of NMF Models
  • nmfEstimateRank(plot.NMF.rank)
    Estimate Rank for NMF Models
  • NMFfit-class(NMFfit)
    Base Class for to store Nonnegative Matrix Factorisation results
  • NMFfitX1-class
    Structure for Storing the Best Fit Amongst Multiple NMF Runs
  • NMFfitX-class
    Virtual Class to Handle Results from Multiple Runs of NMF Algorithms
  • NMFfitXn-class
    Structure for Storing All Fits from Multiple NMF Runs
  • nmfFormals(nmfArgs)
    Showing Arguments of NMF Algorithms
  • NMFList-class
    Class for Storing Heterogeneous NMF fits
  • [,NMF-method
    Sub-setting NMF Objects
  • nmfModel(nmfModel,data.frame,data.frame-method, nmfModel,formula,ANY-method, nmfModel,matrix,ANY-method, nmfModel,matrix,matrix-method, nmfModel-methods, nmfModel,missing,ANY-method, nmfModel,missing,missing-method, nmfModel,NULL,ANY-method, nmfModel,numeric,matrix-method, nmfModel,numeric,missing-method, nmfModel,numeric,numeric-method, nmfModels)
    Factory Methods NMF Models
  • NMFns-class
    NMF Model - Nonsmooth Nonnegative Matrix Factorization
  • nmfObject
    Updating NMF Objects
  • NMFOffset-class(initialize,NMFOffset-method)
    NMF Model - Nonnegative Matrix Factorization with Offset
  • NMF-package(NMF)
    Algorithms and framework for Nonnegative Matrix Factorization (NMF).
  • nmfSeed(existsNMFSeed, getNMFSeed)
    Seeding Strategies for NMF Algorithms
  • NMFSeed(NMFSeed,character-method, NMFSeed-methods, NMFSeed,NMFSeed-method, removeNMFSeed, setNMFSeed)
    NMFSeed
  • NMFSeed-class
    Base class that defines the interface for NMF seeding methods.
  • NMFstd-class
    NMF Model - Standard model
  • NMFStop(nmf.stop.connectivity, nmf.stop.iteration, nmf.stop.stationary, nmf.stop.threshold, stop-NMF)
    Stopping Criteria for NMF Iterative Strategies
  • NMFStrategy(NMFStrategy,character,character-method, NMFStrategy,character,function-method, NMFStrategy,character,missing-method, NMFStrategy,character,NMFStrategy-method, NMFStrategy-methods, NMFStrategy,missing,character-method, NMFStrategy,NMFStrategy,missing-method, NMFStrategy,NULL,character-method, NMFStrategy,NULL,NMFStrategy-method, run,NMFStrategyFunction,matrix,NMFfit-method, run,NMFStrategyIterative,matrix,NMFfit-method, run,NMFStrategyIterativeX,matrix,NMFfit-method, run,NMFStrategy,matrix,NMFfit-method, run,NMFStrategy,matrix,NMF-method, run,NMFStrategyOctave,matrix,NMFfit-method)
    Factory Method for NMFStrategy Objects
  • NMFStrategyFunction-class
    Interface for Single Function NMF Strategies
  • NMFStrategyIterative-class
    Interface for Algorithms: Implementation for Iterative NMF Algorithms
  • NMFStrategyOctave-class(show,NMFStrategyOctave-method)
    S4 Interface for Octave-Matlab NMF Algorithms
  • nmf_update.brunet_R(brunet_M-nmf, brunet-nmf, brunet_R-nmf, KL-nmf, nmfAlgorithm.brunet, nmfAlgorithm.brunet_M, nmfAlgorithm.brunet_R, nmfAlgorithm.KL, nmf_update.brunet)
    NMF Algorithm/Updates for Kullback-Leibler Divergence
  • nmf_update.euclidean.h(nmf_update.euclidean, nmf_update.euclidean.h_R, nmf_update.euclidean.w, nmf_update.euclidean.w_R)
    NMF Multiplicative Updates for Euclidean Distance
  • nmf_update.euclidean_offset.h(nmfAlgorithm.offset, nmfAlgorithm.offset_R, nmf_update.euclidean_offset.w, nmf_update.offset, nmf_update.offset_R, offset_R-nmf)
    NMF Multiplicative Update for NMF with Offset Models
  • nmf_update.KL.h(nmf_update.KL, nmf_update.KL.h_R, nmf_update.KL.w, nmf_update.KL.w_R)
    NMF Multiplicative Updates for Kullback-Leibler Divergence
  • nmf_update.lee_R(Frobenius-nmf, lee-nmf, lee_R-nmf, nmfAlgorithm.Frobenius, nmfAlgorithm.lee, nmfAlgorithm.lee_R, nmf_update.lee)
    NMF Algorithm/Updates for Frobenius Norm
  • nmf_update.lsnmf(lsNMF-nmf, nmfAlgorithm.lsNMF, wrss)
    Multiplicative Updates for LS-NMF
  • nmf_update.ns(nmfAlgorithm.nsNMF, nmfAlgorithm.nsNMF_R, nmf_update.ns_R, nsNMF_R-nmf)
    NMF Multiplicative Update for Nonsmooth Nonnegative Matrix Factorization (nsNMF).
  • nneg(nneg,matrix-method, nneg-methods, nneg,NMF-method, posneg, rposneg, rposneg,matrix-method, rposneg-methods, rposneg,NMF-method)
    Transforming from Mixed-sign to Nonnegative Data
  • objective,NMFfit-method
    Returns the objective function associated with the algorithm that computed the
  • offset,NMFfit-method
    Returns the offset from the fitted model.
  • offset,NMFOffset-method
    Offsets in NMF Models with Offset
  • options-NMF(nmf.getOption, nmf.options, nmf.printOptions, nmf.resetOptions)
    NMF Package Specific Options
  • parallel-NMF(gVariable, hostfile, ts_eval, ts_tempfile)
    Utilities for Parallel Computations
  • plot,NMFfit,missing-method
    Plots the residual track computed at regular interval during the fit of
  • predict(predict-methods, predict,NMFfitX-method, predict,NMF-method)
    Clustering and Prediction
  • profplot(profplot.default)
    Plotting Expression Profiles
  • purity(entropy, entropy,ANY,ANY-method, entropy,factor,ANY-method, entropy-methods, entropy,NMFfitXn,ANY-method, entropy,table,missing-method, purity,ANY,ANY-method, purity,factor,ANY-method, purity-methods, purity,NMFfitXn,ANY-method, purity,table,missing-method)
    Purity and Entropy of a Clustering
  • randomize
    Randomizing Data
  • residuals(hasTrack, residuals<-, residuals<--methods, residuals-methods, residuals<-,NMFfit-method, residuals,NMFfit-method, residuals,NMFfitX-method, trackError)
    Residuals in NMF Models
  • rmatrix(rmatrix,ANY-method, rmatrix-methods, rmatrix,NMF-method, rmatrix,numeric-method)
    Generating Random Matrices
  • rnmf(rnmf,ANY,data.frame-method, rnmf,ANY,matrix-method, rnmf,formula,ANY-method, rnmf-methods, rnmf,missing,missing-method, rnmf,NMF,missing-method, rnmf,NMF,numeric-method, rnmf,NMFOffset,numeric-method, rnmf,numeric,missing-method, rnmf,numeric,numeric-method)
    Generating Random NMF Models
  • rss(evar, evar,ANY-method, evar-methods, rss,ANY-method, rss,matrix-method, rss-methods)
    Residual Sum of Squares and Explained Variance
  • runtime.all,NMFfitXn-method
    Returns the CPU time used to perform all the NMF fits stored in
  • runtime,NMFList-method
    Returns the CPU time required to compute all NMF fits in the list.
  • scale.NMF
    Rescaling NMF Models
  • seed(seed,ANY,ANY,character-method, seed,ANY,ANY,function-method, seed,ANY,ANY,missing-method, seed,ANY,ANY,NULL-method, seed,ANY,ANY,numeric-method, seed,ANY,list,NMFSeed-method, seed,ANY,numeric,NMFSeed-method, seed,matrix,NMF,NMFSeed-method, seed-methods)
    Interface for NMF Seeding Methods
  • setNMFMethod(nmfRegisterAlgorithm)
    Registering NMF Algorithms
  • setupBackend(setupLibPaths, setupRNG, setupSharedMemory, setupTempDirectory)
    Computational Setup Functions
  • show,NMFfit-method
    Show method for objects of class
  • show,NMFfitX1-method
    Show method for objects of class
  • show,NMFfitX-method
    Show method for objects of class
  • show,NMFfitXn-method
    Show method for objects of class
  • show,NMFList-method
    Show method for objects of class
  • show,NMF-method
    Show method for objects of class
  • show,NMFns-method
    Show method for objects of class
  • show,NMFOffset-method
    Show method for objects of class
  • show,NMFSeed-method
    Show method for objects of class
  • show,NMFStrategyIterative-method
    Show method for objects of class
  • silhouette.NMF
    Silhouette of NMF Clustering
  • smoothing
    Smoothing Matrix in Nonsmooth NMF Models
  • sparseness(sparseness,matrix-method, sparseness-methods, sparseness,NMF-method, sparseness,numeric-method)
    Sparseness
  • staticVar
    Get/Set a Static Variable in NMF Algorithms
  • summary(summary-methods, summary-NMF, summary,NMFfit-method, summary,NMFfitX-method, summary,NMF-method)
    Assessing and Comparing NMF Models
  • syntheticNMF
    Simulating Datasets
  • t.NMF
    Transformation NMF Model Objects
  • utils-NMF(str_args)
    Utility Function in the NMF Package

Vignettes

Demos

Dependencies

  • R version: R >= 2.15.2
  • Depends: methods, utils, stats, cluster, pkgmaker, rngtools, registry, digest, grid
  • Imports: graphics, rngtools, stringr, grDevices, gridBase, colorspace, RColorBrewer, iterators, foreach, doParallel, ggplot2, reshape2
  • Suggests: RcppOctave, Biobase, fastICA, doMPI, bigmemory, synchronicity, corpcor, xtable, devtools, knitr, bibtex, RUnit, mail

Authors

  • Renaud Gaujoux
  • Cathal Seoighe
+ See contributions
  • Renaud Gaujoux (renaud at mancala.cbio.uct.ac.za) [aut, cre]
  • Cathal Seoighe [ths]
  • P. Brunet [ctb] (method: brunet (Matlab original version))
  • H. Kim [ctb] (methods: snmf/r(l) (Matlab original version))

Maintainer

  • Renaud Gaujoux (renaud at mancala.cbio.uct.ac.za)

Web page(s)