[Phylobase-devl] Treewalking in ape

Peter Cowan pdc at berkeley.edu
Fri Nov 21 23:46:52 CET 2008

Apologies, I forgot to cc the list.


There are only two potential problems I can think of.  First there  
could be a performance hit for phylo4d objects if they need to be  
converted to phylo4 objects and verified before walking the tree (that  
said, I don't know how processor intensive this is).  This could be  
significant if the function is called repeatedly on a tree, which is  
the typical use, right?  The simple work around could be something like:

if(!inherits(phy, 'phylo4')) {
	phy <- as(phy, "phylo4")

The other potential problem is that doesn't this require the data  
model for phylo and phylo4 object to maintain their current  
similarity.  That is,  nodes need to be numbered in the same way for  
both objects, right?  As far as I know that's currently the case and  
it may not change. But, we have talked about including features like  
singleton nodes.  Perhaps I've misunderstood how these will work.


On Nov 21, 2008, at 2:39 AM, Thibaut Jombart wrote:

> Dear list,
> Here is another question concerning treewalk procedures.
> I actually believe that these functions are very helpful, but they  
> apply
> to trees, not to tree+data structures. Hence, they could be part of  
> ape
> as well as part of phylobase. This being said, I realize it is fair to
> have them in phylobase, since they must be applicable to phylo4 as  
> well,
> and for now ape is 'only' about phylo objects.  But as a user, I would
> like to be able to treewalk with phylo objects as well. This is
> straightforward since we can add a
> as(phy, "phylo4")
> at the begining of each treewalk function. Are there good reasons  
> not to
> do so I am missing? If not, I would like to allow this extension to  
> all
> functions inside treewalk.R (and I would be glad to commit that asap).
> Cheers,
> Thibaut.
> _______________________________________________
> Phylobase-devl mailing list
> Phylobase-devl at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/phylobase-devl

More information about the Phylobase-devl mailing list