From 5d10fbe2f6605b946e1ce2f950efd0c87465cd43 Mon Sep 17 00:00:00 2001 From: Eric Deutsch Date: Wed, 30 Oct 2024 15:46:28 -0700 Subject: [PATCH 1/3] update back end to process max_synonyms in the POSTed dict. #2367 --- code/ARAX/NodeSynonymizer/node_synonymizer.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/code/ARAX/NodeSynonymizer/node_synonymizer.py b/code/ARAX/NodeSynonymizer/node_synonymizer.py index c74fe7abe..0d24cf247 100644 --- a/code/ARAX/NodeSynonymizer/node_synonymizer.py +++ b/code/ARAX/NodeSynonymizer/node_synonymizer.py @@ -297,6 +297,15 @@ def get_normalizer_results(self, entities: Optional[Union[str, Set[str], List[st entities = entities_dict.get("terms") output_format = entities_dict.get("format") + # Allow the caller to encode the max_synonyms in the input dict (used by web UI) + max_synonyms_raw = entities_dict.get("max_synonyms") + try: + max_synonyms_int = int(max_synonyms_raw) + if max_synonyms_int > 0: + max_synonyms = max_synonyms_int + except: + pass + # Convert any input curies to Set format entities_set = self._convert_to_set_format(entities) From 7f97614c89b427bfd4e610fcad67e9e06e60812c Mon Sep 17 00:00:00 2001 From: isbluis Date: Fri, 1 Nov 2024 02:17:57 +0000 Subject: [PATCH 2/3] - Decorate edges that have both a support graph [sg] and a qualifier [q] (#2400) - Add new user setting for max number of nodes to list in Synonyms [default=50] (#2367) - Tidy layout of Settings - Add "months" to text for long-running Queries in System Activity - Update ARAXi DSL helper JSON --- code/UI/interactive/araxi.js | 61 +++++++------ code/UI/interactive/index.html | 147 +++++++++++++++++++++----------- code/UI/interactive/rtx.css | 7 ++ code/UI/interactive/rtx.js | 55 ++++++++++-- code/UI/interactive/rtx.version | 2 +- 5 files changed, 180 insertions(+), 92 deletions(-) diff --git a/code/UI/interactive/araxi.js b/code/UI/interactive/araxi.js index 75d1bff36..c9a9b51e4 100644 --- a/code/UI/interactive/araxi.js +++ b/code/UI/interactive/araxi.js @@ -1,5 +1,5 @@ // WARNING: -// This file was auto-generated by /mnt/data/orangeboard/devLM/RTX/code/UI/interactive/./dsl2json.py on: 2024-09-11 06:23:47 +// This file was auto-generated by /mnt/data/orangeboard/devLM/RTX/code/UI/interactive/./dsl2json.py on: 2024-11-01 01:58:59 // var araxi_commands = { "add_qedge()": { @@ -208,7 +208,7 @@ var araxi_commands = { "description": "Whether to omit supporting data on nodes/edges in the results (e.g., publications, description, etc.)." } }, - "description": "This command will expand (aka, answer/fill) your query graph in an edge-by-edge fashion, intelligently selecting which KPs to use for each edge. It selects KPs from the SmartAPI Registry based on the meta information provided by their TRAPI APIs, whether they have an endpoint running a matching TRAPI version, and whether they have an endpoint with matching maturity. For each QEdge, it queries the selected KPs concurrently; it will timeout for a particular KP if it decides it's taking too long to respond (this KP timeout can be controlled by the user). You may also optionally specify a particular KP to use via the 'kp' parameter (described below).\n\nCurrent candidate KPs include (for TRAPI 1.5, maturity 'development'): \ninfores:answer-coalesce, infores:automat-binding-db, infores:automat-cam-kp, infores:automat-ctd, infores:automat-drug-central, infores:automat-genome-alliance, infores:automat-gtex, infores:automat-gtopdb, infores:automat-gwas-catalog, infores:automat-hetionet, infores:automat-hgnc, infores:automat-hmdb, infores:automat-human-goa, infores:automat-icees-kg, infores:automat-intact, infores:automat-monarchinitiative, infores:automat-panther, infores:automat-pharos, infores:automat-reactome, infores:automat-robokop, infores:automat-string-db, infores:automat-ubergraph, infores:automat-viral-proteome, infores:cohd, infores:connections-hypothesis, infores:gelinea, infores:genetics-data-provider, infores:knowledge-collaboratory, infores:molepro, infores:multiomics-clinicaltrials, infores:multiomics-drugapprovals, infores:multiomics-microbiome, infores:multiomics-multiomics, infores:openpredict, infores:rtx-kg2, infores:service-provider-trapi, infores:spoke. \n\n(Note that this list of KPs may change unexpectedly based on the SmartAPI registry.)" + "description": "This command will expand (aka, answer/fill) your query graph in an edge-by-edge fashion, intelligently selecting which KPs to use for each edge. It selects KPs from the SmartAPI Registry based on the meta information provided by their TRAPI APIs, whether they have an endpoint running a matching TRAPI version, and whether they have an endpoint with matching maturity. For each QEdge, it queries the selected KPs concurrently; it will timeout for a particular KP if it decides it's taking too long to respond (this KP timeout can be controlled by the user). You may also optionally specify a particular KP to use via the 'kp' parameter (described below).\n\nCurrent candidate KPs include (for TRAPI 1.5, maturity 'development'): \ninfores:answer-coalesce, infores:automat-binding-db, infores:automat-cam-kp, infores:automat-ctd, infores:automat-drug-central, infores:automat-ehr-clinical-connections-kp, infores:automat-ehr-may-treat-kp, infores:automat-genome-alliance, infores:automat-gtex, infores:automat-gtopdb, infores:automat-gwas-catalog, infores:automat-hetionet, infores:automat-hgnc, infores:automat-hmdb, infores:automat-human-goa, infores:automat-icees-kg, infores:automat-intact, infores:automat-monarchinitiative, infores:automat-panther, infores:automat-pharos, infores:automat-reactome, infores:automat-robokop, infores:automat-string-db, infores:automat-ubergraph, infores:automat-viral-proteome, infores:cohd, infores:connections-hypothesis, infores:gelinea, infores:genetics-data-provider, infores:knowledge-collaboratory, infores:molepro, infores:multiomics-clinicaltrials, infores:multiomics-drugapprovals, infores:multiomics-microbiome, infores:multiomics-multiomics, infores:openpredict, infores:rtx-kg2, infores:service-provider-trapi, infores:spoke. \n\n(Note that this list of KPs may change unexpectedly based on the SmartAPI registry.)" }, "overlay(action=add_node_pmids)": { "parameters": { @@ -1360,32 +1360,10 @@ var araxi_commands = { "min": 1, "max": 5, "type": "integer", - "description": "The maximum edges to connect two nodes with. If not provided defaults to 2." - }, - "qnode_keys": { - "is_required": true, - "examples": [ - [ - "n01", - "n02" - ], - [] - ], - "type": "list", - "description": "List with just two qnode keys to connect. example: [n1, n2]" - }, - "node_category_constraint": { - "is_required": false, - "examples": [ - "biolink:Disease", - "biolink:Gene", - "biolink:ChemicalEntity" - ], - "type": "string", - "description": "This constraint will display paths that only pass through the user-specified category." + "description": "The maximum edges to connect two nodes with. If not provided defaults to 4." } }, - "description": "\nconnect_nodes adds paths between two nodes specified in the query.\n " + "description": "connect_nodes adds paths between two nodes specified in the query." }, "infer(action=chemical_gene_regulation_graph_expansion)": { "parameters": { @@ -1435,7 +1413,7 @@ var araxi_commands = { "qedge_id_3" ], "type": "string", - "description": "The id of the qedge you wish to perform the drug treatment/chemical regulation inference expansion." + "description": "The id of the qedge you wish to perform the chemical-gene regulation inference expansion." }, "threshold": { "is_required": false, @@ -1506,7 +1484,17 @@ var araxi_commands = { }, "infer(action=drug_treatment_graph_expansion)": { "parameters": { - "node_curie": { + "drug_curie": { + "is_required": true, + "examples": [ + "CHEMBL.COMPOUND:CHEMBL55643", + "CHEBI:8378", + "RXNORM:1011" + ], + "type": "string", + "description": "The CURIE for a drug node used to predict what potential diseases it may treat." + }, + "disease_curie": { "is_required": true, "examples": [ "DOID:9352", @@ -1514,7 +1502,7 @@ var araxi_commands = { "HP:0001945" ], "type": "string", - "description": "The curie for the node you wish to predict drugs which will treat." + "description": "The CURIE for a disease node used to predict what potential drugs can potentially treat it." }, "qedge_id": { "is_required": false, @@ -1524,7 +1512,7 @@ var araxi_commands = { "qedge_id_3" ], "type": "string", - "description": "The id of the qedge you wish to perform the drug treatment/chemical regulation inference expansion." + "description": "The id of the qedge you wish to perform the drug-disease treatment inference expansion." }, "n_drugs": { "is_required": false, @@ -1535,7 +1523,18 @@ var araxi_commands = { ], "default": 50, "type": "integer", - "description": "The number of drug nodes to return. If not provided defaults to 50. Considering the response speed, the maximum number of drugs returned is only allowed to be 50." + "description": "Given an interested disease CURIE, the number of drug nodes to return. If not provided defaults to 50. Considering the response speed, the maximum number of drugs returned is only allowed to be 50." + }, + "n_diseases": { + "is_required": false, + "examples": [ + 5, + 15, + 25 + ], + "default": 50, + "type": "integer", + "description": "Given an interested drug CURIE, The number of disease nodes to return. If not provided defaults to 50. Considering the response speed, the maximum number of diseases returned is only allowed to be 50." }, "n_paths": { "is_required": false, diff --git a/code/UI/interactive/index.html b/code/UI/interactive/index.html index 33dbb1f9a..f1ca6f3ea 100644 --- a/code/UI/interactive/index.html +++ b/code/UI/interactive/index.html @@ -4,7 +4,7 @@ ARAX User Interface - + @@ -520,61 +520,104 @@

