Skip to content

Commit

Permalink
Merge pull request #1436 from bgyori/hgnc_update
Browse files Browse the repository at this point in the history
Update resource files
  • Loading branch information
bgyori authored Feb 5, 2024
2 parents 90f9ffa + 2a4dca3 commit 1280389
Show file tree
Hide file tree
Showing 28 changed files with 1,118,080 additions and 444,628 deletions.
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

0 comments on commit 1280389

Please sign in to comment.