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

Unstable xCRG Path Finding Implementation #2391

Closed chunyuma closed 1 month ago

chunyuma commented 1 month ago

Hi @kvnthomas98,

I just ran a query in the master branch:

{
            "edges": {
                "t_edge": {
                "attribute_constraints": [],
                "knowledge_type": "inferred",
                "object": "ON",
                "predicates": [
                    "biolink:affects"
                ],
                "qualifier_constraints": [
                    {
                    "qualifier_set": [
                        {
                        "qualifier_type_id": "biolink:object_aspect_qualifier",
                        "qualifier_value": "activity_or_abundance"
                        },
                        {
                        "qualifier_type_id": "biolink:object_direction_qualifier",
                        "qualifier_value": "decreased"
                        }
                    ]
                    }
                ],
                "subject": "SN"
                }
            },
            "nodes": {
                "ON": {
                "categories": [
                    "biolink:Gene"
                ],
                "constraints": [],
                "ids": [
                    "NCBIGene:154"
                ],
                "set_interpretation": "BATCH"
                },
                "SN": {
                "categories": [
                    "biolink:ChemicalEntity"
                ],
                "constraints": [],
                "set_interpretation": "BATCH"
                }
            }
        }

Sometimes it runs fine but sometimes it has an error:

  - 2024-10-01T14:22:03.025488 ERROR: [UncaughtARAXiError] An uncaught error occurred: 'edges': ['Traceback (most recent call last):\n', '  File "/scratch2/cqm5886/RTX/code/ARAX/Testing/../../ARAX/ARAXQuery/ARAX_query.py", line 781, in execute_processing_plan\n    expander.apply(response, action[\'parameters\'], mode=mode)\n', '  File "/scratch2/cqm5886/RTX/code/ARAX/Testing/../../ARAX/ARAXQuery/ARAX_expander.py", line 347, in apply\n    response, overarching_kg = self.get_inferred_answers(inferred_qedge_keys, query_graph, response)\n', '  File "/scratch2/cqm5886/RTX/code/ARAX/Testing/../../ARAX/ARAXQuery/ARAX_expander.py", line 743, in get_inferred_answers\n    infer_response = inferer.apply(response, infer_input_parameters)\n', '  File "/scratch2/cqm5886/RTX/code/ARAX/Testing/../../ARAX/ARAXQuery/ARAX_infer.py", line 366, in apply\n    getattr(self, \'_\' + self.__class__.__name__ + \'__\' + parameters[\'action\'])()  # thank you https://stackoverflow.com/questions/11649848/call-methods-by-string\n', '  File "/scratch2/cqm5886/RTX/code/ARAX/Testing/../../ARAX/ARAXQuery/ARAX_infer.py", line 866, in __chemical_gene_regulation_graph_expansion\n    top_paths = XCRG.predict_top_M_paths(query_chemical=None, query_gene=preferred_object_curie, model_type=self.parameters[\'regulation_type\'], N=self.parameters[\'n_result_curies\'], M=self.parameters[\'n_paths\'], threshold=self.parameters[\'threshold\'], kp=self.parameters[\'kp\'], path_len=self.parameters[\'path_len\'], interm_ids=None, interm_names= None, interm_categories=None)\n', '  File "/scratch2/cqm5886/RTX/code/ARAX/ARAXQuery/Infer/scripts/creativeCRG.py", line 529, in predict_top_M_paths\n    paths = self.get_paths(preferred_query_gene, res[\'chemical_id\'].tolist(), gene_neighbors, chemical_neighbors,  query_tf_neighbors, answer_tf_neigbors,self.tf_list, M)\n', '  File "/scratch2/cqm5886/RTX/code/ARAX/ARAXQuery/Infer/scripts/creativeCRG.py", line 578, in get_paths\n    for edge_id, edge in answer_neighbors[\'edges\'][\'e00\'].items():\n', "KeyError: 'edges'\n"]

If you are available, could you please help figure out the reason? Thanks!

kvnthomas98 commented 1 month ago

Thanks for reporting @chunyuma , will check

kvnthomas98 commented 1 month ago

Hi @chunyuma , PloverDB in CI has been giving 502 gateway errors. I've added graceful handling incase plover db goes down.

chunyuma commented 1 month ago

Thanks for exploring the reason @kvnthomas98. Adding graceful handling sounds great. Appreciate your assistance.

kvnthomas98 commented 1 month ago

Looks to be working fine now. Closing! Thanks @chunyuma