Skip to content

Commit

Permalink
Add fallback option to download and convert ncbitaxon obo graph
Browse files Browse the repository at this point in the history
  • Loading branch information
nanglo123 committed Sep 20, 2024
1 parent efe1ff6 commit 9386894
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mira/dkg/construct.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
from mira.dkg.resources.geonames import get_geonames_terms
from mira.dkg.resources.extract_eiffel_ontology import get_eiffel_ontology_terms
from mira.dkg.resources.uat import get_uat
from mira.dkg.generate_obo_graphs import download_convert_ncbitaxon_obo_to_graph

MODULE = pystow.module("mira")
DEMO_MODULE = MODULE.module("demo", "import")
Expand Down Expand Up @@ -462,7 +463,8 @@ def extract_ontology_subtree(curie: str, add_subtree: bool = False):
cached_relabeled_obo_graph_path = prefix_directory_join(resource_prefix,
name="relabeled_obo_graph.pkl",
version=version)

if not cached_relabeled_obo_graph_path.exists():
download_convert_ncbitaxon_obo_to_graph()
with open(cached_relabeled_obo_graph_path,'rb') as relabeled_graph_file:
relabeled_graph = pickle.load(relabeled_graph_file)
else:
Expand Down

0 comments on commit 9386894

Please sign in to comment.