Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

robinson_foulds with 'unrooted_trees' and 'correct_by_polytomy_size' should probably not correct the root? #745

Open
Gullumluvl opened this issue Mar 14, 2024 · 0 comments

Comments

@Gullumluvl
Copy link

Gullumluvl commented Mar 14, 2024

Hi,

I am currently using the version Ete3 but the current robinson_foulds source code from this repository is identical:

ete/ete4/core/tree.pyx

Lines 1286 to 1288 in 0f986e0

if correct_by_polytomy_size:
corr1 = sum(len(n.children) - 2 for n in origin_t.traverse() if len(n.children) > 2)
corr2 = sum(len(n.children) - 2 for n in target_t.traverse() if len(n.children) > 2)

I think that the root node should be handled specially in the polytomy size correction when using unrooted_trees=True.

Otherwise, despite having a tree that is fully bifurcating, except at the root because of the convention for unrooted trees, you get the following error:

TreeError: 'Both trees contain polytomies! Try expand_polytomies=True instead'

I think that an update could be to check that the root node degree is greater than 3 when unrooted_trees is activated.

Best,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant