Skip to content

Commit

Permalink
add attributes regarding biolink:knowledge_level and biolink:agent_ty…
Browse files Browse the repository at this point in the history
…pe for xDTD/xCRG edges
  • Loading branch information
chunyuma committed Nov 19, 2024
1 parent a050c2c commit 1efa3d1
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions code/ARAX/ARAXQuery/Infer/scripts/infer_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,9 @@ def genrete_treat_subgraphs(self, response: ARAXResponse, top_scores: pd.DataFra
attribute_source="infores:arax", value_type_id="metatype:Boolean",
value_url=None,
description="This edge is a container for a computed value between two nodes that is not directly attachable to other edges."),
Attribute(attribute_type_id="EDAM-DATA:0951", original_attribute_name="probability_treats",
value=str(treat_score))
Attribute(attribute_type_id="EDAM-DATA:0951", original_attribute_name="probability_treats", value=str(treat_score)),
Attribute(attribute_source="infores:arax", attribute_type_id="biolink:agent_type", value="computational_model"),
Attribute(attribute_source="infores:arax", attribute_type_id="biolink:knowledge_level", value="prediction")
]
retrieval_source = [
RetrievalSource(resource_id="infores:arax", resource_role="primary_knowledge_source")
Expand Down Expand Up @@ -339,7 +340,9 @@ def genrete_treat_subgraphs(self, response: ARAXResponse, top_scores: pd.DataFra
new_edge = Edge(subject=subject_curie, object=object_curie, predicate=predicate, attributes=[], sources=[])
## add attributes to the path-based edge
edge_attribute_list = [
Attribute(original_attribute_name="defined_datetime", value=datetime.now().strftime("%Y-%m-%d %H:%M:%S"), attribute_type_id="metatype:Datetime")
Attribute(original_attribute_name="defined_datetime", value=datetime.now().strftime("%Y-%m-%d %H:%M:%S"), attribute_type_id="metatype:Datetime"),
Attribute(attribute_source="infores:arax", attribute_type_id="biolink:agent_type", value="computational_model"),
Attribute(attribute_source="infores:arax", attribute_type_id="biolink:knowledge_level", value="prediction")
]
if predicate == "biolink:self_loop_relation":
edge_attribute_list += [
Expand Down Expand Up @@ -373,7 +376,9 @@ def genrete_treat_subgraphs(self, response: ARAXResponse, top_scores: pd.DataFra
edge_attribute_list = [
Attribute(original_attribute_name="defined_datetime", value=datetime.now().strftime("%Y-%m-%d %H:%M:%S"), attribute_type_id="metatype:Datetime"),
Attribute(original_attribute_name=None, value=True, attribute_type_id="EDAM-DATA:1772", attribute_source="infores:arax", value_type_id="metatype:Boolean", value_url=None, description="This edge is a container for a computed value between two nodes that is not directly attachable to other edges."),
Attribute(attribute_type_id="EDAM-DATA:0951", original_attribute_name="probability_treats", value=str(treat_score))
Attribute(attribute_type_id="EDAM-DATA:0951", original_attribute_name="probability_treats", value=str(treat_score)),
Attribute(attribute_source="infores:arax", attribute_type_id="biolink:agent_type", value="computational_model"),
Attribute(attribute_source="infores:arax", attribute_type_id="biolink:knowledge_level", value="prediction")
]
retrieval_source = [
RetrievalSource(resource_id="infores:arax", resource_role="primary_knowledge_source")
Expand Down Expand Up @@ -605,8 +610,9 @@ def genrete_regulate_subgraphs(self, response: ARAXResponse, query_chemical: Opt
attribute_source="infores:arax", value_type_id="metatype:Boolean",
value_url=None,
description="This edge is a container for a computed value between two nodes that is not directly attachable to other edges."),
Attribute(attribute_type_id="EDAM-OPERATION:2434", original_attribute_name=f"probably_{model_type}_activity",
value=str(prob_score))
Attribute(attribute_type_id="EDAM-OPERATION:2434", original_attribute_name=f"probably_{model_type}_activity", value=str(prob_score)),
Attribute(attribute_source="infores:arax", attribute_type_id="biolink:agent_type", value="computational_model"),
Attribute(attribute_source="infores:arax", attribute_type_id="biolink:knowledge_level", value="prediction")
]
retrieval_source = [
RetrievalSource(resource_id="infores:arax", resource_role="primary_knowledge_source")
Expand Down Expand Up @@ -655,7 +661,9 @@ def genrete_regulate_subgraphs(self, response: ARAXResponse, query_chemical: Opt
attribute_source="infores:arax", value_type_id="metatype:Boolean",
value_url=None,
description="This edge is a container for a computed value between two nodes that is not directly attachable to other edges."),
Attribute(attribute_type_id="EDAM-OPERATION:2434", original_attribute_name=f"probably_{model_type}_activity", value=str(prob_score))
Attribute(attribute_type_id="EDAM-OPERATION:2434", original_attribute_name=f"probably_{model_type}_activity", value=str(prob_score)),
Attribute(attribute_source="infores:arax", attribute_type_id="biolink:agent_type", value="computational_model"),
Attribute(attribute_source="infores:arax", attribute_type_id="biolink:knowledge_level", value="prediction")
]
if model_type == 'increase':
edge_qualifier_direction = 'increased'
Expand Down Expand Up @@ -769,7 +777,9 @@ def genrete_regulate_subgraphs(self, response: ARAXResponse, query_chemical: Opt
edge_attribute_list = [
Attribute(original_attribute_name="defined_datetime", value=datetime.now().strftime("%Y-%m-%d %H:%M:%S"), attribute_type_id="metatype:Datetime"),
Attribute(original_attribute_name=None, value=True, attribute_type_id="EDAM-DATA:1772", attribute_source="infores:arax", value_type_id="metatype:Boolean", value_url=None, description="This edge is a container for a computed value between two nodes that is not directly attachable to other edges."),
Attribute(attribute_type_id="EDAM-OPERATION:2434", original_attribute_name=f"probably_{model_type}_activity", value=str(regulate_score))
Attribute(attribute_type_id="EDAM-OPERATION:2434", original_attribute_name=f"probably_{model_type}_activity", value=str(regulate_score)),
Attribute(attribute_source="infores:arax", attribute_type_id="biolink:agent_type", value="computational_model"),
Attribute(attribute_source="infores:arax", attribute_type_id="biolink:knowledge_level", value="prediction")
]
retrieval_source = [
RetrievalSource(resource_id="infores:arax", resource_role="primary_knowledge_source")
Expand Down

0 comments on commit 1efa3d1

Please sign in to comment.