Dear Lev and all, First, to answer the actual question in your postscriptum, ape's branching.times() is not for non-ultrametric trees, but it does silently accept them as input, unfortunately. The branching.times it returns assume that some tip (the first tip?) is at time=0, which means that often some branching times returned will be negative. For example:
``` > set.seed(1) > tree<-rtree(10) > branching.times(tree) 11 12 13 14 15 16 0.73870912 0.02109061 -0.35894457 0.52656660 -0.12510717 -0.25066226 17 18 19 -0.63677636 0.18621760 -0.29586251 ``` Yuck. From the documentation for branching.times, we can see that we should never pass branching.times() a non-ultrametric tree: "This function computes the branching times of a phylogenetic tree, that is the distance from each node to the tips, under the assumption that the tree is ultrametric. Note that the function does not check that the tree is effectively ultrametric, so if it is not, the returned result may not be meaningful." Indeed, the result from the above example is pretty meaningless. If branching.times() is used in functions that may be passed non-ultrametric trees, this can result in all sorts of chaos. For example, in fitContinuous in geiger: https://github.com/mwpennell/geiger-v2/issues/20 Secondly, I feel that it should be pointed out that Dan and Liam are referring to methods for obtaining branching times from non-ultrametric tree that are non-ultrametric and time-scaled: i.e. they are non-ultrametric because the OTUs were sampled across some interval of time (such as a phylogeny of fossil taxa, or a phylogeny of rapidly evolving viruses). If your tree is non-ultrametric because it isn't yet scaled to time, then all the methods they suggest will treat it as if its a time-scaled non-ultrametric tree and give back probably very strange answers if all your taxa are actually at a single time-slice (perhaps the modern day, for example, time=0). To get meaningful branching times, you need to first scale the branch lengths to time. Finally, just to pile on even more alternatives to calculate branching times for non-ultrametric time-scaled trees (I jest, I jest), packages paleotree and strap have functions dateNodes() and getNodeAges() respectively. Both of these will date nodes/tips in absolute time for paleontological phylogenies where the root age is stored as a $root.time element. This can be a very handy feature if your tip taxa died out a few hundred million years ago. I hope this helps, -Dave Bapst On Tue, Jan 12, 2016 at 5:37 PM, Yampolsky, Lev <yampo...@mail.etsu.edu> wrote: > Dear Colleagues, > > Does anyone know what is the difference between ape’s branching.times() and > laser’s getBtimes()? > And why they may be giving rather different results, particularly for > internal branches? (From an ultrametric tree created by > chronotree <- chronos(tree, lambda = 1, model = "correlated", quiet = FALSE, > calibration = makeChronosCalib(tree), control = chronos.control()) > > Thank you very much in advance for your help! > > PS. A related but less important question: I am curious how does > branching.times() calculate branching times from a non-ultrametric tree? > > -- > Lev Yampolsky > > Professor > Department of Biological Sciences > East Tennessee State University > Box 70703 > Johnson City TN 37614-1710 > Cell 423-676-7489 > Office/lab 423-439-4359 > Fax 423-439-5958 > > _______________________________________________ > R-sig-phylo mailing list - R-sig-phylo@r-project.org > https://stat.ethz.ch/mailman/listinfo/r-sig-phylo > Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/ -- David W. Bapst, PhD Adjunct Asst. Professor, Geology and Geol. Eng. South Dakota School of Mines and Technology 501 E. St. Joseph Rapid City, SD 57701 http://webpages.sdsmt.edu/~dbapst/ http://cran.r-project.org/web/packages/paleotree/index.html _______________________________________________ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/