Question: Merging Bayesian probability values with bootstraps from ML
gravatar for Adrian Pelin
6.2 years ago by
Adrian Pelin2.4k
Adrian Pelin2.4k wrote:


I have an alignment which I used to produce ML (with bootstrap) and Bayesian trees. Is there any way I can use a tool that would try to superimpose the bootstrap values of the ML tree on the Bayesian tree? I would just like to have the Bayesian tree with added bootstrap support coming from the PHYML tree.

Thank you,


support phyml ml bayesian • 2.9k views
ADD COMMENTlink modified 6.2 years ago by David W4.7k • written 6.2 years ago by Adrian Pelin2.4k

How does this differ from your earlier question here?

ADD REPLYlink modified 6 months ago by RamRS27k • written 6.2 years ago by David W4.7k

Yes, good question. So there I was asking if it is possible to input into PHYML a Bayesian tree to calculate bootstrap values. That ended up being a bad idea, somehow it either gave me 100 or 0 bootstrap values. So probably not a good approach.

Here I am asking, given 2 different trees, is there any automatic approach that can copy over bootstrap values to another tree so that both values are present on one tree. It is a question more related to graphics. Right now I am doing it manually, seeing if a specific node is present in the ML tree and if yes, I add the BS value and I do it in Adobe Illustrator. Since it is a manual approach, it is prone to errors and time consuming.

ADD REPLYlink modified 6 months ago by RamRS27k • written 6.2 years ago by Adrian Pelin2.4k

while construction of trees with bayesian (BEAST PLATFORM) and maximum likelihood (ON MEGA) I am getting a slight different results with similar models. Is there any scope for publishing both the results and and if not what method I should consider and what changes I should do??

ADD REPLYlink modified 6 months ago by RamRS27k • written 4.6 years ago by nitishd.dave20
gravatar for David W
6.2 years ago by
David W4.7k
New Zealand
David W4.7k wrote:

I don't know of any software to do this, but it's possible using the R library ape

Seting up some trees with slightly different topologies and bs values as an example

f <- function(x) nj(dist.dna(x))
tr1 <- tr2 <-  f(woodmouse)

tr1$tip.label[c(2,3,9)] <- tr1$tip.label[c(2,9,3)]

tr1$node.labels <- boot.phylo(tr1, woodmouse, f, quiet=TRUE)
tr2$node.labels <- boot.phylo(tr2, woodmouse, f, quiet=TRUE)

Extract the clades from tr1, see if they exist in tr2, and is sowhich node they correspond to

clades <- function(tr) sapply(subtrees(tr), "[[", "tip.label")
A_in_B <- sapply(clades(tr1), function(A) which(sapply(clades(tr2), function(B) setequal(A,B))))

If you are not used to reading R, the apply functions are bit like for-loops, so these is a nested for-loop comparing each clade in tr1 against all clades in tr2 and seeing which match

Use the mapped nodes to create "hybrid" labels:

mapped_nodes <- sapply(A_in_B, function(x)` ` ifelse(length(x)==0, "-", as.character(tr1$node.labels[x])))
tr2$node.labels <- paste(tr2$node.labels, mapped_nodes,  sep=" / ")

From their you can save the image or write the tree (with write.tree or and open in your favorite tree drawing program

ADD COMMENTlink modified 6 months ago by RamRS27k • written 6.2 years ago by David W4.7k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 805 users visited in the last hour