-
Notifications
You must be signed in to change notification settings - Fork 6
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
Update multi-entity endpoint #385
Conversation
✅ Deploy Preview for monarch-app canceled.
|
@oneilsh i think i've got something that (at least technically) works - from monarch_py.implementations.solr.solr_implementation import SolrImplementation
from monarch_py.utils.utils import to_json
si = SolrImplementation()
results = si.get_multi_entity_associations(
entity=["MONDO:0012933", "MONDO:0005439", "MANGO:0023456"],
counterpart_category=["biolink:Gene", "biolink:Disease"]
)
to_json(results, file="test_multi_endpoint.json")
|
@glass-ships , the format looks good :) The data though is a bit suspect now - for that example the result for MONDO:0005439 doesn't link to any genes (but I think it should?), but also links to itself several times via a biolink:subclass_of predicate. Here's the full output:
|
to be honest i'm not exactly sure why that would be, but it does seem to line up with the previous output before these changes: it's possible the logic isn't quite right, maybe @kevinschaper can take a look at the query builder / response parser to make sure they make sense, but the biology of things is outside my wheelhouse |
@kevinschaper when you get a moment can you dig into the logic on the association? I gather some predicates can be "reflexive" and allow self-association, but having it reported multiple times doesn't seem right ;) |
Oops, hold off on the merge. I do wonder if we need to have some extra filtering. |
Not the most important part, and I suppose the model is kind of set, but I wonder if the entity prefix is necessary when the list is already named entities?
--edit, ok, now I'm seeing the |
it seems like directionality isn't captured/preserved. If I query with
I get (paraphrased):
The actual disease associations from
I'm guessing that the bug part is that that it's getting the self side the bottom two associations, but I it definitely wouldn't be valid if it returned the other side and ended up with:
|
I don't know if it's a dealbreaker for this being a useful endpoint, but it would feel a lot more correct to return full associations rather than trying to just return the "other side" and having predicate/directionality challenges. |
@oneilsh would an acceptable approach to this be to return (in pseudo-model):
where the association is just the edge as it exists in the KG? That way the directionality of the edge is maintained and it's less misleading if (and even if the predicate is changed, it implies the existence of an edge in the kg that may not actually be there) |
Closing for now, see note #365 (comment) |
Addresses #365