Replies: 1 comment 1 reply
-
|
For reference for others with the same issue and in case someone can say anything about the implications/caveats of my workaround: Can anyone tell me if I can use that function like this or am I likely running into troubles at some point (which might be the reason why this is "hidden" and not documented anywhere for direct usage)? With the below solution in a module, I can just call for different tools the from ete3 import NCBITaxa
from ete3.ncbi_taxonomy.ncbiquery import is_taxadb_up_to_date
import warnings
class NCBITAXDBWarning(UserWarning):
"""
Warning raised when NCBI Taxonomy Database is newly built or updated
"""
pass
def check_NCBI_taxDB() -> NCBITaxa:
if not is_taxadb_up_to_date():
warnings.warn(
"No valid NCBI Taxonomy Database found. Building NCBI Taxonomy "
"Database. This might take a while...",
NCBITAXDBWarning,
)
ncbi = NCBITaxa()
return ncbi
def update_NCBI_taxDB():
warnings.warn("Updating NCBI Taxonomy Database...", NCBITAXDBWarning)
ncbi = NCBITaxa()
ncbi.update_taxonomy_database() |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to package a toolkit on PyPI that should be installable with pip (and uv) and some tools in it use
NCBITaxafromete3.What is the best way to make sure a local
NCBITaxadb exists? I searched for it, but just found old (ete2) discussions about it or the hint that this is not possible at all.Best way would be to build the db directly after installation of
ete3, which is not possible with apyproject.tomlfile as far as I can see. Is there a way fromete3to trigger this behaviour during installation from PyPI (or inete4, butete4is not available on PyPI yet, correct)?Even if I call a separate script/function to check/build/update
NCBITaxadb before a GUI script is run, I'm missing how the code block should look like to check ifNCBITaxa()will trigger a complete new build of the db, to make sure there's a warning if the db needs to be built and this will take a while before the actual GUI tool is launched.Any hints and ideas or workarounds would be very much appreciated.
My example code to explain what I'm looking for:
Beta Was this translation helpful? Give feedback.
All reactions