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

PangoSc2Nomenclature.taxonomy_tree() breaks when trying to make tree for all Pango lineages #10

Open
afmagee42 opened this issue Sep 11, 2024 · 0 comments

Comments

@afmagee42
Copy link
Collaborator

Attempting to create a Pango tree for all lineages leads to runtime errors.

Namely, this code

import cladecombiner as cc
import polars as pl


url = "https://github.com/cov-lineages/pango-designation/raw/master/lineages.csv"
lineages = pl.read_csv(url)["lineage"].unique().to_list()

pn = cc.PangoSc2Nomenclature()
pn.setup_alias_map()

taxa = [cc.Taxon(l, is_tip=True) for l in lineages if pn.is_valid_name(l)]

tree = pn.taxonomy_tree(taxa)

produces this error

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/rzg0/git-repos/cladecombiner/cladecombiner/nomenclature.py", line 401, in taxonomy_tree
    return super().taxonomy_tree(
  File "/home/rzg0/git-repos/cladecombiner/cladecombiner/nomenclature.py", line 279, in taxonomy_tree
    raise RuntimeError(
RuntimeError: Malformed tree has multiples of tip taxa: C.1 (x2), C.3 (x2), C.2 (x2)
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