Test GUI with analyses and display them somehow
Opened this issue · 6 comments
Here is an example query from @chunyuma from Slack
{
"message": {"query_graph": {
"nodes": {
"disease": {
"ids": ["MONDO:0004975"]
},
"chemical": {
"categories": ["biolink:ChemicalEntity"]
}
},
"edges": {
"t_edge": {
"object": "disease",
"subject": "chemical",
"predicates": ["biolink:treats"],
"knowledge_type": "inferred"
}
}
}
},
"operations": {"actions": [
"infer(action=drug_treatment_graph_expansion,node_curie=MONDO:0004975,qedge_id=t_edge,n_drugs=2,n_paths=2)",
"return(message=true, store=true)"
]}
}
When I post this to https://arax.ncats.io/NewFmt/api/arax/v1.4/query
I get odd errors:
https://arax.ncats.io/devLM/?r=136963
Seems that the DSL interpreter treats those values as strings instead of integers.
Should I use a different API endpoint? Or is there a response ID already available?
@chunyuma need help with this. Or maybe someone else?
I thought perhaps the above errors might be fixed if I merged master
into NewFmt
, but I seem to have made things worse.
When I merged master
into NewFmt
, I got a conflict. I attempted to resolve the conflicts, but I am uncertain whether I did it correctly. the files are here:
cd /mnt/data/orangeboard/kg2NewFmt/RTX/code/ARAX/ARAXQuery/Infer/scripts
-rw-rw-r-- 1 rt rt 50669 May 11 03:44 infer_utilities.py
-rw-rw-r-- 1 rt rt 59135 May 11 03:32 infer_utilities.py-conflicted
The first file is my attempt at deconflicting.
the second file is the file with conflicts in it.
When I run the above query, I now get these errors:
2023-05-11T03:47:04.722788 ERROR: An uncaught error occurred: name 'node_name_to_id' is not defined: ['Traceback (most recent call last):\n', ' File "/mnt/data/orangeboard/NewFmt/RTX/code/UI/OpenAPI/python-flask-server/openapi_server/controllers/../../../../../ARAX/ARAXQuery/ARAX_query.py", line 767, in execute_processing_plan\n infer.apply(response, action[\'parameters\'])\n', ' File "/mnt/data/orangeboard/NewFmt/RTX/code/UI/OpenAPI/python-flask-server/openapi_server/controllers/../../../../../ARAX/ARAXQuery/ARAX_infer.py", line 336, in apply\n getattr(self, \'_\' + self.__class__.__name__ + \'__\' + parameters[\'action\'])() # thank you https://stackoverflow.com/questions/11649848/call-methods-by-string\n', ' File "/mnt/data/orangeboard/NewFmt/RTX/code/UI/OpenAPI/python-flask-server/openapi_server/controllers/../../../../../ARAX/ARAXQuery/ARAX_infer.py", line 459, in __drug_treatment_graph_expansion\n self.response, self.kedge_global_iter, self.qedge_global_iter, self.qnode_global_iter, self.option_global_iter = iu.genrete_treat_subgraphs(self.response, top_drugs, top_paths, qedge_id, self.kedge_global_iter, self.qedge_global_iter, self.qnode_global_iter, self.option_global_iter)\n', ' File "/mnt/data/orangeboard/NewFmt/RTX/code/ARAX/ARAXQuery/Infer/scripts/infer_utilities.py", line 335, in genrete_treat_subgraphs\n fixed_edge = Edge(predicate=edge_predicate, subject=node_name_to_id[drug_name], object=node_name_to_id[disease_name],\n', "NameError: name 'node_name_to_id' is not defined\n"]
I tried to see if this was due to the conflict, but it does not appear to be, but I am uncertain. node_name_to_id
does not appear to be defined in either the conflicted or deconflicted file, so I am at a loss. Need help.
NewFmt is currently inoperative until this is fixed.
Somewhat separately, Luis needs a suitable response_id to keep developing.
So help is urgently sought to:
a) resolve the error I describe
b) possible resolve the error that Luis describes
c) Get Luis a suitable response_id to continue development of the UI.
thanks!
Hi @edeutsch and @isbluis, thanks for reporting this problem.
@edeutsch, this error is because for some reason, when the git merges the master
branch and the NewFmt
branch, it got wrong in some lines (for instance, some lines in the NewFmt
branch that should be removed because of the changes in the master
branch were not removed by the git merge). I guess probably we changed the infer_utilities.py
script in both branches separately for #1970 and #1991. Anyway, I've resolved this issue in the NewFmt
branch now. Both a) and b) are resolved.
@isbluis, here is a suitable response_id (I got it when I ran the query above in the NewFmt
branch) that might help with the development of the UI.
Hello @chunyuma . Thank you for the link. But that response contains only one element in each analyses
array. I think we were hoping to test the case where those contain more than one element. Are you able to provide an example of that? Thanks!
Per @amykglen on Slack:
The new ResultTransformer we set up currently only creates one Analysis per Result. I think there was talk of handling creative mode/inferred query results differently, but I don't think that's happened. So currently I don't think we have an example with more than one Analysis per Result
So should we put this on hold until we have a better test scenario, @edeutsch ? Or do you know of other ARAs that already return what we need? The UI does already handle analyses
arrays with a single element.
I think we should test and deploy rapidly something that works for a single analyses, and ideally that is hoped will work for multiple, and let's get it out there. Supposedly Aragorn has multiple, but I don't have an example in hand at the moment. Let's build it for multiple, but test on a single for now.
Is there something we can test already?