Skip to content

Commit

Permalink
add functioning entity index
Browse files Browse the repository at this point in the history
  • Loading branch information
sierra-moxon committed Jan 27, 2025
1 parent c6bbd9e commit f63310b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions scripts/gen-model-meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@
import sys
import logging
from pathlib import Path

from oaklib import get_implementation_from_shorthand
import click

# Logger basic setup
logging.basicConfig(level=logging.INFO)
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."""
Expand Down Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions scripts/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
3 changes: 2 additions & 1 deletion scripts/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ ontobio==2.8.4
click
pyparsing==2.4.7
antlr4-python3-runtime==4.9.3
click
click
oaklib

0 comments on commit f63310b

Please sign in to comment.