nodes = (exampleTree$Nnode+2):(exampleTree$Nnode*2+1) # This gives me the number associated with each internal node
reRootAnc = t(sapply(nodes, function(x) {
tr = reroot(exampleTree, node = x, position = 0) # rerooting the tree at each internal node
reconst = ace(x = discrete, phy = tr, type = "discrete", model = "SYM") # estimating the maximum likelihood ancestral state estimate
reconst$lik.anc[1,] # taking only the value for the root
}))
This is the result I got for an example tree:
Seems a little strange to me...I wonder what might be going on.
No comments:
Post a Comment