This is a test version of Biostars. For the public version, visit https://www.biostars.org.
compute distance to root of phylogenetic tree

Does anyone know how to compute the patristic distance between the root node of a phylogenetic tree and every taxon within that tree? Ideally using Dendropy, but will take anything.

phylogenetics microbiology

1 answer

Yes, you can try this:

Create a tree

require(ape)
require(phylobase)
x <- as(rtree(50), 'phylo4')

treePlot(x, type = 'fan')

gggg

Compute patristic distances from root

require(adephylo)
distances <- distRoot(x, method = 'patristic')
distances <- as.data.frame(distances)

head(distances)
    distances
t45  3.527083
t17  4.705088
t35  4.619831
t30  3.971527
t34  5.263497
t2   5.297168

Kevin

Log in to answer this question.