# 04 June 2011 # From the vignette for NMF in R library(NMF) library(Biobase) data(esGolub) esGolub # perform 10 runs for each value of r in range 2:6, verbose on, .pbackend=2 uses 2 cores res.multirun.100 <- nmfEstimateRank(esGolub, range=2:6, nrun=100, .opt='v' ) plot(res.multirun) # estimate the factorization rank # perform 10 runs for each value of r in range 2:6 estim.r.100 <- nmfEstimateRank(esGolub, range=2:6, nrun=100, .opt='v') plot(estim.r.100) # In the case of multiple runs method metaHeatmap plots the consensus matrix, # i.e. the average connectivity matrix across the runs (see results Figures 6 # and 7 for a consensus matrix obtained with 100 runs of Brunet’s algorithm on # Golub dataset): # The cell type is used to label rows and columns res.multirun.f3 <- nmfEstimateRank( esGolub, 3, nrun=100, .opt='v' ) names(res.multirun.f3) # [1] "measures" "consensus" res.multirun$measures # rank sparseness.basis sparseness.coef rss evar #1 2 0.6331268 0.6978966 71070149177 0.6795901 #2 3 0.6428015 0.7784392 58798560362 0.7349149 #3 4 0.6668170 0.6937394 51614523220 0.7673031 #4 5 0.6809725 0.6998722 46659623165 0.7896416 #5 6 0.6851090 0.7015529 43396922317 0.8043510 # residuals niter cpu cpu.all nrun cophenetic dispersion #1 16272331 480 3.434 34.558 10 0.9987404 0.9640997 #2 13806547 700 6.806 51.920 10 0.9979653 0.9751801 #3 12453739 860 10.949 91.446 10 0.9961595 0.9677562 #4 11338479 750 11.274 119.114 10 0.9761625 0.8920776 #5 10434760 1450 25.715 188.580 10 0.9846909 0.9168975 metaHeatmap(res.multirun.f3, labRow=esGolub$Cell, labCol=esGolub$Cell) #Error in function (classes, fdef, mtable) : # unable to find an inherited method for function "metaHeatmap", for signature "NMF.rank"