monarch-initiative / biolink-api

API for linked biological knowledge
https://api.monarchinitiative.org/api/
BSD 3-Clause "New" or "Revised" License
63 stars 25 forks source link

Allow search to filter diseases only in OMIM #368

Closed kshefchek closed 3 years ago

kshefchek commented 3 years ago

For example, @iimpulse would like to search for diseases only in OMIM, such as:

https://api.monarchinitiative.org/api/search/entity/marf?prefix=OMIM&rows=20&start=0&minimal_tokenizer=false

But this returns nothing.

First we'll need to make sure the equivalent id list is reflexive, so that we can put the filter on this field instead of id. This might also be potentially confusing to users, as they would get back Mondo as a primary id when searching for OMIM

pnrobinson commented 3 years ago

It would be useful to have a query that would return MONDO is for a given OMIM query. If this is not possible please let us know and we will look for another solution -- this is currently a blocker!

kshefchek commented 3 years ago

if you have an OMIM id, you can get the linked MONDO id via bioentity/{id}, eg https://api.monarchinitiative.org/api/bioentity/OMIM:154700

pnrobinson commented 3 years ago

@kshefchek that seems very useful. Are these 1:1 OMIM<->MONDO mappings?

kshefchek commented 3 years ago

to follow up here, the original ticket was to add support for limiting autocomplete to only diseases in OMIM, which would require some updates to our solr schema and the solr loader code. There are some additional requirements for poetry, such as mapping an OMIM 1:1 mapping to Mondo, and also to get all superclasses. I think we support both these but need to check.

Another route is to expand out the on demand ontology endpoints in /ontol and /ontology which run fetch the latest ontology using the obo purl. See https://ontobio.readthedocs.io/en/latest/inputs.html (although no obvious from the docs how this works)

monicacecilia commented 3 years ago

372 is a "superticket" keeping track of all three requests. Feel free to remove / edit (either ticket) as needed.

kshefchek commented 3 years ago

I've added two new params to autocomplete that will support this: include_eqs= true|false, when filtering in/out a prefix include equivalent identifiers exclude_groups=true|false, exclude classes with children, ie only return leaf classes

I've also updated the response to include equivalent identifiers so that the Mondo ID can be mapped to OMIM ID without making a second call to bioentity

example: https://api.monarchinitiative.org/api/search/entity/autocomplete/marf?category=disease&prefix=OMIM&include_eqs=true&rows=20&start=0&exclude_groups=true