Skip to content
Open
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
4 changes: 4 additions & 0 deletions relation_engine/ontologies/obograph/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ def __init__(self, obo, ontology_id_prefix, graph_id=None):
raise ValueError(f'Found unprocessable node types {unknown_types}')
self._ont_prefix = ontology_id_prefix
self._property_map = self._get_property_map(obo)
self._deprecated_nodes = {}

def _get_property_map(self, obo):
ret = {}
Expand Down Expand Up @@ -196,6 +197,7 @@ def _is_valid_node(self, node, deprecated_ok=False):
if not deprecated_ok and meta.get(_OBO_DEPRECATED):
# may want some sort of special loader for loading pre-expired deprecated nodes
# needs more thought
self._deprecated_nodes[id_] = True
return False
return True

Expand Down Expand Up @@ -269,6 +271,8 @@ def get_edge_provider(self):
to = self._clean_obo_id(obj)
if not from_.startswith(self._ont_prefix) or not to.startswith(self._ont_prefix):
continue
if from_ in self._deprecated_nodes or to in self._deprecated_nodes:
continue
pred = e[_OBO_PREDICATE]
if pred in self._property_map:
pred = self._property_map[pred]
Expand Down