Re: [R-sig-phylo] Newick tree merging at the wrong level?

2016-11-02 Thread Liam J. Revell
Excellent. I have added those function to phytools on GitHub, so they can be installed using devtools as follows: library(devtools) install_github("liamrevell/phytools") Glad it was of help. - Liam Liam J. Revell, Associate Professor of Biology University of Massachusetts Boston web:

Re: [R-sig-phylo] Newick tree merging at the wrong level?

2016-11-02 Thread Carlos Porto Filho
Thank you very much! That actually solved my problem. I couldn't express myself clearly but that was what I wanted.. that nodes with the same maximum path length to the tips should have the same height.. >From a layman perspective that way to compute branch lengths is actually more logic for a

Re: [R-sig-phylo] Newick tree merging at the wrong level?

2016-11-02 Thread Liam J. Revell
Hi Carlos. After thinking about this, I realized that what you probably want is not a node depth based on the number of nodes above that node - but the based on the maximum number of nodes separating that node from any leaf. I just posted a second solution for this on my blog here:

Re: [R-sig-phylo] Newick tree merging at the wrong level?

2016-11-01 Thread Liam J. Revell
Hi Carlos. The edge lengths used for plotting (and thus the 'merge depths') are completely arbitrary when none are supplied. The algorithm used to compute the edge lengths is in the documentation for compute.brlen as follows: "Grafen's (1989) computation of branch lengths: each node is

[R-sig-phylo] Newick tree merging at the wrong level?

2016-11-01 Thread Carlos Porto Filho
Dear list, TL;DR: When I plot the newick tree A,B),C,D),E),(((F,G),H),I)); shouldn't ((A,B),C,D) merge at the same level as ((F,G),H)? Or in a phylogenetic tree it doesn't matter? library(ape) newickTree <- read.tree(text="A,B),C),E),(((F,G),H),I));") plot(newickTree) goes just fine but