althonos / pronto

A Python frontend to (Open Biomedical) Ontologies.
https://pronto.readthedocs.io
MIT License
229 stars 48 forks source link

Finding parent terms from IDs in OWL objects #191

Closed dgolden96 closed 1 year ago

dgolden96 commented 1 year ago

Hi there,

I'm a little new to Pronto and the Ontology package, so apologies if I'm missing any obvious information. I'm trying to use some code that my supervisor wrote some time ago using Pronto and Ontology, and it seems like there may have been some changes in how the package works in the intervening time. I've managed to work around most of the bugs, but there's one command that I can't seem to replicate. Basically, I'm trying to find parent terms for one or more given terms in my ontology object, like so:
ont_owl['BTO:0000164'].rparents() where "ont_owl" is an ontology object, and 'BTO:0000164' is one of the IDs. The "rparents" attribute no longer seems to exist for term objects or ontology objects. Is there a newly programmed attribute of a different name with the same functionality? Thank you!

althonos commented 1 year ago

Hi @dgolden96, please have a look at the update guide in the documentation, this should have the answers to this question and maybe others you could have if you're using an old script expecting outdated versions of pronto: https://pronto.readthedocs.io/en/stable/updating.html

dgolden96 commented 1 year ago

Thanks! This was very helpful. I think it solved my problem, much appreciated!