Skip to content

Commit

Permalink
Merge pull request #164 from BioDataFuse/PCS_usecase_upadets
Browse files Browse the repository at this point in the history
generator bug fix
  • Loading branch information
tabbassidaloii authored Aug 30, 2024
2 parents b459ca4 + b1db67e commit 59353f8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/pyBiodatafuse/annotators/opentargets.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from pyBiodatafuse import id_mapper
from pyBiodatafuse.constants import (
OPENTARGETS,
OPENTARGETS_COMPOUND_DISEASE_RELATION,
OPENTARGETS_COMPOUND_INPUT_ID,
OPENTARGETS_COMPOUND_OUTPUT_DICT,
OPENTARGETS_COMPOUND_QUERY_INPUT_ID,
Expand Down Expand Up @@ -1061,7 +1062,7 @@ def get_disease_compound_interactions(
)
intermediate_df["compound_cid"] = mapped_df["target"]

intermediate_df["relation"] = "treats"
intermediate_df["relation"] = OPENTARGETS_COMPOUND_DISEASE_RELATION

# Check if all keys in df match the keys in OUTPUT_DICT
check_columns_against_constants(
Expand Down
7 changes: 4 additions & 3 deletions src/pyBiodatafuse/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@
DRUGBANK_ID = "DB"
RELATION = "inhibits|activates"
OPENTARGETS_GENE_COMPOUND_COL = f"{OPENTARGETS}_gene_compounds"
OPENTARGETS_COMPOUND_DISEASE_RELATION = "treats"
OPENTARGETS_DISEASE_COMPOUND_COL = f"{OPENTARGETS}_disease_compounds"

# MolMeDB - Gene/Protein input
Expand Down Expand Up @@ -234,14 +235,14 @@
"source": BGEE,
"name": None,
"id": None,
"developmental_stage_name": None,
"developmental_stage_id": None,
"labels": ANATOMICAL_NODE_LABELS,
}
BGEE_GENE_ANATOMICAL_EDGE_LABEL = "expressed_by"
BGEE_EDGE_ATTRS = {
"source": BGEE,
"expression_level": None,
"developmental_stage_name": None,
"developmental_stage_id": None,
"confidence_level_name": None,
"confidence_level_id": None,
"label": BGEE_GENE_ANATOMICAL_EDGE_LABEL,
Expand Down Expand Up @@ -364,7 +365,7 @@
"source_pmid": None,
"labels": COMPOUND_NODE_LABELS,
}
MOLMEDB_PROTEIN_COMPOUND_EDGE_LABEL = "inhibited_by"
MOLMEDB_PROTEIN_COMPOUND_EDGE_LABEL = "inhibits"
MOLMEDB_PROTEIN_COMPOUND_EDGE_ATTRS = {
"source": MOLMEDB,
"label": MOLMEDB_PROTEIN_COMPOUND_EDGE_LABEL,
Expand Down
4 changes: 2 additions & 2 deletions src/pyBiodatafuse/graph/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,8 +569,8 @@ def add_molmedb_gene_inhibitor_subgraph(g, gene_node_label, annot_list):

if len(node_exists) == 0:
g.add_edge(
gene_node_label,
annot_node_label,
gene_node_label,
label=MOLMEDB_PROTEIN_COMPOUND_EDGE_LABEL,
attr_dict=edge_attrs,
)
Expand Down Expand Up @@ -615,8 +615,8 @@ def add_pubchem_assay_subgraph(g, gene_node_label, annot_list):

if len(node_exists) == 0:
g.add_edge(
gene_node_label,
annot_node_label,
gene_node_label,
label=annot["outcome"],
attr_dict=edge_attrs,
)
Expand Down

0 comments on commit 59353f8

Please sign in to comment.