Closed AEgit closed 1 year ago
Hi @AEgit. Thanks for bringing this to my attention. I believe it is now fixed. Please try updating phytools from GitHub and let me know if you find this function is working again as it should. (Thanks also for the pull request. I ended up adding an optional argument, rooted
, as you suggested, but also with an internal check to set its value.)
-- Liam
I took ages to reply, but here I go: Thanks for fixing the problem!
The implementation of
consensus()
in ape changed from version 5.5 to 5.6 adding the new parameterrooted
with default settingFALSE
(see: https://github.com/cran/ape/commit/10898aebdf6661a0b81ba21bf24969336b544a60#diff-39f99c034d3383f59d20b396e9d7fa009fabd32db58ab40ff1e284a6a8468c01). This has implications for the phytools functionconsensus.edges()
, which relies on theconsensus()
function of ape. Due to this change all consensus trees produced byconsensus.edges()
are unrooted (!). This behaviour is not desirable and differs from the previous behaviour of the function, which produced rooted consensus trees for (rooted) input trees.Solution: Add the argument
rooted
to the functionconsensus.edges()
.The code below exemplifies the problem and provides the solution (with the attached updated
consensus.edges()
function, that adds the new argumentrooted
):Updated consensus.edges.root function: consensus.edges.root.txt