Merging Bayesian probability values with bootstraps from ML
1
0
Entering edit mode
7.6 years ago
Adrian Pelin ★ 2.5k

Hello,

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,

Adrian

ML PHYML Bayesian Support • 3.5k views
ADD COMMENT
0
Entering edit mode

How does this differ from your earlier question here?

ADD REPLY
0
Entering edit mode

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

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 REPLY
0
Entering edit mode
7.6 years ago
David W 4.8k

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

data(woodmouse)
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=" / ")
plot(tr2)
nodelabels(tr2$node.labels)

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

ADD COMMENT

Login before adding your answer.

Traffic: 2634 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