liamrevell / phytools

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

Problem when setting priors on stem edges with make.simmap #140

Closed Lwoots closed 8 months ago

Lwoots commented 11 months ago

Hi Liam,

When using make.simmap, I have found that setting pi = c(1,0) only fully constrains the ancestral node to a given state if the root node is bifurcating, and not if the root node is a non-bifurcating stem branch. Is there a way of correcting this?

I attach a reproducible example.

Thanks, Lara

Saxifragaceae_tip_states.csv Saxifragaceae.txt simmap_example.txt

liamrevell commented 8 months ago

Lara. This should now be fixed. The issue was that make.simmap first converted any multifurcating trees to binary, performed pruning to get the conditional likelihoods, and then matched the nodes between the original & fully-resolved binary tree (indeed, the matching was the part that went astray with a non-branching root edge). This was because the old function to perform pruning only worked on a binary tree. That had long ago been fixed, but I never updated make.simmap because no one previously identified this particular case in which this issue could arise. Try updating phytools from GitHub. -- Liam