Synonym Lookup:

API Settings
-
-

REMOTE API TIMEOUT DURING ARAX EXPANSION (leave blank for default):

- - seconds - -

-

DEFAULT PRUNING THRESHOLD DURING ARAX EXPANSION:

- - nodes - -

-

BASE API URL (ARAX):

- - -
-

ARAX QUERY URL:

- - -

-

ARS API (post query):

- - -

-

EXTERNAL API (post query):

- - -
- - - - - - - - - - - - - - -

+
+ +

REMOTE API TIMEOUT DURING ARAX EXPANSION (leave blank for default):

+ + seconds +
+ + + + + +

DEFAULT PRUNING THRESHOLD DURING ARAX EXPANSION:

+ + nodes +
+ + + + + +

BASE API URL (ARAX):

+ +
+ + + + + +

ARAX QUERY URL:

+ +
+ + + + + +

ARS API (post query):

+ +
+ + + + + +

EXTERNAL API (post query):

+ +
+ + + + + + + + + + + + + + + + + + + + + +
Session Settings
-
-

MAXIMUM NUMBER OF RESULTS TO DISPLAY (very large values may crash UI):

- - -

-

SUBMITTER (enter a generic name to help track queries):

- - -

+
+ +

MAXIMUM NUMBER OF RESULTS TO DISPLAY (very large values may crash UI):

+ + results +
+ + + + +

MAXIMUM NUMBER OF SYNONYMS TO DISPLAY (values above 100 may slow down UI):

+ + nodes +
+ + + + + +

SUBMITTER (enter a generic name to help track queries):

+ +
+ + +