diff --git a/scripts/gen-model-meta.py b/scripts/gen-model-meta.py index 23ae7d43..422df2ed 100644 --- a/scripts/gen-model-meta.py +++ b/scripts/gen-model-meta.py @@ -11,7 +11,7 @@ import sys import logging from pathlib import Path - +from oaklib import get_implementation_from_shorthand import click # Logger basic setup @@ -19,6 +19,8 @@ LOG = logging.getLogger("gen-model-meta") LOG.setLevel(logging.WARNING) json_path = Path("/tmp/gocams/") +ontology = get_implementation_from_shorthand("https://purl.obolibrary.org/obo/go.json") + def die_screaming(instr): """Exit in a way that will get attention.""" @@ -50,7 +52,7 @@ def process_json_files(keys_to_index, output_dir, path_to_json=json_path): # Create indices for the current file individuals = read_data.get("individuals", []) - if "bioentity_id" or "term_id" in keys_to_index: + if "entity" in keys_to_index: for individual in individuals: types = individual.get("type", []) for entity_type in types: diff --git a/scripts/pyproject.toml b/scripts/pyproject.toml index 35c21a4f..d5cbe2d2 100644 --- a/scripts/pyproject.toml +++ b/scripts/pyproject.toml @@ -13,6 +13,7 @@ click = "*" pyparsing = "2.4.7" antlr4-python3-runtime = "4.9.3" docutils = "0.21.2" +oaklib = "^0.6.18" [build-system] requires = ["poetry-core>=1.0.0"] diff --git a/scripts/requirements.txt b/scripts/requirements.txt index 9934a0e3..0d9b9e87 100644 --- a/scripts/requirements.txt +++ b/scripts/requirements.txt @@ -3,4 +3,5 @@ ontobio==2.8.4 click pyparsing==2.4.7 antlr4-python3-runtime==4.9.3 -click \ No newline at end of file +click +oaklib \ No newline at end of file