RTXteam / RTX

Software repo for Team Expander Agent (Oregon State U., Institute for Systems Biology, and Penn State U.)
https://arax.ncats.io/
MIT License
33 stars 21 forks source link

Return full subgraph for some query types #100

Closed dkoslicki closed 4 years ago

dkoslicki commented 6 years ago

See #71. Eg. For the COP's, return JSON output of the entire relevant subgraph ala: cop example

dkoslicki commented 6 years ago

@edeutsch Before I get too carried away, can you take a look at my incorporation of a neighborhood graph in the following code. The new response can be seen via python3 Q2Solution.py -j.

Little details include:

  1. The "num_results" includes the neighborhood graph (is that ok?)
  2. The usual answers do not have a result_type, do you want me to change this so they are individual query answer?
edeutsch commented 6 years ago

Looping in @isbluis

I went to http://rtx.ncats.io/devED/ and searched: what is the clinical outcome pathway of physostigmine for treatment of glaucoma?

It looks pretty nice to me! 1) I suppose I would not include it in the count, but not a big deal 2) Current code automatically inserts result_type=individual query answer if no result_type is specified. This seems to be working, so I would not advocate any change. seems fine.

@isbluis , can you make "result_type": "neighborhood graph" a special case? different color border? not part of the numbering 1, 2, 3. Don't display the confidence.

@dkoslicki , I would expand the text to be a bit more explanatory, maybe: This is a subgraph extracted from the full RTX knowledge graph, including nodes and edges relevant to the query. This is not an answer to the query per se, but rather an opportunity to examine a small region of the RTX knowledge graph for further study. Formal answers to the query are below.

This is great, I like it! Do you want to add the summary graph at the same time, so Luis can mock up that one as well? Similar deal as above except a different color yet?

Nice!

dkoslicki commented 6 years ago

@edeutsch Great! I've implemented those changes; except for the summary graph: do you mind reminding me what that is?

@isbluis any luck with other graph layouts? With the current hierarchical layout, it's difficult to see node names.

edeutsch commented 6 years ago

summary graph was my name for what you called "metagraph" (I remember finally!) I had imagined this as a high level overview of all the node types and edge types from the neighborhood graph. But I think you have a slightly different vision of what the metagraph was. Something like that.

dkoslicki commented 6 years ago

Note to self: the following will be quite useful for this task:

match p=(:disease{id:"DOID:8398"})-[*1..2]-(:chemical_substance{id:"ChEMBL:154"}) with nodes(p) as n unwind n as n2 return distinct labels(n2) limit 10

match p=(:disease{id:"DOID:8398"})-[*1..2]-(:chemical_substance{id:"ChEMBL:154"}) with relationships(p) as rel unwind rel as rel2 return distinct type(rel2)

call apoc.meta.subGraph({labels:["chemical_substance","protein"],rels:["directly_interacts_with"],excludes:["disease","affects"]})
dkoslicki commented 4 years ago

Not relevant to ARAX. Closing