Skip to content

Commit

Permalink
Merge tag 'itrb-deployment-20240823' into production
Browse files Browse the repository at this point in the history
  • Loading branch information
edeutsch committed Oct 11, 2024
2 parents 37bc0e1 + 04933f7 commit cb5d404
Show file tree
Hide file tree
Showing 19 changed files with 1,271 additions and 1,092 deletions.
5 changes: 3 additions & 2 deletions ISSUE_TEMPLATES/kg2rollout.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ Before rolling out, we need to pre-upload the new databases (referenced in `conf

#### 7. Roll-out to ITRB TEST
- [ ] In GitHub, for the RTXteam/RTX project, merge `master` to `itrb-test`. Record this issue number in the merge message.
- [ ] In GitHub, for the RTXteam/PloverDB project, merge `main` to `itrb-test`. Record this issue number in the merge message.
- [ ] In GitHub, for the RTXteam/PloverDB project, merge `main` to `itrb-test`.
- [ ] Tag the release using the `master` branch of RTXteam/RTX project.
- [ ] Tag the release using the `main` branch of RTXteam/PloverDB project.
- [ ] Via a message in the `#devops-teamexpanderagent` channel in the `NCATSTranslator` Slack workspace, put in a request to `@Sarah Stemann` to open a ticket to re-deploy ARAX, RTX-KG2, and PloverDB to ITRB test
Expand All @@ -215,7 +215,8 @@ Before rolling out, we need to pre-upload the new databases (referenced in `conf
- [ ] Check proper functioning of `arax.test.transltr.io` (look at messages log `debug` mesages to verify that ARAX-Expand is indeed querying `kg2.test.transltr.io`)

#### 8. Roll-out to ITRB PRODUCTION
- [ ] In GitHub, merge `master` to `production`. Record this issue number in the merge message.
- [ ] In GitHub, for the RTXteam/RTX project, merge `master` to `production`. Record this issue number in the merge message.
- [ ] In GitHub, for the RTXteam/PloverDB project, merge `main` to `production`.
- [ ] Via a message in the `#devops-teamexpanderagent` channel in the `NCATSTranslator` Slack workspace, put in a request to `@Sarah Stemann` to open a ticket to re-deploy ARAX, RTX-KG2, and PloverDB to ITRB production
- [ ] Monitor the `#devops-teamexpanderagent` channel to follow (i.e., to see if there are any errors reported by ITRB) the roll-out of the updated services in ITRB production (this could take several days, as there is a formal approval process for deployments to ITRB production)
- [ ] Check proper functioning of `kg2cploverdb.transltr.io`
Expand Down
4 changes: 2 additions & 2 deletions code/ARAX/ARAXQuery/ARAX_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ def __init__(self):
"description": Attribute(attribute_type_id="biolink:description",
value_type_id="metatype:String"),
"knowledge_level": Attribute(attribute_type_id="biolink:knowledge_level",
value_type_id="metatype:String"),
value_type_id="biolink:KnowledgeLevelEnum"),
"agent_type": Attribute(attribute_type_id="biolink:agent_type",
value_type_id="metatype:String"),
value_type_id="biolink:AgentTypeEnum"),
"all_categories": Attribute(attribute_type_id="biolink:category",
value_type_id="metatype:Uriorcurie",
description="Categories of all nodes in this synonym set in RTX-KG2."),
Expand Down
3 changes: 1 addition & 2 deletions code/ARAX/ARAXQuery/ARAX_expander.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,6 @@ def apply(self, response, input_parameters, mode: str = "ARAX"):
if inferred_qedge_keys and len(query_graph.edges) == 1:
for edge in query_sub_graph.edges.keys():
query_sub_graph.edges[edge].knowledge_type = 'lookup'

# Expand the query graph edge-by-edge
for qedge_key in ordered_qedge_keys_to_expand:
log.debug(f"Expanding qedge {qedge_key}")
Expand Down Expand Up @@ -655,7 +654,7 @@ def get_inferred_answers(inferred_qedge_keys: List[str],
response.update_query_plan(inferred_qedge_key, "arax-xdtd", "Error",
f"Process error-ed out with {response.status} after {wait_time} seconds")

elif set(['biolink:regulates']).intersection(set(qedge.predicates)): # Figure out if this is a "regulates" query, then use call XCRG models
elif set(["biolink:affects"]).intersection(set(qedge.predicates)): # Figure out if this is a "regulates" query, then use call XCRG models
# Call XCRG models and simply return whatever it returns
# Get the subject and object of this edge
subject_qnode = query_graph.nodes[qedge.subject] # chemical
Expand Down
29 changes: 2 additions & 27 deletions code/ARAX/ARAXQuery/Expand/expand_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,33 +409,8 @@ def get_preferred_categories(curie: Union[str, List[str]], log: ARAXResponse) ->
def get_curie_names(curie: Union[str, List[str]], log: ARAXResponse) -> Dict[str, str]:
curies = convert_to_list(curie)
synonymizer = NodeSynonymizer()
log.debug(f"Looking up names for {len(curies)} input curies using NodeSynonymizer")
synonymizer_info = synonymizer.get_normalizer_results(curies)
curie_to_name_map = dict()
if synonymizer_info:
recognized_input_curies = {input_curie for input_curie in synonymizer_info if synonymizer_info.get(input_curie)}
unrecognized_curies = set(curies).difference(recognized_input_curies)
if unrecognized_curies:
log.warning(f"NodeSynonymizer did not recognize: {unrecognized_curies}")
input_curies_without_matching_node = set()
for input_curie in recognized_input_curies:
equivalent_nodes = synonymizer_info[input_curie]["nodes"]
# Find the 'node' in the synonymizer corresponding to this curie
input_curie_nodes = [node for node in equivalent_nodes if node["identifier"] == input_curie]
if not input_curie_nodes:
# Try looking for slight variation (KG2 vs. SRI discrepancy): "KEGG:C02700" vs. "KEGG.COMPOUND:C02700"
input_curie_stripped = input_curie.replace(".COMPOUND", "")
input_curie_nodes = [node for node in equivalent_nodes if node["identifier"] == input_curie_stripped]
# Record the name for this input curie
if input_curie_nodes:
curie_to_name_map[input_curie] = input_curie_nodes[0].get("label")
else:
input_curies_without_matching_node.add(input_curie)
if input_curies_without_matching_node:
log.warning(f"No matching nodes found in NodeSynonymizer for these input curies: "
f"{input_curies_without_matching_node}. Cannot determine their specific names.")
else:
log.error(f"NodeSynonymizer returned None", error_code="NodeNormalizationIssue")
log.debug(f"Looking up names for {len(curies)} input curies using NodeSynonymizer.get_curie_names()")
curie_to_name_map = synonymizer.get_curie_names(curies)
return curie_to_name_map


Expand Down
Loading

0 comments on commit cb5d404

Please sign in to comment.