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

Improve support for the "clade" rank #17

Open
apcamargo opened this issue Aug 4, 2024 · 0 comments
Open

Improve support for the "clade" rank #17

apcamargo opened this issue Aug 4, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@apcamargo
Copy link
Owner

As detailed in #14, the "clade" rank is problematic for taxopy because multiple taxa in a lineage can be assigned to this rank. This affects rank_name_dictionary, rank_taxid_dictionary, and __repr__.

taxon = taxopy.Taxon(33213, taxdb)
print(taxon.name)
print(taxon.rank_name_dictionary)
print(taxon.rank_taxid_dictionary)
print(taxon)
Bilateria
OrderedDict({'clade': 'Opisthokonta', 'kingdom': 'Metazoa', 'superkingdom': 'Eukaryota'})
OrderedDict({'clade': 33154, 'kingdom': 33208, 'superkingdom': 2759})
s__Eukaryota;k__Metazoa;c__Opisthokonta

In the example above, "Bilateria" doesn't appear in the name and taxid dictionaries nor in its __repr__. This is because "Bilateria" is the third taxon assigned to the "clade" rank in its lineage:

print(taxon.ranked_name_lineage)
[('clade', 'Bilateria'), ('clade', 'Eumetazoa'), ('kingdom', 'Metazoa'), ('clade', 'Opisthokonta'), ('superkingdom', 'Eukaryota'), ('no rank', 'cellular organisms'), ('no rank', 'root')]
@apcamargo apcamargo added the bug Something isn't working label Aug 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant