liamrevell / phytools

GNU General Public License v3.0
198 stars 56 forks source link

Clarification on the ace output of simmap summary #112

Closed flashton2003 closed 2 years ago

flashton2003 commented 2 years ago

Hi Liam,

Firstly, thanks for all your efforts on the phytools package & its documentation.

I'm running simmap in the below fashion (as you previously documented for me).

trees<-mclapply(1:4,function(n,tree,x,fixedQ) make.simmap(tree,x,Q=fixedQ,nsim=25), tree=tree,x=x,fixedQ=fittedQ,mc.cores= 4L)
trees<-do.call(c,trees)
if(!("multiSimmap"%in%class(trees))) class(trees)<-c("multiSimmap",class(trees))

obj <- summary(trees)
obj$ace

The top of the obj$ace dataframe looks like this:

                 China Thailand Vietnam
31                0.00     1.00    0.00
32                0.99     0.01    0.00

Will the first node listed in the obj$ace dataframe always be the common ancestor of all the samples in the tree?

Thanks again,

Phil

liamrevell commented 2 years ago

If the tree is rooted, then yes.

To plot the tree with their node indices (the row labels of obj$ace in your example) try running:

plot(tree) nodelabels()

flashton2003 commented 2 years ago

Brilliant, thank you.