<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Yes, the error messages would have told me what the problem was. I was going so quickly at that point that all I saw was 'threw an error'. It's hard to believe, now, looking at the screen output, but that's what occurred. </div><div><br></div><div>Your suggestion: </div><div>> dummy <- nmf(V.matrix, 2, maxIter=20)</div><div>Error: NMF::nmf - <font class="Apple-style-span" color="#ff4013">Input matrix x contains at least one null row</font>.</div><div apple-content-edited="true">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="orphans: 2; text-align: -webkit-auto; text-indent: 0px; widows: 2; -webkit-text-decorations-in-effect: none; "><div style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br></div><div style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Repeating my original survey call: </div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">> dummy.estim.r <- nmfEstimateRank( V.matrix, range=2:12, nrun=30, .opt='v', .pbackend=7 )</div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">NMF algorithm: 'brunet'</div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Multiple runs: 30</div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">...</div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">...</div></div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Runs: |==================================================| 100%</div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Timing stopped at: 0.18 0.107 0.168 </div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Error in function (...)  : All the runs produced an error:</div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-tab-span" style="white-space:pre">     </span>-#1 [r=2] -> NMF::nmf - 30/30 fit(s) threw an error.</div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "># Error(s) thrown:</div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">  - run #1: NMF::nmf - <font class="Apple-style-span" color="#e32400">Input matrix x contains at least one null row</font>.</div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-tab-span" style="white-space: pre; ">  </span>-#2 [r=3] -> NMF::nmf - 30/30 fit(s) threw an error.</div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br></div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">> sessionInfo()</div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">R version 2.15.3 (2013-03-01)</div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)</div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br></div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">locale:</div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">[1] en_CA.UTF-8/en_CA.UTF-8/en_CA.UTF-8/C/en_CA.UTF-8/en_CA.UTF-8</div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br></div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">attached base packages:</div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">[1] grid      parallel  stats     graphics  grDevices utils     datasets </div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">[8] methods   base     </div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br></div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">other attached packages:</div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "> [1] synchronicity_1.1.0 cluster_1.14.3     <font class="Apple-style-span" color="#ff4013"> NMF_0.9</font>            </div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "> [4] Biobase_2.18.0      BiocGenerics_0.4.0  RColorBrewer_1.0-5 </div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "> [7] colorspace_1.2-1    stringr_0.6.2       gridBase_0.4-6     </div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">[10] digest_0.6.3        bigmemory_4.4.0     BH_1.51.0-0        </div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">[13] bigmemory.sri_0.1.2 doParallel_1.0.1    iterators_1.0.6    </div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">[16] foreach_1.4.0       registry_0.2        rngtools_1.1       </div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">[19] pkgmaker_0.10.1    </div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br></div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">loaded via a namespace (and not attached):</div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">[1] codetools_0.2-8 compiler_2.15.3 xtable_1.7-1   </div><div><br></div><div><br></div></div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Thanks,</div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br></div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">G</div></div><div style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">--</div><div style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Gordon Robertson<br>Michael Smith Genome Sciences Centre</div><div style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">BC Cancer Agency<br>Vancouver BC Canada<br><a href="http://www.bcgsc.ca">www.bcgsc.ca</a><br><br></div></span></div>
</div>
<br><div><div>On 2013-03-18, at 4:56 AM, Renaud Gaujoux wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div><div><div><div><div>Good.<br></div>But wasn't the error message about null rows already displayed without calling tracebak()?<br></div>It should have appeared at the end of the messages after the call to nmf().<br>
<br></div>Generally, it is good practice to perform a plain single test run of nmf on the data, before launching bigger estimations.<br></div>e.g., in your case, the following should have given you a quick taste of the error:<br>
<br></div>dummy <- nmf(x, 2, maxIter=20)<br><div><br><br></div><div>Renaud</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/3/18 Gordon Robertson <span dir="ltr"><<a href="mailto:grobertson@bcgsc.ca" target="_blank">grobertson@bcgsc.ca</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Thank you.  traceback() pointed to the problem: </div><div>...</div><div><div>    }("[r=2] -> NMF::nmf - 30/30 fit(s) threw an error.\n# Error(s) thrown:\n  - run #1: NMF::nmf -<font color="#e32400"> Input matrix x contains at least one null row</font>.", </div>
<div>        "[r=3] -> NMF::nmf - 30/30 fit(s) threw an error.\n# Error(s) thrown:\n  - run #1: NMF::nmf - Input matrix x contains at least one null row.", </div><div>        "[r=4] -> NMF::nmf - 30/30 fit(s) threw an error.\n# Error(s) thrown:\n  - run #1: NMF::nmf - Input matrix x contains at least one null row.", </div>
<div>        "[r=5] -> NMF::nmf - 30/30 fit(s) threw an error.\n# Error(s) thrown:\n  - run #1: NMF::nmf - Input matrix x contains at least one null row.", </div><div>        "[r=6] -> NMF::nmf - 30/30 fit(s) threw an error.\n# Error(s) thrown:\n  - run #1: NMF::nmf - Input matrix x contains at least one null row.")</div>
<div><br></div><div>Sure enough, there were two miRs (rows) with zero values in all samples. I'd probably seen them in setting up the original run, but was going quickly… </div><div><br></div><div>When I deleted the rows, I was able to run the nmf command on the matrix (35 data rows, 66 samples):</div>
<div class="im"><div>>res <- nmf(x, 2:6, .opt='v9')</div></div><div>...</div><div>…</div><div><div># libPaths:</div><div>   /Library/Frameworks/R.framework/Versions/2.15/Resources/library</div><div>Runs:  1  32 4 5 6 7 8* 11* 13* 10* 16* 12* 14* 15 9* 19 18 21* 24* 20 27 22** 17* 23 26 30 29 28 25* ... DONE</div>
<div># Processing partial results ... OK</div><div>System time:</div><div>   user  system elapsed </div><div> 46.820   1.128   8.759 </div><div>## Cleaning up ... </div><div># Restoring NMF options ... OK</div><div># Restoring foreach backend ... OK</div>
<div># Updating RNG settings ... OK</div><div># RNG kind:  Mersenne-Twister / Inversion </div><div># RNG state: 403L, 2L, ..., 270725601L [84247f48b334857a5b8c4b029d25909b] </div><div># Deleting directory './NMF_20f56511e3f' ... OK</div>
<div>+ measures ... OK</div></div><div>>plot(res)</div><div><br></div><div>How should NMF handle such cases? The docs likely warn against submitting zero-valued rows, and I typically never do, but this was a test case in which I was running with a selected subset of miRs. </div>
<div><br></div><div>Thanks again!</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Gordon</div></font></span><div><div class="h5"><div>
<div style="word-wrap:break-word"><div style="word-wrap:break-word"><br></div></div>
</div>
<br><div><div>On 2013-03-18, at 4:05 AM, Renaud Gaujoux wrote:</div><br><blockquote type="cite"><div dir="ltr"><div><div><div><div><div>Could you please post some reproducible example (commands, output of errors, traceback and sessionInfo)?<br>
</div>This will simplify tracing the issue.<br></div><div>If confidentiality is an issue, email only to me.<br>
<br></div>e.g.:<br><br></div># run NMF<br></div>res <- nmf(x, 2:6, .opt='v9')<br></div>traceback()<br>sessionInfo()<br><div><br></div><div>Thank you.<br></div><div>Renaud<br></div></div><div class="gmail_extra">

