Skip to content

support synonym or equivalent name when calling taxid_from_name #5

@ShannonDaddy

Description

@ShannonDaddy

Hi, when I call function taxid_from_name to get taxid, I get some warnings.

my code:
import taxopy

ncbi_taxdb_dir = "database/ncbi_taxonomy"
taxdb = taxopy.TaxDb(nodes_dmp=f"{ncbi_taxdb_dir}/nodes.dmp",
names_dmp=f"{ncbi_taxdb_dir}/names.dmp",
merged_dmp=f"{ncbi_taxdb_dir}/merged.dmp",
keep_files=True)
taxid_list = taxopy.taxid_from_name('Lactobacillus fermentum', taxdb)
print(taxid_list)

the console output:
[]
C:\Users\AppData\Local\Programs\Python\Python38\lib\site-packages\taxopy\utilities.py:54: Warning: The input name was not found in the taxonomy database.
warnings.warn("The input name was not found in the taxonomy database.", Warning)

Then, I checked the names.dmp and found that 'Lactobacillus fermentum' is a synonym, the scientific name is 'Limosilactobacillus fermentum'. When I use the scientific name in the code, the output is fine.

Is it possible to support synonym or equivalent name when calling taxid_from_name just like another python package ete3 would do?

Thanks a lot!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions