Entering edit mode
4.9 years ago
phylofun
▴
50
I want to calculate the relative time from the tree root to the species' creation node for all species in my phylogeny. Is this possible in R?
By time, do you mean actual time - like dates? Or do you just want to know the distance?
These are 2 very different questions.
I’m curious how to do both. Thanks!
To get accurate dates you either need an appropriate molecular clock for your sequences, or ideally actual sequences corresponding to the deep nodes of the tree.
What data do you have?
I used a relaxed molecular clock, my tree is ultrametric
Any ideas on what R code I could use then?
My R isn't fantastic, so I can't give you working code for this, but I'd be amazed if there isn't something in
ape
orphangorn
packages to calculate this. I would consult their documentation.I'd typically do these types of analyses in python with
dendropy
orete3
.Thanks! Question, would this do the job? https://www.rdocumentation.org/packages/ape/versions/5.3/topics/branching.times
Looks promising! Combine that with one or other of their tree traversal methods and you should be able to get a measure of all the relevant paths through the tree
Do you know what function does the tree traversal method in ape? I can't find what I'm looking for in the manual