Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update resource files #1436

Merged
merged 25 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions indra/databases/obo_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def entries_from_graph(obo_graph, prefix, remove_prefix=False,
'namespace': namespace,
'id': node,
'name': data['name'],
'synonyms': synonyms,
'synonyms': sorted(set(synonyms), key=lambda x: x.casefold()),
'xrefs': xrefs,
'alt_ids': alts,
'relations': rels_dict,
Expand Down Expand Up @@ -323,7 +323,10 @@ def update_resource(

def sort_key(x):
val = x['id']
if not remove_prefix:
# The second condition here is relevant
# for external prefixed (and allowed) terms like
# BFO
if not remove_prefix or ':' in val:
val = val.split(':')[1]
try:
val = int(val)
Expand Down Expand Up @@ -379,15 +382,18 @@ def update_by_prefix(
{
'id': term.identifier,
'name': term.name,
'synonyms': [synonym.name for synonym in term.synonyms],
# Synonyms can be duplicated in OBO due to different provenance
# so we deduplicate here
'synonyms': sorted({synonym.name for synonym in term.synonyms},
key=lambda x: x.casefold()),
'xrefs': [
dict(namespace=xref.prefix, id=xref.identifier)
for xref in term.xrefs
],
'alt_ids': [
'alt_ids': sorted([
alt_id.identifier
for alt_id in term.alt_ids
],
]),
'relations': _get_pyobo_rels(
term,
include_relations=include_relations,
Expand Down
2 changes: 1 addition & 1 deletion indra/ontology/bio/ontology.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class BioOntology(IndraOntology):
# should be incremented to "force" rebuilding the ontology to be consistent
# with the underlying resource files.
name = 'bio'
version = '1.32'
version = '1.33'
ontology_namespaces = [
'go', 'efo', 'hp', 'doid', 'chebi', 'ido', 'mondo', 'eccode',
]
Expand Down
Loading