Biostar Beta. Not for public use.
Question: Phylogeny: tree branch length on a log scale
0
Entering edit mode

Hello,

I have a tree with 58 taxa, and 10 of them are more related to each other than the rest. The problem becomes those 10 have very small branch lengths and I can't tell just by looking at a tree or without zooming in what the relationship between them is.

Is there any way to convert the branch lengths into a LOG scale? that way bigger branches become shorter. I am looking through all FigTree options but do not see it happening.

Thanks, Adrian

ADD COMMENTlink 2.6 years ago Adrian Pelin ♦ 2.3k
Entering edit mode
1

I haven't found an option either. Maybe you could import the tree into R using package ape and then log the branch lengths and export.

ADD REPLYlink 2.6 years ago
Michael Dondrup
46k
Entering edit mode
0

Great idea! It took a little playing around with. Turns out, most branch distances are below 1 in numerical values... who would have thought? so naturally the first tree looked really funny with branches extending to the left as a result of taking the log of sub 1 values.

To get around this I essentially did:

library("ape")
tree <- read.nexus("mrbayes.con.tree")
tree$edge.length <- (log(tree$edge.length)+(min(log(tree$edge.length))*-1))
# or this gives the same
tree$edge.length <- log(tree$edge.length*(1/min(tree$edge.length)))
write.nexus(tree, file="mrbayes.LOG.con.tree"); # tip: don't forget the "file=" part, you get an odd error

So now most branches look about the same in length, which is not ideal, but you can still tell divergent species and tree structure is much more understandable. I suppose I will play around and try a log2 instead.

My only issue is that information to the BPP have vanished when writing the new tree. Any idea how to get those stats back?

ADD REPLYlink 2.6 years ago
Adrian Pelin
♦ 2.3k
Entering edit mode
0

As you imported your data into R, you could plot the tree directly from ape with plot.phylo(), or play around with ggtree (which seems great but I never used).

ADD REPLYlink 2.6 years ago
h.mon
25k
Entering edit mode
0

Possibly, Grafen's rho transformation mentioned here might be of interest: http://www.anthrotree.info/wiki/pages/B3q1U4P/5.html The examples are given for Mesquite and ape. It will avoid the problem with negative branch lengths, for rho = 0.5 it is the same as square-root transformation.

I don't know why some of the stats are lost in the process. The nexus format is quite complex, possibly, some portion is not supported.

ADD REPLYlink 2.6 years ago
Michael Dondrup
46k

Login before adding your answer.

Similar Posts
Loading Similar Posts
Powered by the version 2.0