From 9d56b8c3318c570752a6367904937e6e0b4efaf5 Mon Sep 17 00:00:00 2001 From: Matthew Andres Moreno Date: Wed, 29 Mar 2023 20:17:16 -0700 Subject: [PATCH] Fix unexpected rooting side effects of Tree.mrca() Sets `collapse_unrooted_basal_bifurcation=False` in call to `Tree.encode_bipartitions` inside `Tree.mrca`. Closes #152. --- src/dendropy/datamodel/treemodel/_tree.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/dendropy/datamodel/treemodel/_tree.py b/src/dendropy/datamodel/treemodel/_tree.py index 55793e8c..f95b89aa 100644 --- a/src/dendropy/datamodel/treemodel/_tree.py +++ b/src/dendropy/datamodel/treemodel/_tree.py @@ -1550,7 +1550,10 @@ def mrca(self, **kwargs): if start_node.edge.bipartition.leafset_bitmask == 0 or not kwargs.get( "is_bipartitions_updated", True ): - self.encode_bipartitions(suppress_unifurcations=False) + self.encode_bipartitions( + suppress_unifurcations=False, + collapse_unrooted_basal_bifurcation=False, + ) if ( start_node.edge.bipartition.leafset_bitmask & leafset_bitmask