Question: Merging Bayesian probability values with bootstraps from ML
0
gravatar for Adrian Pelin
5.3 years ago by
Adrian Pelin2.3k
Canada
Adrian Pelin2.3k wrote:

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

support phyml ml bayesian • 2.5k views
ADD COMMENTlink modified 5.3 years ago by David W4.7k • written 5.3 years ago by Adrian Pelin2.3k

How does this differ from your earlier question here Phylogenetic analysis, combining Bayesian and Maximum Likelihood ?

ADD REPLYlink written 5.3 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 written 5.3 years ago by Adrian Pelin2.3k
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 written 3.7 years ago by nitishd.dave20
0
gravatar for David W
5.3 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

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 *applies 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 COMMENTlink modified 5.3 years ago • written 5.3 years ago by David W4.7k
Please log in to add an answer.

Help
Access

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