-
Notifications
You must be signed in to change notification settings - Fork 28
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
Extract replaced_by mappings for obsolete terms #18
Comments
#15 added an I don't think ontologies generally include edges for obsolete nodes, but I'm not entirely sure. Does this address your use case? Are you trying to do any of the following:
|
Thank you for your reply! |
Sounds like you need a two step approach:
In 0ce7c81, I update the example notebook with an example of how to create an old_to_new = dict()
for node, data in graph_with_obs.nodes(data=True):
for replaced_by in data.get("replaced_by", []):
old_to_new[node] = replaced_by Hopefully this helps you achieve part 1. There is also code for part 2 in the notebook. Note that in obonet directed edges go from child to parent term, such that the networkx descendants and ancestors functions do the opposite of their usual behavior. You could always reverse all the edges using |
Perfect! Thank you very much for your help. This is so helpful! |
Hi, I'd like to use obonet to read HPO terms (http://purl.obolibrary.org/obo/hp.obo)
I noticed that the obsolete terms are ignored when reading the file. I'd prefer to use their corresponding updated names.
Example:
Is there an easy way to extract and use that mapping?
The text was updated successfully, but these errors were encountered: