Problem with duplicate ranks in the lineage
I noticed a problem with the human lineage (may apply to other lineages, too), which contains ranks with the same name in different positions of the lineage. If you look at the [human lineage](https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?mode=Info&id=9606&lvl=3&lin=f&keep=1&srchmode=1&unlock), you can see that it contains the clade Opisthokonta and another clade Eumetazoa. This is, of course, a problem when using a dictionary structure where keys need to be unique. So when you look at the `rank_name_dictionary`
```py
taxopy.Taxon(9606, taxopy.TaxDb()).rank_name_dictionary
```
```
OrderedDict([('species', 'Homo sapiens'),
('genus', 'Homo'),
('subfamily', 'Homininae'),
('family', 'Hominidae'),
('superfamily', 'Hominoidea'),
('parvorder', 'Catarrhini'),
('infraorder', 'Simiiformes'),
('suborder', 'Haplorrhini'),
('order', 'Primates'),
('superorder', 'Euarchontoglires'),
('clade', 'Opisthokonta'),
('class', 'Mammalia'),
('superclass', 'Sarcopterygii'),
('subphylum', 'Craniata'),
('phylum', 'Chordata'),
('kingdom', 'Metazoa'),
('superkingdom', 'Eukaryota')])
```
the clade Eumetazoa is missing. I don't know for how many more taxa this applies. I don't see an easy solution other than making these list of tuples rather than ordered dictionaries, but you may have better ideas.
关闭于 2024-06-08 8 条评论