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

human-constraint.ipynb: RecursionError: maximum recursion depth exceeded #2

Open
hyosilpro opened this issue Jun 7, 2021 · 4 comments

Comments

@hyosilpro
Copy link

hyosilpro commented Jun 7, 2021

An error occurred in the module below. I used the current version uberon 2021.02.13. But when I used the old version you provided 2015-07-24 Uberon release, there is no error.

The error message is:

---------------------------------------------------------------------------
RecursionError                            Traceback (most recent call last)
<ipython-input-9-8c5d22ff6c90> in <module>
      9     # Find whether term is in humans by seeing if node or its children
     10     # xref specific human terminologies
---> 11     children = get_children(ontology, node, in_keys = {'is_a', 'part_of', 'develops_from'})
     12     child_xrefs = set()
     13     for child in children | {node}:

<ipython-input-7-44d667171172> in get_children(graph, node, in_keys, out_keys)
      4         if key in in_keys:
      5             children.add(u)
----> 6             children |= get_children(graph, u)
      7     for u, v, key in graph.out_edges(node, keys=True):
      8         if key in out_keys:

... last 1 frames repeated, from the frame below ...

<ipython-input-7-44d667171172> in get_children(graph, node, in_keys, out_keys)
      4         if key in in_keys:
      5             children.add(u)
----> 6             children |= get_children(graph, u)
      7     for u, v, key in graph.out_edges(node, keys=True):
      8         if key in out_keys:

RecursionError: maximum recursion depth exceeded
-------------------------------------------------------------------------------------------------------

The error message was as follows, and I tried several things, but it didn't work. What should I do?

-------------------------------------------------------------------------------------------------------
import sys
sys.setrecursionlimit(30000)
print(sys.getrecursionlimit())
-------------------------------------------------------------------------------------------------------
The kernel for  human-constraint.ipynb appears to have died. It will restart automatically.
-------------------------------------------------------------------------------------------------------

Kindly regards

@dhimmel
Copy link
Owner

dhimmel commented Jun 8, 2021

Sounds like there is a cycle in the graph. The 2021-02-13 Uberon must not directed acyclic for the union of the is_a, part_of, develops_from relations.

What if you remove develops_from from in_keys?

@hyosilpro
Copy link
Author

I did remove develops_from from in_keys, but same error has occured.

so, I download human subset.

following link data set
http://uberon.github.io/downloads.html#subsets

https://raw.githubusercontent.com/obophenotype/uberon/master/subsets/human-view.obo

And then the problem was solved.

@dhimmel
Copy link
Owner

dhimmel commented Jun 10, 2021

Ah, nice to see that Uberon now has a human view. This wasn't around when we made human-constraint.ipynb, such that you probably don't need human-constraint.ipynb at all anymore. Since now you can just use human-view.obo as the input ontology for process.ipynb.

@hyosilpro
Copy link
Author

Ah, nice to see that Uberon now has a human view. This wasn't around when we made human-constraint.ipynb, such that you probably don't need human-constraint.ipynb at all anymore. Since now you can just use human-view.obo as the input ontology for process.ipynb.

When I checked the code, it was determined that as you mentioned. just start ' process.ipynb` .
Thank you very much for your reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants