Search code examples
rstatisticsnormalizationphylogenyape-phylo

Normalizing a Phylogenetic Tree in R


When working with phylogenetic tree data in R (specifically when working with "phylo" or "phylo4" objects) it would be useful to normalize branch lengths so that certain taxa (the ones that evolve faster) do not contribute a disproportionate amount of branch length to the tree. This seems to be common in computing UniFrac values, as can be found in the discussion here: http://bmf2.colorado.edu/unifrac/help.psp. (I need more than just UniFrac values, however).

However, I cannot find a function that performs this normalization step. I have looked in ape, picante, adephylo, and phylobase. Could someone direct me to a package that includes this function, or a package that makes writing this kind of function straightforward?


Solution

  • Are you looking for a function to just scale the branch lengths of a tree? If so, compute.brlen() in ape will do it. There are built in options for Grafen's rho and all = 1. You can also supply your own function.

    I don't know if UniFrac does some other kind of branch length scaling. But if so, you could write your function and pass it.