Re: [R-sig-phylo] A possible alternate MRCA function to APE's getMRCA

2017-06-07 Thread Joseph W. Brown
w00t! I am aware that `which` is inefficient, but wasn't sure how to get around it in this instance. Thanks! It would be great to have this in the new version! Joseph. Joseph W. Brown Post-doctoral Researcher, Smith Laboratory University of Michigan

Re: [R-sig-phylo] A possible alternate MRCA function to APE's getMRCA

2017-06-07 Thread Klaus Schliep
Hi Joseph, just a few changes on your code and it is actually really fast. Having multiple calls to which() is often slow. Replacing which() with a simple lookup table will speed your code up quite a bit as you can see below. This is actually how the function Ancestors() in phangorn works. But

[R-sig-phylo] A possible alternate MRCA function to APE's getMRCA

2017-06-07 Thread Joseph W. Brown
I've been working with some very large trees (tens to hundreds of thousands of tips) where the speed of APE's getMRCA function has been prohibitively slow. I therefore R-ified an MRCA function I developed in Java for use with the Open Tree of Life tree (~3 million tips). I don't pretend to be