<br><br><div class="gmail_quote">2013/3/18 Gordon Robertson <span dir="ltr"><<a href="mailto:grobertson@bcgsc.ca" target="_blank">grobertson@bcgsc.ca</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div style="word-wrap:break-word">Renaud,<div><br></div><div>Thanks for clarifying this.</div><div><br></div><div>I asked because I tried to run NMF on a miRNA-seq abundance matrix that had 66 samples (columns) and only a small set of miRs (rows), say 20 miRs. I've used NMF routinely for larger miRNA-seq data matrices for some time (using 200-300 miRs), including on a 300-miR matrix for the same samples, but this time the survey returned only errors. I was able to get results from Matt Wilkerson's Consensus Cluster Plus package. I'll look more carefully at what happens to the NMF runs as I progressively remove miRs. </div>

<div><span><font color="#888888"><br></font></span><div><span><font color="#888888">G</font></span><div><div><br><div>
<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><div style="word-wrap:break-word">

<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><div style="word-wrap:break-word">

<br></div></span></div></span></span>
</div>
<br><div><div>On 2013-03-18, at 12:55 AM, Renaud Gaujoux wrote:</div><br><blockquote type="cite"><div dir="ltr"><div><div><div>Hi,<br><br></div>no, all genes/features are included in each run. What changes is the seed, i.e. starting point, which is different and randomly generated at each run.<br>

<br></div>Standard consensus clustering analysis would use a different set of _samples_ for each run. This is fine for evaluating the accuracy/stability of classification, but makes it difficult to link features to sample groups, since each run (vote) returns a somehow different set of component-specific feature: what set of features or basis components should be used? average? consensus?<br>


</div><div>Would be nice to incorporate a function/option to  easily perform such analysis though.<br></div><div><br></div>There is still some methodology to be developed around this point. A technical issue also arise in term of memory/speed, if one wants to compute complete feature consensus matrices.<br>


<div>I am happy to hear/discuss on this.<br></div><div>My time is currently very limited, although bringing the package back to CRAN is quite high on my todo list.<br><br></div><div>Renaud<br></div><div><br></div></div><div class="gmail_extra">


<br><br><div class="gmail_quote">2013/3/14 Gordon Robertson <span dir="ltr"><<a href="mailto:grobertson@bcgsc.ca" target="_blank">grobertson@bcgsc.ca</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div style="word-wrap:break-word"><div>From what I understand, in each iteration (of, say, 200) in a run, a random subset of genes is used. Is it possible to set the fractional value retained, e.g. 0.90, 0.95? </div><div>


Thanks,</div><div>G</div><div>
<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><div style="word-wrap:break-word">


<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><div style="word-wrap:break-word">


--</div><div style="word-wrap:break-word">Gordon Robertson<br>Michael Smith Genome Sciences Centre</div><div style="word-wrap:break-word">BC Cancer Agency<br>Vancouver BC Canada<br><a href="http://www.bcgsc.ca/" target="_blank">www.bcgsc.ca</a><br>


<br></div></span></div></span></span>
</div>
<br></div><br>_______________________________________________<br>
nmf-user mailing list<br>
<a href="mailto:nmf-user@lists.r-forge.r-project.org" target="_blank">nmf-user@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/nmf-user" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/nmf-user</a><br></blockquote></div><br><br clear="all"><br>-- <br>


<pre cols="72">Renaud Gaujoux
Computational Biology - University of Cape Town
South Africa</pre>
</div>
</blockquote></div><br></div></div></div></div></div></blockquote></div><br><br clear="all"><br>-- <br><pre cols="72">Renaud Gaujoux
Computational Biology - University of Cape Town
South Africa</pre>
</div>
</blockquote></div><br></div></div></div></div></blockquote></div><br><br clear="all"><br>-- <br><pre cols="72">Renaud Gaujoux
Computational Biology - University of Cape Town
South Africa</pre>
</div>
</blockquote></div><br></body></html>