biolink / ontobio

python library for working with ontologies and ontology associations
https://ontobio.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
118 stars 30 forks source link

get_minimal_subgraph gives "RecursionError: maximum recursion depth exceeded" #596

Open realmarcin opened 2 years ago

realmarcin commented 2 years ago

When trying to obtain the GO subgraph for 800 input terms, as here: https://github.com/kbaseIncubator/KE_KG/blob/main/src/embeddings/GO_ontobio.ipynb

I am running into the recursion limit RecursionError: maximum recursion depth exceeded.

I can set the limit all the way up to 30000 using the python sys command, however that still chokes on the above use case. Increasing this limit higher crashes the notebook …

An initial guess was that get_minimal_subgraph is not cycle safe hence will cause problems for ontologies with cycles.