Re: [R-sig-phylo] The Speed of Different Methods For Obtaining the Descendant Tip Taxa per Node

2011-03-08 Thread Marcelino de la Cruz
Maybe methods(class=class(myobjetc)) for example: library(ape) data(bird.families) class(bird.families) [1] phylo methods(class=class(bird.families)) [1] +.phyloall.equal.phylo [3] as.hclust.phyloas.matching.phylo [5] c.phylo

Re: [R-sig-phylo] The Speed of Different Methods For Obtaining the Descendant Tip Taxa per Node

2011-03-07 Thread David Bapst
Emmanuel, all- That's pretty fast, even on my cheap laptop! system.time(desc1-c(as.list(1:Ntip(res_tree)),prop.part(res_tree))) user system elapsed 0.650.000.66 As far as why I didn't try prop.part, to be honest, I had no idea that prop.part() did that. The help file says:

Re: [R-sig-phylo] The Speed of Different Methods For Obtaining the Descendant Tip Taxa per Node

2011-03-07 Thread Rob Lanfear
Hi All, On the issue of visibility of functions in R, I definitely find it a struggle to 'discover' things that I could do with a particular object. Python has this worked out in a really nice way - if I have an object I can simply put a full-stop after it and hit tab, and I get a list of all

Re: [R-sig-phylo] The Speed of Different Methods For Obtaining the Descendant Tip Taxa per Node

2011-03-07 Thread Klaus Schliep
Hi Rob, this is partly also possible in R. You can find all generic functions specificly written for an (S3) object using: methods(class=phylo) This will miss functions, which are not generic and generic function which use the default mechanism, e.g. class pml has a specific logLik.pml method,

[R-sig-phylo] The Speed of Different Methods For Obtaining the Descendant Tip Taxa per Node

2011-03-06 Thread David Bapst
Hello all, I'm currently trying to measure a parameter over a large number of large trees (1700 tips), and part of this calculation requires knowing the tip taxa descended from each node (I must compare the difference in tip values among taxa descended from a node). Because I must do this many

Re: [R-sig-phylo] The Speed of Different Methods For Obtaining the Descendant Tip Taxa per Node

2011-03-06 Thread Liam J. Revell
Hi Dave. It seems like one way to get these values faster would be to count the number of descendants as the tree is read in to R. This is possible because when the ) character is reached by the Newick parser, all descendant nodes (and tips) have already been created in memory. This was

Re: [R-sig-phylo] The Speed of Different Methods For Obtaining the Descendant Tip Taxa per Node

2011-03-06 Thread David Bapst
Klaus- Oh, that worked rather splendid! Thanks for letting me know. system.time(desc-Descendants(res_tree,edge_end)) user system elapsed 1.560.001.56 -Dave On Sun, Mar 6, 2011 at 3:22 PM, Klaus Schliep klaus.schl...@gmail.com wrote: Hi David, you can supply Descendents (from

Re: [R-sig-phylo] The Speed of Different Methods For Obtaining the Descendant Tip Taxa per Node

2011-03-06 Thread Emmanuel Paradis
Hi David and others, prop.part() with a single tree does what you want: set.seed(123) res_tree - rtree(1700) system.time(desc2 - prop.part(res_tree)) user system elapsed 0.050 0.000 0.053 edge_end - unique(res_tree$edge[,1]) system.time(desc1 - Descendants(res_tree,edge_end))