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

RF distance #16

Open
jeromekelleher opened this issue Jul 5, 2022 · 1 comment
Open

RF distance #16

jeromekelleher opened this issue Jul 5, 2022 · 1 comment

Comments

@jeromekelleher
Copy link
Owner

We want an implementation of RF distance to compare trees with equal sample sets.

Here's some code to compute RF distance using dendropy:

def dendropy_rf_distance(ds1, ds2):
    tns = dendropy.TaxonNamespace()
    tree1 = dendropy.Tree.get(
        data=pk.to_newick(ds1),
        schema="newick",
        taxon_namespace=tns)
    tree2 = dendropy.Tree.get(
        data=pk.to_newick(ds2),
        schema="newick",
        taxon_namespace=tns)
    tree1.encode_bipartitions()
    tree2.encode_bipartitions()
    return dendropy.calculate.treecompare.symmetric_difference(tree1, tree2)
@Billyzhang1229
Copy link
Contributor

Billyzhang1229 commented Jul 28, 2022

Implemented Unweighted Robinson-Foulds Distance using Python set operations

Now working on an efficient Numba version

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

2 participants