Closed SimonGreenhill closed 2 years ago
Hey Simon,
Thanks for the heads up and example. I can definitely make that change to the output.
The main reason for naming them as an integer (rather than the original state names) is to cut down on matching functions internally. I.e., rather than constantly matching the input name to its position in the Q matrix, I can just use the ID integer value for any indexing. But, the output could (and should) be changed to match the input.
I'll get to this within a week or so.
Best, James
You'll need to install this newest github version, but the output names should now match the input names.
> model <- MK$solution
> simmap.corhmm <- makeSimmap(tree=phy, data=data, model=model, rate.cat=1, nSim=1, nCores=1)
> # Note column labels are '1', '2' not the "A", "B" found as our trait states.
> head(simmap.corhmm[[1]]$mapped.edge)
A B
61,62 5.709144 4.151568
62,63 5.672618 4.851147
63,64 3.420088 3.826214
64,65 0.000000 6.678406
65,66 0.000000 0.000000
66,3 8.431907 7.258906
Best, James
Awesome, thanks @jboyko!
makeSimmap
returns mapped edges labelled according to trait state ID (an integer) rather than the original state value. This makes direct interoperability with phytools::make.simmap and tools harder.I'm not sure how high interoperability is on your priority list, but given you use phytools to plot simmap results in the examples then it would be nice to have consistency.
Here's some code that shows the problem: