Phylogeny: tree branch length on a log scale
0
0
Entering edit mode
6.7 years ago
Adrian Pelin ★ 2.6k

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

FigTree phylogeny • 4.1k views
ADD COMMENT
1
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY

Login before adding your answer.

Traffic: 2694 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6