From 3180f06b0a5173f84f7fe42801a5ee9bfb6253f6 Mon Sep 17 00:00:00 2001 From: dnwillia23 Date: Thu, 22 Jun 2023 18:26:18 -0400 Subject: [PATCH] [#7] Set initial parameters for each notebook --- ...obokop_TRAPI_multiple_IDs-checkpoint.ipynb | 222 +- .../HelloRobokop/HelloRobokop_ARA.ipynb | 1792 ++++++++++++++++- .../HelloRobokop/HelloRobokop_Compare.ipynb | 37 +- .../HelloRobokop/HelloRobokop_ExEmPLAR.ipynb | 150 +- .../HelloRobokop_Question_Builder.ipynb | 27 +- .../HelloRobokop/HelloRobokop_RobokopKG.ipynb | 132 +- .../HelloRobokop_TRAPI_multiple_IDs.ipynb | 222 +- 7 files changed, 2125 insertions(+), 457 deletions(-) diff --git a/Documentation/HelloRobokop/.ipynb_checkpoints/HelloRobokop_TRAPI_multiple_IDs-checkpoint.ipynb b/Documentation/HelloRobokop/.ipynb_checkpoints/HelloRobokop_TRAPI_multiple_IDs-checkpoint.ipynb index 09e0aa7..f0c6b52 100644 --- a/Documentation/HelloRobokop/.ipynb_checkpoints/HelloRobokop_TRAPI_multiple_IDs-checkpoint.ipynb +++ b/Documentation/HelloRobokop/.ipynb_checkpoints/HelloRobokop_TRAPI_multiple_IDs-checkpoint.ipynb @@ -3,6 +3,30 @@ { "cell_type": "code", "execution_count": 1, + "id": "e8538dff-a079-4613-a8a9-159f8c760a55", + "metadata": {}, + "outputs": [], + "source": [ + "# Parameter inputs\n", + "URL_node_normalizer = 'https://nodenormalization-sri.renci.org/get_normalized_nodes'\n", + "trapi_submit_url = \"http://automat-u24.apps.renci.org/robokopkg/1.3/query\"\n", + "\n", + "def URL_name_resolution_search(search_string):\n", + " return(f'https://name-resolution-sri.renci.org/lookup?string={search_string}&offset=0&limit=10')\n", + "\n", + "# Initializing directory to write\n", + "from datetime import datetime\n", + "from pathlib import Path\n", + "\n", + "now = datetime.now()\n", + "dt_string = now.strftime(\"%Y-%m-%d_%H%M%S\")\n", + "write_dir = Path(\"output/TRAPI\",str(dt_string))\n", + "write_dir.mkdir(parents=True, exist_ok=True)" + ] + }, + { + "cell_type": "code", + "execution_count": 2, "id": "31e6e5b9", "metadata": {}, "outputs": [], @@ -25,20 +49,19 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 3, "id": "273fefff", "metadata": {}, "outputs": [], "source": [ - "search_string = 'Buprenorphine'\n", - "results = requests.post(f'https://name-resolution-sri.renci.org/lookup?string={search_string}&offset=0&limit=10')\n", + "results = requests.post(URL_name_resolution_search('Buprenorphine'))\n", "results_json = results.json()\n", "#print(json.dumps(results_json,indent=4))" ] }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "id": "5e0ecf15", "metadata": {}, "outputs": [], @@ -49,7 +72,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "id": "c0cbbd71", "metadata": {}, "outputs": [ @@ -77,7 +100,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 6, "id": "0277cecd", "metadata": {}, "outputs": [ @@ -102,7 +125,8 @@ " 'id': { 'identifier': 'PUBCHEM.COMPOUND:3033050',\n", " 'label': 'Buprenorphine '\n", " 'hydrochloride'},\n", - " 'type': [ 'biolink:ChemicalMixture',\n", + " 'type': [ 'biolink:MolecularMixture',\n", + " 'biolink:ChemicalMixture',\n", " 'biolink:ChemicalEntity',\n", " 'biolink:NamedThing',\n", " 'biolink:Entity',\n", @@ -110,8 +134,7 @@ " 'biolink:ChemicalOrDrugOrTreatment',\n", " 'biolink:ChemicalEntityOrGeneOrGeneProduct',\n", " 'biolink:ChemicalEntityOrProteinOrPolypeptide',\n", - " 'biolink:PhysicalEssenceOrOccurrent',\n", - " 'biolink:MolecularMixture']},\n", + " 'biolink:PhysicalEssenceOrOccurrent']},\n", " 'PUBCHEM.COMPOUND:644073': { 'equivalent_identifiers': [ { 'identifier': 'PUBCHEM.COMPOUND:644073',\n", " 'label': 'Buprenorphine'},\n", " { 'identifier': 'CHEMBL.COMPOUND:CHEMBL560511',\n", @@ -138,7 +161,8 @@ " 'id': { 'identifier': 'PUBCHEM.COMPOUND:644073',\n", " 'label': 'Buprenorphine'},\n", " 'information_content': 100.0,\n", - " 'type': [ 'biolink:MolecularEntity',\n", + " 'type': [ 'biolink:SmallMolecule',\n", + " 'biolink:MolecularEntity',\n", " 'biolink:ChemicalEntity',\n", " 'biolink:NamedThing',\n", " 'biolink:Entity',\n", @@ -146,15 +170,15 @@ " 'biolink:ChemicalOrDrugOrTreatment',\n", " 'biolink:ChemicalEntityOrGeneOrGeneProduct',\n", " 'biolink:ChemicalEntityOrProteinOrPolypeptide',\n", - " 'biolink:PhysicalEssenceOrOccurrent',\n", - " 'biolink:SmallMolecule']},\n", + " 'biolink:PhysicalEssenceOrOccurrent']},\n", " 'PUBCHEM.COMPOUND:91745467': { 'equivalent_identifiers': [ { 'identifier': 'PUBCHEM.COMPOUND:91745467',\n", " 'label': 'Buprenorphine '\n", " 'tms'},\n", " { 'identifier': 'INCHIKEY:LBXMBXKWTGFREB-UHFFFAOYSA-N'}],\n", " 'id': { 'identifier': 'PUBCHEM.COMPOUND:91745467',\n", " 'label': 'Buprenorphine tms'},\n", - " 'type': [ 'biolink:MolecularEntity',\n", + " 'type': [ 'biolink:SmallMolecule',\n", + " 'biolink:MolecularEntity',\n", " 'biolink:ChemicalEntity',\n", " 'biolink:NamedThing',\n", " 'biolink:Entity',\n", @@ -162,14 +186,14 @@ " 'biolink:ChemicalOrDrugOrTreatment',\n", " 'biolink:ChemicalEntityOrGeneOrGeneProduct',\n", " 'biolink:ChemicalEntityOrProteinOrPolypeptide',\n", - " 'biolink:PhysicalEssenceOrOccurrent',\n", - " 'biolink:SmallMolecule']},\n", + " 'biolink:PhysicalEssenceOrOccurrent']},\n", " 'PUBCHEM.COMPOUND:9811785': { 'equivalent_identifiers': [ { 'identifier': 'PUBCHEM.COMPOUND:9811785',\n", " 'label': 'Buprenorphine(+)'},\n", " { 'identifier': 'INCHIKEY:RMRJXGBAOAMLHD-AGMYMXDYSA-N'}],\n", " 'id': { 'identifier': 'PUBCHEM.COMPOUND:9811785',\n", " 'label': 'Buprenorphine(+)'},\n", - " 'type': [ 'biolink:MolecularEntity',\n", + " 'type': [ 'biolink:SmallMolecule',\n", + " 'biolink:MolecularEntity',\n", " 'biolink:ChemicalEntity',\n", " 'biolink:NamedThing',\n", " 'biolink:Entity',\n", @@ -177,8 +201,7 @@ " 'biolink:ChemicalOrDrugOrTreatment',\n", " 'biolink:ChemicalEntityOrGeneOrGeneProduct',\n", " 'biolink:ChemicalEntityOrProteinOrPolypeptide',\n", - " 'biolink:PhysicalEssenceOrOccurrent',\n", - " 'biolink:SmallMolecule']},\n", + " 'biolink:PhysicalEssenceOrOccurrent']},\n", " 'PUBCHEM.COMPOUND:9848990': { 'equivalent_identifiers': [ { 'identifier': 'PUBCHEM.COMPOUND:9848990',\n", " 'label': 'Brixadi'},\n", " { 'identifier': 'CHEMBL.COMPOUND:CHEMBL511142',\n", @@ -186,7 +209,8 @@ " { 'identifier': 'INCHIKEY:RMRJXGBAOAMLHD-CTAPUXPBSA-N'}],\n", " 'id': { 'identifier': 'PUBCHEM.COMPOUND:9848990',\n", " 'label': 'Brixadi'},\n", - " 'type': [ 'biolink:MolecularEntity',\n", + " 'type': [ 'biolink:SmallMolecule',\n", + " 'biolink:MolecularEntity',\n", " 'biolink:ChemicalEntity',\n", " 'biolink:NamedThing',\n", " 'biolink:Entity',\n", @@ -194,17 +218,16 @@ " 'biolink:ChemicalOrDrugOrTreatment',\n", " 'biolink:ChemicalEntityOrGeneOrGeneProduct',\n", " 'biolink:ChemicalEntityOrProteinOrPolypeptide',\n", - " 'biolink:PhysicalEssenceOrOccurrent',\n", - " 'biolink:SmallMolecule']},\n", + " 'biolink:PhysicalEssenceOrOccurrent']},\n", " 'UMLS:C0366373': { 'equivalent_identifiers': [ { 'identifier': 'UMLS:C0366373',\n", " 'label': 'Buprenorphine:Mass:Pt:Dose:Qn'}],\n", " 'id': { 'identifier': 'UMLS:C0366373',\n", " 'label': 'Buprenorphine:Mass:Pt:Dose:Qn'},\n", - " 'type': [ 'biolink:Attribute',\n", + " 'type': [ 'biolink:ClinicalAttribute',\n", + " 'biolink:Attribute',\n", " 'biolink:NamedThing',\n", " 'biolink:Entity',\n", - " 'biolink:OntologyClass',\n", - " 'biolink:ClinicalAttribute']},\n", + " 'biolink:OntologyClass']},\n", " 'UMLS:C0524040': { 'equivalent_identifiers': [ { 'identifier': 'UMLS:C0524040',\n", " 'label': 'Buprenorphine '\n", " 'measurement '\n", @@ -212,41 +235,42 @@ " 'id': { 'identifier': 'UMLS:C0524040',\n", " 'label': 'Buprenorphine measurement '\n", " '(procedure)'},\n", - " 'type': [ 'biolink:NamedThing',\n", + " 'type': [ 'biolink:Procedure',\n", + " 'biolink:NamedThing',\n", " 'biolink:Entity',\n", " 'biolink:ActivityAndBehavior',\n", " 'biolink:Occurrent',\n", - " 'biolink:PhysicalEssenceOrOccurrent',\n", - " 'biolink:Procedure']},\n", + " 'biolink:PhysicalEssenceOrOccurrent']},\n", " 'UMLS:C0701445': { 'equivalent_identifiers': [ { 'identifier': 'UMLS:C0701445',\n", " 'label': 'buprenorphine '\n", " 'hydrochloride'}],\n", " 'id': { 'identifier': 'UMLS:C0701445',\n", " 'label': 'buprenorphine hydrochloride'},\n", - " 'type': [ 'biolink:NamedThing',\n", + " 'type': [ 'biolink:ChemicalEntity',\n", + " 'biolink:NamedThing',\n", " 'biolink:Entity',\n", " 'biolink:PhysicalEssence',\n", " 'biolink:ChemicalOrDrugOrTreatment',\n", " 'biolink:ChemicalEntityOrGeneOrGeneProduct',\n", " 'biolink:ChemicalEntityOrProteinOrPolypeptide',\n", - " 'biolink:PhysicalEssenceOrOccurrent',\n", - " 'biolink:ChemicalEntity']},\n", + " 'biolink:PhysicalEssenceOrOccurrent']},\n", " 'UMLS:C0799646': { 'equivalent_identifiers': [ { 'identifier': 'UMLS:C0799646',\n", " 'label': 'Buprenorphine:ACnc:Pt:Ser/Plas:Qn'}],\n", " 'id': { 'identifier': 'UMLS:C0799646',\n", " 'label': 'Buprenorphine:ACnc:Pt:Ser/Plas:Qn'},\n", - " 'type': [ 'biolink:Attribute',\n", + " 'type': [ 'biolink:ClinicalAttribute',\n", + " 'biolink:Attribute',\n", " 'biolink:NamedThing',\n", " 'biolink:Entity',\n", - " 'biolink:OntologyClass',\n", - " 'biolink:ClinicalAttribute']},\n", + " 'biolink:OntologyClass']},\n", " 'UMLS:C1171048': { 'equivalent_identifiers': [ { 'identifier': 'UMLS:C1171048',\n", " 'label': 'buprenorphine '\n", " '2 '\n", " 'MG'}],\n", " 'id': { 'identifier': 'UMLS:C1171048',\n", " 'label': 'buprenorphine 2 MG'},\n", - " 'type': [ 'biolink:MolecularMixture',\n", + " 'type': [ 'biolink:Drug',\n", + " 'biolink:MolecularMixture',\n", " 'biolink:ChemicalMixture',\n", " 'biolink:ChemicalEntity',\n", " 'biolink:NamedThing',\n", @@ -256,8 +280,7 @@ " 'biolink:PhysicalEssence',\n", " 'biolink:ChemicalEntityOrGeneOrGeneProduct',\n", " 'biolink:ChemicalEntityOrProteinOrPolypeptide',\n", - " 'biolink:PhysicalEssenceOrOccurrent',\n", - " 'biolink:Drug']}}\n" + " 'biolink:PhysicalEssenceOrOccurrent']}}\n" ] } ], @@ -266,7 +289,7 @@ " \"curies\": input_node_id_list,\n", " \"conflate\": True\n", "}\n", - "results = requests.post('https://nodenormalization-sri.renci.org/get_normalized_nodes',json=nn_query)\n", + "results = requests.post(URL_node_normalizer,json=nn_query)\n", "pp.pprint(results.json())" ] }, @@ -280,7 +303,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 7, "id": "1efdbc6b", "metadata": {}, "outputs": [], @@ -328,7 +351,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 8, "id": "3e8f4cef", "metadata": {}, "outputs": [ @@ -342,8 +365,7 @@ } ], "source": [ - "robokop_submit_url = \"http://automat-u24.apps.renci.org/robokopkg/1.3/query\"\n", - "response = requests.post(robokop_submit_url,json=query)\n", + "response = requests.post(trapi_submit_url,json=query)\n", "print(response.status_code)\n", "number_pathway_results = len(response.json()['message']['results'])\n", "print(len(response.json()['message']['results']))" @@ -357,22 +379,6 @@ "Being a TRAPI query, the response follows the same format described in `HelloRobokop_TRAPI.ipynb`, here omitted." ] }, - { - "cell_type": "code", - "execution_count": 10, - "id": "d784fdad", - "metadata": {}, - "outputs": [], - "source": [ - "from datetime import datetime\n", - "from pathlib import Path\n", - "\n", - "now = datetime.now()\n", - "dt_string = now.strftime(\"%Y-%m-%d_%H%M%S\")\n", - "write_dir = Path(\"output/TRAPI\",str(dt_string))\n", - "write_dir.mkdir(parents=True, exist_ok=True)" - ] - }, { "cell_type": "markdown", "id": "506dac9c", @@ -385,7 +391,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 9, "id": "7005e5a6", "metadata": {}, "outputs": [ @@ -423,10 +429,10 @@ " 0\n", " PUBCHEM.COMPOUND:644073\n", " Buprenorphine\n", - " NCBIGene:1565\n", - " CYP2D6\n", - " HP:0200085\n", - " Limb tremor\n", + " NCBIGene:4988\n", + " OPRM1\n", + " HP:0012164\n", + " Asterixis\n", " \n", " \n", " 0\n", @@ -434,8 +440,8 @@ " Buprenorphine\n", " NCBIGene:1565\n", " CYP2D6\n", - " HP:0002345\n", - " Action tremor\n", + " HP:0002174\n", + " Postural tremor\n", " \n", " \n", " 0\n", @@ -452,8 +458,8 @@ " Buprenorphine\n", " NCBIGene:1565\n", " CYP2D6\n", - " HP:0025387\n", - " Pill-rolling tremor\n", + " HP:0002322\n", + " Resting tremor\n", " \n", " \n", " 0\n", @@ -470,8 +476,8 @@ " Buprenorphine\n", " NCBIGene:1565\n", " CYP2D6\n", - " HP:0002322\n", - " Resting tremor\n", + " HP:0002345\n", + " Action tremor\n", " \n", " \n", " 0\n", @@ -479,17 +485,17 @@ " Buprenorphine\n", " NCBIGene:1565\n", " CYP2D6\n", - " HP:0002174\n", - " Postural tremor\n", + " HP:0025387\n", + " Pill-rolling tremor\n", " \n", " \n", " 0\n", " PUBCHEM.COMPOUND:644073\n", " Buprenorphine\n", - " NCBIGene:4988\n", - " OPRM1\n", - " HP:0012164\n", - " Asterixis\n", + " NCBIGene:1565\n", + " CYP2D6\n", + " HP:0200085\n", + " Limb tremor\n", " \n", " \n", "\n", @@ -497,24 +503,24 @@ ], "text/plain": [ " n00 n00_name n01 n01_name \\\n", - "0 PUBCHEM.COMPOUND:644073 Buprenorphine NCBIGene:1565 CYP2D6 \n", + "0 PUBCHEM.COMPOUND:644073 Buprenorphine NCBIGene:4988 OPRM1 \n", "0 PUBCHEM.COMPOUND:644073 Buprenorphine NCBIGene:1565 CYP2D6 \n", "0 PUBCHEM.COMPOUND:9848990 Brixadi NCBIGene:4988 OPRM1 \n", "0 PUBCHEM.COMPOUND:644073 Buprenorphine NCBIGene:1565 CYP2D6 \n", "0 PUBCHEM.COMPOUND:644073 Buprenorphine NCBIGene:1565 CYP2D6 \n", "0 PUBCHEM.COMPOUND:644073 Buprenorphine NCBIGene:1565 CYP2D6 \n", "0 PUBCHEM.COMPOUND:644073 Buprenorphine NCBIGene:1565 CYP2D6 \n", - "0 PUBCHEM.COMPOUND:644073 Buprenorphine NCBIGene:4988 OPRM1 \n", + "0 PUBCHEM.COMPOUND:644073 Buprenorphine NCBIGene:1565 CYP2D6 \n", "\n", " n02 n02_name \n", - "0 HP:0200085 Limb tremor \n", - "0 HP:0002345 Action tremor \n", "0 HP:0012164 Asterixis \n", - "0 HP:0025387 Pill-rolling tremor \n", - "0 HP:0001337 Tremor \n", - "0 HP:0002322 Resting tremor \n", "0 HP:0002174 Postural tremor \n", - "0 HP:0012164 Asterixis " + "0 HP:0012164 Asterixis \n", + "0 HP:0002322 Resting tremor \n", + "0 HP:0001337 Tremor \n", + "0 HP:0002345 Action tremor \n", + "0 HP:0025387 Pill-rolling tremor \n", + "0 HP:0200085 Limb tremor " ] }, "metadata": {}, @@ -524,14 +530,14 @@ "name": "stdout", "output_type": "stream", "text": [ - "[ 'Buprenorphine_CYP2D6_Limb_tremor',\n", - " 'Buprenorphine_CYP2D6_Action_tremor',\n", + "[ 'Buprenorphine_OPRM1_Asterixis',\n", + " 'Buprenorphine_CYP2D6_Postural_tremor',\n", " 'Brixadi_OPRM1_Asterixis',\n", - " 'Buprenorphine_CYP2D6_Pill-rolling_tremor',\n", - " 'Buprenorphine_CYP2D6_Tremor',\n", " 'Buprenorphine_CYP2D6_Resting_tremor',\n", - " 'Buprenorphine_CYP2D6_Postural_tremor',\n", - " 'Buprenorphine_OPRM1_Asterixis']\n" + " 'Buprenorphine_CYP2D6_Tremor',\n", + " 'Buprenorphine_CYP2D6_Action_tremor',\n", + " 'Buprenorphine_CYP2D6_Pill-rolling_tremor',\n", + " 'Buprenorphine_CYP2D6_Limb_tremor']\n" ] } ], @@ -574,7 +580,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 10, "id": "9bbad287", "metadata": {}, "outputs": [ @@ -582,30 +588,29 @@ "name": "stdout", "output_type": "stream", "text": [ - "Pathway result: Buprenorphine_CYP2D6_Limb_tremor\n", - "{ 'Buprenorphine -> biolink:affects -> CYP2D6': 1,\n", - " 'Buprenorphine -> biolink:directly_physically_interacts_with -> CYP2D6': 1,\n", - " 'Buprenorphine -> biolink:regulates -> CYP2D6': 1,\n", - " 'CYP2D6 -> biolink:affects -> Buprenorphine': 1,\n", - " 'CYP2D6 -> biolink:genetic_association -> Limb tremor': 1}\n", + "Pathway result: Buprenorphine_OPRM1_Asterixis\n", + "{ 'Buprenorphine -> biolink:affects -> OPRM1': 4,\n", + " 'Buprenorphine -> biolink:directly_physically_interacts_with -> OPRM1': 1,\n", + " 'Buprenorphine -> biolink:related_to -> OPRM1': 1,\n", + " 'OPRM1 -> biolink:genetic_association -> Asterixis': 1}\n", "\n", - "Pathway result: Buprenorphine_CYP2D6_Action_tremor\n", + "Pathway result: Buprenorphine_CYP2D6_Postural_tremor\n", "{ 'Buprenorphine -> biolink:affects -> CYP2D6': 1,\n", " 'Buprenorphine -> biolink:directly_physically_interacts_with -> CYP2D6': 1,\n", " 'Buprenorphine -> biolink:regulates -> CYP2D6': 1,\n", " 'CYP2D6 -> biolink:affects -> Buprenorphine': 1,\n", - " 'CYP2D6 -> biolink:genetic_association -> Action tremor': 1}\n", + " 'CYP2D6 -> biolink:genetic_association -> Postural tremor': 1}\n", "\n", "Pathway result: Brixadi_OPRM1_Asterixis\n", "{ 'Brixadi -> biolink:affects -> OPRM1': 1,\n", " 'OPRM1 -> biolink:genetic_association -> Asterixis': 1}\n", "\n", - "Pathway result: Buprenorphine_CYP2D6_Pill-rolling_tremor\n", + "Pathway result: Buprenorphine_CYP2D6_Resting_tremor\n", "{ 'Buprenorphine -> biolink:affects -> CYP2D6': 1,\n", " 'Buprenorphine -> biolink:directly_physically_interacts_with -> CYP2D6': 1,\n", " 'Buprenorphine -> biolink:regulates -> CYP2D6': 1,\n", " 'CYP2D6 -> biolink:affects -> Buprenorphine': 1,\n", - " 'CYP2D6 -> biolink:genetic_association -> Pill-rolling tremor': 1}\n", + " 'CYP2D6 -> biolink:genetic_association -> Resting tremor': 1}\n", "\n", "Pathway result: Buprenorphine_CYP2D6_Tremor\n", "{ 'Buprenorphine -> biolink:affects -> CYP2D6': 1,\n", @@ -614,25 +619,26 @@ " 'CYP2D6 -> biolink:affects -> Buprenorphine': 1,\n", " 'CYP2D6 -> biolink:genetic_association -> Tremor': 2}\n", "\n", - "Pathway result: Buprenorphine_CYP2D6_Resting_tremor\n", + "Pathway result: Buprenorphine_CYP2D6_Action_tremor\n", "{ 'Buprenorphine -> biolink:affects -> CYP2D6': 1,\n", " 'Buprenorphine -> biolink:directly_physically_interacts_with -> CYP2D6': 1,\n", " 'Buprenorphine -> biolink:regulates -> CYP2D6': 1,\n", " 'CYP2D6 -> biolink:affects -> Buprenorphine': 1,\n", - " 'CYP2D6 -> biolink:genetic_association -> Resting tremor': 1}\n", + " 'CYP2D6 -> biolink:genetic_association -> Action tremor': 1}\n", "\n", - "Pathway result: Buprenorphine_CYP2D6_Postural_tremor\n", + "Pathway result: Buprenorphine_CYP2D6_Pill-rolling_tremor\n", "{ 'Buprenorphine -> biolink:affects -> CYP2D6': 1,\n", " 'Buprenorphine -> biolink:directly_physically_interacts_with -> CYP2D6': 1,\n", " 'Buprenorphine -> biolink:regulates -> CYP2D6': 1,\n", " 'CYP2D6 -> biolink:affects -> Buprenorphine': 1,\n", - " 'CYP2D6 -> biolink:genetic_association -> Postural tremor': 1}\n", + " 'CYP2D6 -> biolink:genetic_association -> Pill-rolling tremor': 1}\n", "\n", - "Pathway result: Buprenorphine_OPRM1_Asterixis\n", - "{ 'Buprenorphine -> biolink:affects -> OPRM1': 4,\n", - " 'Buprenorphine -> biolink:directly_physically_interacts_with -> OPRM1': 1,\n", - " 'Buprenorphine -> biolink:related_to -> OPRM1': 1,\n", - " 'OPRM1 -> biolink:genetic_association -> Asterixis': 1}\n", + "Pathway result: Buprenorphine_CYP2D6_Limb_tremor\n", + "{ 'Buprenorphine -> biolink:affects -> CYP2D6': 1,\n", + " 'Buprenorphine -> biolink:directly_physically_interacts_with -> CYP2D6': 1,\n", + " 'Buprenorphine -> biolink:regulates -> CYP2D6': 1,\n", + " 'CYP2D6 -> biolink:affects -> Buprenorphine': 1,\n", + " 'CYP2D6 -> biolink:genetic_association -> Limb tremor': 1}\n", "\n" ] } diff --git a/Documentation/HelloRobokop/HelloRobokop_ARA.ipynb b/Documentation/HelloRobokop/HelloRobokop_ARA.ipynb index fcd4445..9185884 100644 --- a/Documentation/HelloRobokop/HelloRobokop_ARA.ipynb +++ b/Documentation/HelloRobokop/HelloRobokop_ARA.ipynb @@ -2,7 +2,29 @@ "cells": [ { "cell_type": "code", - "execution_count": null, + "execution_count": 21, + "id": "7c8b8950-c0e2-4a1c-8896-7f450fd14b8d", + "metadata": {}, + "outputs": [], + "source": [ + "# Parameter inputs\n", + "aragorn_submit_url = \"https://aragorn-u24.apps.renci.org/robokop/query\"\n", + "CURIE_buprenorphine_PubChem = \"PUBCHEM.COMPOUND:644073\"\n", + "CURIE_tremor_HP = \"HP:0001337\"\n", + "\n", + "# Initializing directory to write\n", + "from datetime import datetime\n", + "from pathlib import Path\n", + "\n", + "now = datetime.now()\n", + "dt_string = now.strftime(\"%Y-%m-%d_%H%M%S\")\n", + "write_dir = Path(\"output/TRAPI\",str(dt_string))\n", + "write_dir.mkdir(parents=True, exist_ok=True)" + ] + }, + { + "cell_type": "code", + "execution_count": 22, "id": "c2b5bd45", "metadata": {}, "outputs": [], @@ -32,7 +54,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "id": "35558066", "metadata": {}, "outputs": [], @@ -54,14 +76,14 @@ " },\n", " \"nodes\": {\n", " \"n00\": {\n", - " \"ids\": [\"PUBCHEM.COMPOUND:644073\"],\n", + " \"ids\": [CURIE_buprenorphine_PubChem],\n", " \"categories\": [\"biolink:ChemicalEntity\"]\n", " },\n", " \"n01\": {\n", " \"categories\": [\"biolink:BiologicalProcessOrActivity\",\"biolink:Gene\",\"biolink:Pathway\"]\n", " },\n", " \"n02\": {\n", - " \"ids\": [\"HP:0001337\"],\n", + " \"ids\": [CURIE_tremor_HP],\n", " \"categories\": [\"biolink:DiseaseOrPhenotypicFeature\"]\n", " }\n", " }\n", @@ -80,13 +102,21 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "id": "8aabca1a", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "200\n", + "7\n" + ] + } + ], "source": [ - "aragorn_submit = \"https://aragorn-u24.apps.renci.org/robokop/query\"\n", - "response = requests.post(aragorn_submit,json=query)\n", + "response = requests.post(aragorn_submit_url,json=query)\n", "print(response.status_code)\n", "number_pathway_results = len(response.json()['message']['results'])\n", "print(len(response.json()['message']['results']))" @@ -94,7 +124,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "id": "0329c676", "metadata": {}, "outputs": [], @@ -113,10 +143,19 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "id": "50bc1cf8", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "dict_keys(['message', 'logs', 'status', 'pid'])\n", + "dict_keys(['query_graph', 'knowledge_graph', 'results'])\n" + ] + } + ], "source": [ "print(response.json().keys())\n", "print(response.json()['message'].keys())\n", @@ -138,10 +177,55 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "id": "a4e3a196-3c0a-4273-9315-67182f2fa16f", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['n00', 'n01', 'n02']\n", + "['e00', 'e01']\n", + "{ 'message': { 'query_graph': { 'edges': { 'e00': { 'object': 'n01',\n", + " 'predicates': [ 'biolink:related_to'],\n", + " 'subject': 'n00'},\n", + " 'e01': { 'object': 'n02',\n", + " 'predicates': [ 'biolink:related_to'],\n", + " 'subject': 'n01'}},\n", + " 'nodes': { 'n00': { 'categories': [ 'biolink:ChemicalEntity'],\n", + " 'ids': [ 'PUBCHEM.COMPOUND:644073']},\n", + " 'n01': { 'categories': [ 'biolink:BiologicalProcessOrActivity',\n", + " 'biolink:Gene',\n", + " 'biolink:Pathway']},\n", + " 'n02': { 'categories': [ 'biolink:DiseaseOrPhenotypicFeature'],\n", + " 'ids': [ 'HP:0001337']}}}}}\n", + "{ 'edges': { 'e00': { 'attribute_constraints': [],\n", + " 'object': 'n01',\n", + " 'predicates': ['biolink:related_to'],\n", + " 'qualifier_constraints': [],\n", + " 'subject': 'n00'},\n", + " 'e01': { 'attribute_constraints': [],\n", + " 'object': 'n02',\n", + " 'predicates': ['biolink:related_to'],\n", + " 'qualifier_constraints': [],\n", + " 'subject': 'n01'}},\n", + " 'nodes': { 'n00': { 'categories': ['biolink:ChemicalEntity'],\n", + " 'constraints': [],\n", + " 'ids': ['PUBCHEM.COMPOUND:644073'],\n", + " 'is_set': False},\n", + " 'n01': { 'categories': [ 'biolink:BiologicalProcessOrActivity',\n", + " 'biolink:Gene',\n", + " 'biolink:Pathway'],\n", + " 'constraints': [],\n", + " 'is_set': False},\n", + " 'n02': { 'categories': [ 'biolink:DiseaseOrPhenotypicFeature'],\n", + " 'constraints': [],\n", + " 'ids': ['HP:0001337'],\n", + " 'is_set': False}}}\n" + ] + } + ], "source": [ "edges = [\"e00\", \"e01\"]\n", "nodes = [\"n00\", \"n01\", \"n02\"]\n", @@ -162,10 +246,518 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "id": "e98dcea6", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[ { 'edge_bindings': { 'e00': [ { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:hetionet',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.2794695688557669,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '88245379'},\n", + " { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:textminingkp',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.5184467655944169,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '79325668'},\n", + " { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:ctd',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.5184467655944169,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '113499113'},\n", + " { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:ctd',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.5184467655944169,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '8608859'}],\n", + " 'e01': [ { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:ctd',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.2794695688557669,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '50901981'},\n", + " { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:disgenet',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.2794695688557669,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '75966132'}],\n", + " 's2': [ { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:omnicorp',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.02058974858003304,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '697aaebf-3ebe-4ee7-ad23-1187fed57565'}],\n", + " 's6': [ { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:omnicorp',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.02484230022373346,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '0ababdb9-4147-489b-9aff-3d793ad1dbc6'}],\n", + " 's7': [ { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:omnicorp',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.03245377021286244,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '4f1fedef-2a2c-4edf-bc41-7540f8f5de5a'}]},\n", + " 'node_bindings': { 'n00': [ { 'id': 'PUBCHEM.COMPOUND:644073',\n", + " 'qnode_id': 'PUBCHEM.COMPOUND:644073'}],\n", + " 'n01': [{'id': 'NCBIGene:1565'}],\n", + " 'n02': [ { 'id': 'HP:0001337',\n", + " 'qnode_id': 'HP:0001337'}]},\n", + " 'score': 0.24054207686854318},\n", + " { 'edge_bindings': { 'e00': [ { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:pharos',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.5184467655944169,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '72763212'},\n", + " { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:hetionet',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.2794695688557669,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '98415152'},\n", + " { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:pharos',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.2794695688557669,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '69086308'},\n", + " { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:ctd',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.5184467655944169,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '112610254'},\n", + " { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:gtopdb',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.5184467655944169,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '16978501'},\n", + " { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:drugcentral',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.2794695688557669,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '52652088'}],\n", + " 'e01': [ { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:disgenet',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.2794695688557669,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '120977388'}],\n", + " 's4': [ { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:omnicorp',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.0006445177442371275,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': 'af25d08c-0128-44c9-8080-eba56d04ea73'}],\n", + " 's5': [ { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:omnicorp',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.014844807758350065,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '0d83d253-e4ef-4437-b5ca-b8e74874ab46'}]},\n", + " 'node_bindings': { 'n00': [ { 'id': 'PUBCHEM.COMPOUND:644073',\n", + " 'qnode_id': 'PUBCHEM.COMPOUND:644073'}],\n", + " 'n01': [{'id': 'NCBIGene:4988'}],\n", + " 'n02': [ { 'id': 'HP:0012164',\n", + " 'qnode_id': 'HP:0001337'}]},\n", + " 'score': 0.13169211512866802},\n", + " { 'edge_bindings': { 'e00': [ { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:hetionet',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.2794695688557669,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '88245379'},\n", + " { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:textminingkp',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.5184467655944169,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '79325668'},\n", + " { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:ctd',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.5184467655944169,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '113499113'},\n", + " { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:ctd',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.5184467655944169,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '8608859'}],\n", + " 'e01': [ { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:disgenet',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.2794695688557669,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '1528772'}],\n", + " 's10': [ { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:omnicorp',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.0018336824833178333,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': 'd7fe8088-35ab-4b4d-a13e-f01a37354ad3'}],\n", + " 's11': [ { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:omnicorp',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.0010965444767023769,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '63b08844-30f6-4e62-8d51-f70b64e4e60f'}],\n", + " 's2': [ { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:omnicorp',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.02058974858003304,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '697aaebf-3ebe-4ee7-ad23-1187fed57565'}]},\n", + " 'node_bindings': { 'n00': [ { 'id': 'PUBCHEM.COMPOUND:644073',\n", + " 'qnode_id': 'PUBCHEM.COMPOUND:644073'}],\n", + " 'n01': [{'id': 'NCBIGene:1565'}],\n", + " 'n02': [ { 'id': 'HP:0002322',\n", + " 'qnode_id': 'HP:0001337'}]},\n", + " 'score': 0.13022177911375757},\n", + " { 'edge_bindings': { 'e00': [ { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:hetionet',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.2794695688557669,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '88245379'},\n", + " { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:textminingkp',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.5184467655944169,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '79325668'},\n", + " { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:ctd',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.5184467655944169,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '113499113'},\n", + " { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:ctd',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.5184467655944169,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '8608859'}],\n", + " 'e01': [ { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:disgenet',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.2794695688557669,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '93669526'}],\n", + " 's2': [ { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:omnicorp',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.02058974858003304,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '697aaebf-3ebe-4ee7-ad23-1187fed57565'}],\n", + " 's8': [ { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:omnicorp',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.0011355923193065998,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': 'e607219d-f7fa-4f7c-8ff4-e7f906a8d5c2'}]},\n", + " 'node_bindings': { 'n00': [ { 'id': 'PUBCHEM.COMPOUND:644073',\n", + " 'qnode_id': 'PUBCHEM.COMPOUND:644073'}],\n", + " 'n01': [{'id': 'NCBIGene:1565'}],\n", + " 'n02': [ { 'id': 'HP:0002345',\n", + " 'qnode_id': 'HP:0001337'}]},\n", + " 'score': 0.12951214746439604},\n", + " { 'edge_bindings': { 'e00': [ { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:hetionet',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.2794695688557669,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '88245379'},\n", + " { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:textminingkp',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.5184467655944169,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '79325668'},\n", + " { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:ctd',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.5184467655944169,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '113499113'},\n", + " { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:ctd',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.5184467655944169,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '8608859'}],\n", + " 'e01': [ { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:disgenet',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.2794695688557669,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '76822934'}],\n", + " 's2': [ { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:omnicorp',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.02058974858003304,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '697aaebf-3ebe-4ee7-ad23-1187fed57565'}]},\n", + " 'node_bindings': { 'n00': [ { 'id': 'PUBCHEM.COMPOUND:644073',\n", + " 'qnode_id': 'PUBCHEM.COMPOUND:644073'}],\n", + " 'n01': [{'id': 'NCBIGene:1565'}],\n", + " 'n02': [ { 'id': 'HP:0200085',\n", + " 'qnode_id': 'HP:0001337'}]},\n", + " 'score': 0.12910851956982536},\n", + " { 'edge_bindings': { 'e00': [ { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:hetionet',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.2794695688557669,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '88245379'},\n", + " { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:textminingkp',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.5184467655944169,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '79325668'},\n", + " { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:ctd',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.5184467655944169,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '113499113'},\n", + " { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:ctd',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.5184467655944169,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '8608859'}],\n", + " 'e01': [ { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:disgenet',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.2794695688557669,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '59229547'}],\n", + " 's2': [ { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:omnicorp',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.02058974858003304,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '697aaebf-3ebe-4ee7-ad23-1187fed57565'}]},\n", + " 'node_bindings': { 'n00': [ { 'id': 'PUBCHEM.COMPOUND:644073',\n", + " 'qnode_id': 'PUBCHEM.COMPOUND:644073'}],\n", + " 'n01': [{'id': 'NCBIGene:1565'}],\n", + " 'n02': [ { 'id': 'HP:0025387',\n", + " 'qnode_id': 'HP:0001337'}]},\n", + " 'score': 0.12910851956982536},\n", + " { 'edge_bindings': { 'e00': [ { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:hetionet',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.2794695688557669,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '88245379'},\n", + " { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:textminingkp',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.5184467655944169,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '79325668'},\n", + " { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:ctd',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.5184467655944169,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '113499113'},\n", + " { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:ctd',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.5184467655944169,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '8608859'}],\n", + " 'e01': [ { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:disgenet',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.2794695688557669,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '62620896'}],\n", + " 's2': [ { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:omnicorp',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.02058974858003304,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '697aaebf-3ebe-4ee7-ad23-1187fed57565'}]},\n", + " 'node_bindings': { 'n00': [ { 'id': 'PUBCHEM.COMPOUND:644073',\n", + " 'qnode_id': 'PUBCHEM.COMPOUND:644073'}],\n", + " 'n01': [{'id': 'NCBIGene:1565'}],\n", + " 'n02': [ { 'id': 'HP:0002174',\n", + " 'qnode_id': 'HP:0001337'}]},\n", + " 'score': 0.12910851956982536}]\n" + ] + } + ], "source": [ "pp.pprint(results)" ] @@ -180,10 +772,18 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 9, "id": "1aa88f70", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "dict_keys(['nodes', 'edges'])\n" + ] + } + ], "source": [ "pp.pprint(kg.keys())" ] @@ -198,10 +798,45 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 10, "id": "dce3e3c7", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "('HP:0012164',\n", + " {'categories': ['biolink:Entity',\n", + " 'biolink:PhenotypicFeature',\n", + " 'biolink:BiologicalEntity',\n", + " 'biolink:ThingWithTaxon',\n", + " 'biolink:DiseaseOrPhenotypicFeature',\n", + " 'biolink:NamedThing'],\n", + " 'name': 'Asterixis',\n", + " 'attributes': [{'attribute_type_id': 'dct:description',\n", + " 'value': 'A clinical sign indicating a lapse of posture and is usually manifest by a bilateral flapping tremor at the wrist, metacarpophalangeal, and hip joints.',\n", + " 'value_type_id': 'EDAM:data_0006',\n", + " 'original_attribute_name': 'description'},\n", + " {'attribute_type_id': 'biolink:has_count',\n", + " 'value': 344,\n", + " 'value_type_id': 'EDAM:data_0006',\n", + " 'original_attribute_name': 'omnicorp_article_count'},\n", + " {'attribute_type_id': 'biolink:same_as',\n", + " 'value': ['MEDDRA:10057580',\n", + " 'UMLS:C0232766',\n", + " 'NCIT:C86048',\n", + " 'SNOMEDCT:32838008',\n", + " 'HP:0012164',\n", + " 'MEDDRA:10003547'],\n", + " 'value_type_id': 'metatype:uriorcurie',\n", + " 'original_attribute_name': 'equivalent_identifiers'}]})" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "next(iter( kg['nodes'].items() ))" ] @@ -216,10 +851,56 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 11, "id": "8d1e2a3d", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "('79325668',\n", + " {'subject': 'PUBCHEM.COMPOUND:644073',\n", + " 'object': 'NCBIGene:1565',\n", + " 'predicate': 'biolink:regulates',\n", + " 'qualifiers': [{'qualifier_type_id': 'biolink:object_direction_qualifier',\n", + " 'qualifier_value': 'downregulated'}],\n", + " 'attributes': [{'attribute_type_id': 'biolink:Attribute',\n", + " 'value': 'Buprenorphine exhibited potent, competitive inhibition of CYP2D6 (Ki 10 +/- 2 microM and 1.8 +/- 0.2 microM) and CYP3A4 (Ki 40 +/- 1.6 microM and 19 +/- 1.2 microM) in microsomes from human liver and cDNA-expressing lymphoblasts, respectively.|PMID:12756210',\n", + " 'value_type_id': 'EDAM:data_0006',\n", + " 'original_attribute_name': 'sentences'},\n", + " {'attribute_type_id': 'biolink:aggregator_knowledge_source',\n", + " 'value': ['infores:automat-robokop'],\n", + " 'value_type_id': 'biolink:InformationResource',\n", + " 'original_attribute_name': 'biolink:aggregator_knowledge_source',\n", + " 'attribute_source': 'infores:automat-robokop'},\n", + " {'attribute_type_id': 'biolink:publications',\n", + " 'value': ['PMID:12756210'],\n", + " 'value_type_id': 'EDAM:data_0006',\n", + " 'original_attribute_name': 'publications'},\n", + " {'attribute_type_id': 'biolink:Attribute',\n", + " 'value': '0.99969625',\n", + " 'value_type_id': 'EDAM:data_0006',\n", + " 'original_attribute_name': 'biolink:tmkp_confidence_score'},\n", + " {'attribute_type_id': 'biolink:Attribute',\n", + " 'value': ['tmkp:12699a64cae70b20411935b5e5028d220ccbe4f7a0ad13a81978026cb43111bf'],\n", + " 'value_type_id': 'EDAM:data_0006',\n", + " 'original_attribute_name': 'tmkp_ids'},\n", + " {'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'value': 1,\n", + " 'value_type_id': 'EDAM:data_1669',\n", + " 'original_attribute_name': 'weight'},\n", + " {'attribute_type_id': 'biolink:primary_knowledge_source',\n", + " 'value': 'infores:textminingkp',\n", + " 'value_type_id': 'biolink:InformationResource',\n", + " 'original_attribute_name': 'biolink:primary_knowledge_source',\n", + " 'attribute_source': 'infores:automat-robokop'}]})" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "next(iter( kg['edges'].items() ))" ] @@ -234,39 +915,109 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 12, "id": "8cb2fc88", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{ 'edge_bindings': { 'e00': [ { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:hetionet',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.2794695688557669,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '88245379'},\n", + " { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:textminingkp',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.5184467655944169,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '79325668'},\n", + " { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:ctd',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.5184467655944169,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '113499113'},\n", + " { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:ctd',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.5184467655944169,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '8608859'}],\n", + " 'e01': [ { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:ctd',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.2794695688557669,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '50901981'},\n", + " { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:disgenet',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.2794695688557669,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '75966132'}],\n", + " 's2': [ { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:omnicorp',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.02058974858003304,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '697aaebf-3ebe-4ee7-ad23-1187fed57565'}],\n", + " 's6': [ { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:omnicorp',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.02484230022373346,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '0ababdb9-4147-489b-9aff-3d793ad1dbc6'}],\n", + " 's7': [ { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'attributes': [ { 'attribute_type_id': 'biolink:has_qualitative_value',\n", + " 'original_attribute_name': 'aragorn_weight_source',\n", + " 'value': 'infores:omnicorp',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 0.03245377021286244,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'id': '4f1fedef-2a2c-4edf-bc41-7540f8f5de5a'}]},\n", + " 'node_bindings': { 'n00': [ { 'id': 'PUBCHEM.COMPOUND:644073',\n", + " 'qnode_id': 'PUBCHEM.COMPOUND:644073'}],\n", + " 'n01': [{'id': 'NCBIGene:1565'}],\n", + " 'n02': [ { 'id': 'HP:0001337',\n", + " 'qnode_id': 'HP:0001337'}]},\n", + " 'score': 0.24054207686854318}\n" + ] + } + ], "source": [ "# Illustrating the structure of each pathway result from the message property\n", "pp.pprint(results[0])" ] }, - { - "cell_type": "markdown", - "id": "b0609aed", - "metadata": {}, - "source": [ - "To export the results from our query, we create a directory with today's date to hold the output files and then convert our output dictionaries into a set of tables, which can be easily exported." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "e0e9dce4", - "metadata": {}, - "outputs": [], - "source": [ - "from datetime import datetime\n", - "from pathlib import Path\n", - "\n", - "now = datetime.now()\n", - "dt_string = now.strftime(\"%Y-%m-%d_%H%M%S\")\n", - "write_dir = Path(\"output/TRAPI\",str(dt_string))\n", - "write_dir.mkdir(parents=True, exist_ok=True)" - ] - }, { "cell_type": "markdown", "id": "e174e457", @@ -277,10 +1028,144 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 13, "id": "3e18935e", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
n00n00_namen01n01_namen02n02_name
0PUBCHEM.COMPOUND:644073BuprenorphineNCBIGene:1565CYP2D6HP:0001337Tremor
0PUBCHEM.COMPOUND:644073BuprenorphineNCBIGene:4988OPRM1HP:0012164Asterixis
0PUBCHEM.COMPOUND:644073BuprenorphineNCBIGene:1565CYP2D6HP:0002322Resting tremor
0PUBCHEM.COMPOUND:644073BuprenorphineNCBIGene:1565CYP2D6HP:0002345Action tremor
0PUBCHEM.COMPOUND:644073BuprenorphineNCBIGene:1565CYP2D6HP:0200085Limb tremor
0PUBCHEM.COMPOUND:644073BuprenorphineNCBIGene:1565CYP2D6HP:0025387Pill-rolling tremor
0PUBCHEM.COMPOUND:644073BuprenorphineNCBIGene:1565CYP2D6HP:0002174Postural tremor
\n", + "
" + ], + "text/plain": [ + " n00 n00_name n01 n01_name n02 \\\n", + "0 PUBCHEM.COMPOUND:644073 Buprenorphine NCBIGene:1565 CYP2D6 HP:0001337 \n", + "0 PUBCHEM.COMPOUND:644073 Buprenorphine NCBIGene:4988 OPRM1 HP:0012164 \n", + "0 PUBCHEM.COMPOUND:644073 Buprenorphine NCBIGene:1565 CYP2D6 HP:0002322 \n", + "0 PUBCHEM.COMPOUND:644073 Buprenorphine NCBIGene:1565 CYP2D6 HP:0002345 \n", + "0 PUBCHEM.COMPOUND:644073 Buprenorphine NCBIGene:1565 CYP2D6 HP:0200085 \n", + "0 PUBCHEM.COMPOUND:644073 Buprenorphine NCBIGene:1565 CYP2D6 HP:0025387 \n", + "0 PUBCHEM.COMPOUND:644073 Buprenorphine NCBIGene:1565 CYP2D6 HP:0002174 \n", + "\n", + " n02_name \n", + "0 Tremor \n", + "0 Asterixis \n", + "0 Resting tremor \n", + "0 Action tremor \n", + "0 Limb tremor \n", + "0 Pill-rolling tremor \n", + "0 Postural tremor " + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[ 'Buprenorphine_CYP2D6_Tremor',\n", + " 'Buprenorphine_OPRM1_Asterixis',\n", + " 'Buprenorphine_CYP2D6_Resting_tremor',\n", + " 'Buprenorphine_CYP2D6_Action_tremor',\n", + " 'Buprenorphine_CYP2D6_Limb_tremor',\n", + " 'Buprenorphine_CYP2D6_Pill-rolling_tremor',\n", + " 'Buprenorphine_CYP2D6_Postural_tremor']\n" + ] + } + ], "source": [ "import pandas as pd\n", "import os\n", @@ -318,10 +1203,78 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 14, "id": "0b5e9964", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Pathway result: Buprenorphine_CYP2D6_Tremor\n", + "{ 'Buprenorphine -> biolink:affects -> CYP2D6': 1,\n", + " 'Buprenorphine -> biolink:directly_physically_interacts_with -> CYP2D6': 1,\n", + " 'Buprenorphine -> biolink:regulates -> CYP2D6': 1,\n", + " 'CYP2D6 -> biolink:affects -> Buprenorphine': 1,\n", + " 'CYP2D6 -> biolink:genetic_association -> Tremor': 2,\n", + " 'CYP2D6 -> biolink:occurs_together_in_literature_with -> Buprenorphine': 1,\n", + " 'Tremor -> biolink:occurs_together_in_literature_with -> Buprenorphine': 1,\n", + " 'Tremor -> biolink:occurs_together_in_literature_with -> CYP2D6': 1}\n", + "\n", + "Pathway result: Buprenorphine_OPRM1_Asterixis\n", + "{ 'Asterixis -> biolink:occurs_together_in_literature_with -> Buprenorphine': 1,\n", + " 'Buprenorphine -> biolink:affects -> OPRM1': 4,\n", + " 'Buprenorphine -> biolink:directly_physically_interacts_with -> OPRM1': 1,\n", + " 'Buprenorphine -> biolink:related_to -> OPRM1': 1,\n", + " 'OPRM1 -> biolink:genetic_association -> Asterixis': 1,\n", + " 'OPRM1 -> biolink:occurs_together_in_literature_with -> Buprenorphine': 1}\n", + "\n", + "Pathway result: Buprenorphine_CYP2D6_Resting_tremor\n", + "{ 'Buprenorphine -> biolink:affects -> CYP2D6': 1,\n", + " 'Buprenorphine -> biolink:directly_physically_interacts_with -> CYP2D6': 1,\n", + " 'Buprenorphine -> biolink:regulates -> CYP2D6': 1,\n", + " 'CYP2D6 -> biolink:affects -> Buprenorphine': 1,\n", + " 'CYP2D6 -> biolink:genetic_association -> Resting tremor': 1,\n", + " 'CYP2D6 -> biolink:occurs_together_in_literature_with -> Buprenorphine': 1,\n", + " 'Resting tremor -> biolink:occurs_together_in_literature_with -> Buprenorphine': 1,\n", + " 'Resting tremor -> biolink:occurs_together_in_literature_with -> CYP2D6': 1}\n", + "\n", + "Pathway result: Buprenorphine_CYP2D6_Action_tremor\n", + "{ 'Action tremor -> biolink:occurs_together_in_literature_with -> CYP2D6': 1,\n", + " 'Buprenorphine -> biolink:affects -> CYP2D6': 1,\n", + " 'Buprenorphine -> biolink:directly_physically_interacts_with -> CYP2D6': 1,\n", + " 'Buprenorphine -> biolink:regulates -> CYP2D6': 1,\n", + " 'CYP2D6 -> biolink:affects -> Buprenorphine': 1,\n", + " 'CYP2D6 -> biolink:genetic_association -> Action tremor': 1,\n", + " 'CYP2D6 -> biolink:occurs_together_in_literature_with -> Buprenorphine': 1}\n", + "\n", + "Pathway result: Buprenorphine_CYP2D6_Limb_tremor\n", + "{ 'Buprenorphine -> biolink:affects -> CYP2D6': 1,\n", + " 'Buprenorphine -> biolink:directly_physically_interacts_with -> CYP2D6': 1,\n", + " 'Buprenorphine -> biolink:regulates -> CYP2D6': 1,\n", + " 'CYP2D6 -> biolink:affects -> Buprenorphine': 1,\n", + " 'CYP2D6 -> biolink:genetic_association -> Limb tremor': 1,\n", + " 'CYP2D6 -> biolink:occurs_together_in_literature_with -> Buprenorphine': 1}\n", + "\n", + "Pathway result: Buprenorphine_CYP2D6_Pill-rolling_tremor\n", + "{ 'Buprenorphine -> biolink:affects -> CYP2D6': 1,\n", + " 'Buprenorphine -> biolink:directly_physically_interacts_with -> CYP2D6': 1,\n", + " 'Buprenorphine -> biolink:regulates -> CYP2D6': 1,\n", + " 'CYP2D6 -> biolink:affects -> Buprenorphine': 1,\n", + " 'CYP2D6 -> biolink:genetic_association -> Pill-rolling tremor': 1,\n", + " 'CYP2D6 -> biolink:occurs_together_in_literature_with -> Buprenorphine': 1}\n", + "\n", + "Pathway result: Buprenorphine_CYP2D6_Postural_tremor\n", + "{ 'Buprenorphine -> biolink:affects -> CYP2D6': 1,\n", + " 'Buprenorphine -> biolink:directly_physically_interacts_with -> CYP2D6': 1,\n", + " 'Buprenorphine -> biolink:regulates -> CYP2D6': 1,\n", + " 'CYP2D6 -> biolink:affects -> Buprenorphine': 1,\n", + " 'CYP2D6 -> biolink:genetic_association -> Postural tremor': 1,\n", + " 'CYP2D6 -> biolink:occurs_together_in_literature_with -> Buprenorphine': 1}\n", + "\n" + ] + } + ], "source": [ "from collections import Counter\n", "import json\n", @@ -366,10 +1319,21 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 15, "id": "7873e085", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "dict_keys(['node_bindings', 'edge_bindings', 'score'])\n", + "dict_keys(['n02', 'n01', 'n00'])\n", + "dict_keys(['e00', 'e01', 's2', 's6', 's7'])\n", + "0.24054207686854318\n" + ] + } + ], "source": [ "pp.pprint(results[0].keys())\n", "pp.pprint(results[0]['node_bindings'].keys())\n", @@ -379,10 +1343,24 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 16, "id": "a5d31505-e956-4efa-8fa1-78a159cccc4e", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0.24054207686854318\n", + "0.13169211512866802\n", + "0.13022177911375757\n", + "0.12951214746439604\n", + "0.12910851956982536\n", + "0.12910851956982536\n", + "0.12910851956982536\n" + ] + } + ], "source": [ "for result in results:\n", " print(result['score'])" @@ -390,7 +1368,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 17, "id": "ac803294-dd61-4969-a7fd-c6c0f90d2ca0", "metadata": {}, "outputs": [], @@ -413,10 +1391,24 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 18, "id": "1ae8ab5b-f102-4574-8adf-033db0a37b68", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Score=0.241: Buprenorphine (PUBCHEM.COMPOUND:644073)--biolink:directly_physically_interacts_with-->CYP2D6 (NCBIGene:1565)--biolink:genetic_association-->Tremor (HP:0001337)\n", + "Score=0.132: Buprenorphine (PUBCHEM.COMPOUND:644073)--biolink:related_to-->OPRM1 (NCBIGene:4988)--biolink:genetic_association-->Asterixis (HP:0012164)\n", + "Score=0.13: Buprenorphine (PUBCHEM.COMPOUND:644073)--biolink:directly_physically_interacts_with-->CYP2D6 (NCBIGene:1565)--biolink:genetic_association-->Resting tremor (HP:0002322)\n", + "Score=0.13: Buprenorphine (PUBCHEM.COMPOUND:644073)--biolink:directly_physically_interacts_with-->CYP2D6 (NCBIGene:1565)--biolink:genetic_association-->Action tremor (HP:0002345)\n", + "Score=0.129: Buprenorphine (PUBCHEM.COMPOUND:644073)--biolink:directly_physically_interacts_with-->CYP2D6 (NCBIGene:1565)--biolink:genetic_association-->Limb tremor (HP:0200085)\n", + "Score=0.129: Buprenorphine (PUBCHEM.COMPOUND:644073)--biolink:directly_physically_interacts_with-->CYP2D6 (NCBIGene:1565)--biolink:genetic_association-->Pill-rolling tremor (HP:0025387)\n", + "Score=0.129: Buprenorphine (PUBCHEM.COMPOUND:644073)--biolink:directly_physically_interacts_with-->CYP2D6 (NCBIGene:1565)--biolink:genetic_association-->Postural tremor (HP:0002174)\n" + ] + } + ], "source": [ "for rs in aragorn_result_summaries:\n", " print(rs)" @@ -432,10 +1424,54 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 19, "id": "682cd8bf", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " n00 n00_name n01 n01_name n02 \\\n", + "0 PUBCHEM.COMPOUND:644073 Buprenorphine NCBIGene:1565 CYP2D6 HP:0001337 \n", + "1 PUBCHEM.COMPOUND:644073 Buprenorphine NCBIGene:4988 OPRM1 HP:0012164 \n", + "2 PUBCHEM.COMPOUND:644073 Buprenorphine NCBIGene:1565 CYP2D6 HP:0002322 \n", + "3 PUBCHEM.COMPOUND:644073 Buprenorphine NCBIGene:1565 CYP2D6 HP:0002345 \n", + "4 PUBCHEM.COMPOUND:644073 Buprenorphine NCBIGene:1565 CYP2D6 HP:0200085 \n", + "5 PUBCHEM.COMPOUND:644073 Buprenorphine NCBIGene:1565 CYP2D6 HP:0025387 \n", + "6 PUBCHEM.COMPOUND:644073 Buprenorphine NCBIGene:1565 CYP2D6 HP:0002174 \n", + "\n", + " n02_name score \n", + "0 Tremor 0.240542 \n", + "1 Asterixis 0.131692 \n", + "2 Resting tremor 0.130222 \n", + "3 Action tremor 0.129512 \n", + "4 Limb tremor 0.129109 \n", + "5 Pill-rolling tremor 0.129109 \n", + "6 Postural tremor 0.129109 \n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "C:\\Users\\dnwilliams\\AppData\\Local\\Temp\\ipykernel_1800\\1836845606.py:16: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.\n", + " results_df = results_df.append(result_dict, ignore_index=True)\n", + "C:\\Users\\dnwilliams\\AppData\\Local\\Temp\\ipykernel_1800\\1836845606.py:16: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.\n", + " results_df = results_df.append(result_dict, ignore_index=True)\n", + "C:\\Users\\dnwilliams\\AppData\\Local\\Temp\\ipykernel_1800\\1836845606.py:16: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.\n", + " results_df = results_df.append(result_dict, ignore_index=True)\n", + "C:\\Users\\dnwilliams\\AppData\\Local\\Temp\\ipykernel_1800\\1836845606.py:16: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.\n", + " results_df = results_df.append(result_dict, ignore_index=True)\n", + "C:\\Users\\dnwilliams\\AppData\\Local\\Temp\\ipykernel_1800\\1836845606.py:16: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.\n", + " results_df = results_df.append(result_dict, ignore_index=True)\n", + "C:\\Users\\dnwilliams\\AppData\\Local\\Temp\\ipykernel_1800\\1836845606.py:16: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.\n", + " results_df = results_df.append(result_dict, ignore_index=True)\n", + "C:\\Users\\dnwilliams\\AppData\\Local\\Temp\\ipykernel_1800\\1836845606.py:16: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.\n", + " results_df = results_df.append(result_dict, ignore_index=True)\n" + ] + } + ], "source": [ "cols = []\n", "for node in sorted(results[0]['node_bindings'].keys()):\n", @@ -459,10 +1495,642 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 20, "id": "cdf34a37", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{ '0ababdb9-4147-489b-9aff-3d793ad1dbc6': { 'attributes': [ { 'attribute_type_id': 'biolink:has_count',\n", + " 'original_attribute_name': 'num_publications',\n", + " 'value': 41,\n", + " 'value_type_id': 'EDAM:data_0006'},\n", + " { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 1,\n", + " 'value_type_id': 'EDAM:data_1669'},\n", + " { 'attribute_source': 'infores:aragorn',\n", + " 'attribute_type_id': 'biolink:primary_knowledge_source',\n", + " 'value': 'infores:omnicorp',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'object': 'NCBIGene:1565',\n", + " 'predicate': 'biolink:occurs_together_in_literature_with',\n", + " 'subject': 'HP:0001337'},\n", + " '0d83d253-e4ef-4437-b5ca-b8e74874ab46': { 'attributes': [ { 'attribute_type_id': 'biolink:has_count',\n", + " 'original_attribute_name': 'num_publications',\n", + " 'value': 21,\n", + " 'value_type_id': 'EDAM:data_0006'},\n", + " { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 1,\n", + " 'value_type_id': 'EDAM:data_1669'},\n", + " { 'attribute_source': 'infores:aragorn',\n", + " 'attribute_type_id': 'biolink:primary_knowledge_source',\n", + " 'value': 'infores:omnicorp',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'object': 'PUBCHEM.COMPOUND:644073',\n", + " 'predicate': 'biolink:occurs_together_in_literature_with',\n", + " 'subject': 'NCBIGene:4988'},\n", + " '112610254': { 'attributes': [ { 'attribute_type_id': 'biolink:Attribute',\n", + " 'original_attribute_name': 'NCBITaxon',\n", + " 'value': '9606',\n", + " 'value_type_id': 'EDAM:data_0006'},\n", + " { 'attribute_source': 'infores:automat-robokop',\n", + " 'attribute_type_id': 'biolink:primary_knowledge_source',\n", + " 'original_attribute_name': 'biolink:primary_knowledge_source',\n", + " 'value': 'infores:ctd',\n", + " 'value_type_id': 'biolink:InformationResource'},\n", + " { 'attribute_source': 'infores:automat-robokop',\n", + " 'attribute_type_id': 'biolink:aggregator_knowledge_source',\n", + " 'original_attribute_name': 'biolink:aggregator_knowledge_source',\n", + " 'value': [ 'infores:automat-robokop'],\n", + " 'value_type_id': 'biolink:InformationResource'},\n", + " { 'attribute_type_id': 'biolink:publications',\n", + " 'original_attribute_name': 'publications',\n", + " 'value': ['PMID:21866885'],\n", + " 'value_type_id': 'EDAM:data_0006'},\n", + " { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 1,\n", + " 'value_type_id': 'EDAM:data_1669'},\n", + " { 'attribute_type_id': 'dct:description',\n", + " 'original_attribute_name': 'description',\n", + " 'value': 'decreases molecular '\n", + " 'interaction with',\n", + " 'value_type_id': 'EDAM:data_0006'}],\n", + " 'object': 'NCBIGene:4988',\n", + " 'predicate': 'biolink:affects',\n", + " 'qualifiers': [ { 'qualifier_type_id': 'biolink:qualified_predicate',\n", + " 'qualifier_value': 'biolink:causes'},\n", + " { 'qualifier_type_id': 'biolink:object_direction_qualifier',\n", + " 'qualifier_value': 'decreased'},\n", + " { 'qualifier_type_id': 'biolink:object_aspect_qualifier',\n", + " 'qualifier_value': 'molecular_interaction'}],\n", + " 'subject': 'PUBCHEM.COMPOUND:644073'},\n", + " '113499113': { 'attributes': [ { 'attribute_type_id': 'biolink:Attribute',\n", + " 'original_attribute_name': 'NCBITaxon',\n", + " 'value': '9606',\n", + " 'value_type_id': 'EDAM:data_0006'},\n", + " { 'attribute_source': 'infores:automat-robokop',\n", + " 'attribute_type_id': 'biolink:primary_knowledge_source',\n", + " 'original_attribute_name': 'biolink:primary_knowledge_source',\n", + " 'value': 'infores:ctd',\n", + " 'value_type_id': 'biolink:InformationResource'},\n", + " { 'attribute_source': 'infores:automat-robokop',\n", + " 'attribute_type_id': 'biolink:aggregator_knowledge_source',\n", + " 'original_attribute_name': 'biolink:aggregator_knowledge_source',\n", + " 'value': [ 'infores:automat-robokop'],\n", + " 'value_type_id': 'biolink:InformationResource'},\n", + " { 'attribute_type_id': 'biolink:publications',\n", + " 'original_attribute_name': 'publications',\n", + " 'value': ['PMID:12756210'],\n", + " 'value_type_id': 'EDAM:data_0006'},\n", + " { 'attribute_type_id': 'dct:description',\n", + " 'original_attribute_name': 'description',\n", + " 'value': 'decreases activity of',\n", + " 'value_type_id': 'EDAM:data_0006'},\n", + " { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 1,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'object': 'NCBIGene:1565',\n", + " 'predicate': 'biolink:affects',\n", + " 'qualifiers': [ { 'qualifier_type_id': 'biolink:object_aspect_qualifier',\n", + " 'qualifier_value': 'activity'},\n", + " { 'qualifier_type_id': 'biolink:qualified_predicate',\n", + " 'qualifier_value': 'biolink:causes'},\n", + " { 'qualifier_type_id': 'biolink:object_direction_qualifier',\n", + " 'qualifier_value': 'decreased'}],\n", + " 'subject': 'PUBCHEM.COMPOUND:644073'},\n", + " '120977388': { 'attributes': [ { 'attribute_source': 'infores:automat-robokop',\n", + " 'attribute_type_id': 'biolink:aggregator_knowledge_source',\n", + " 'original_attribute_name': 'biolink:aggregator_knowledge_source',\n", + " 'value': [ 'infores:pharos',\n", + " 'infores:automat-robokop'],\n", + " 'value_type_id': 'biolink:InformationResource'},\n", + " { 'attribute_source': 'infores:automat-robokop',\n", + " 'attribute_type_id': 'biolink:primary_knowledge_source',\n", + " 'original_attribute_name': 'biolink:primary_knowledge_source',\n", + " 'value': 'infores:disgenet',\n", + " 'value_type_id': 'biolink:InformationResource'},\n", + " { 'attribute_type_id': 'biolink:Attribute',\n", + " 'original_attribute_name': 'score',\n", + " 'value': 0.3,\n", + " 'value_type_id': 'EDAM:data_0006'},\n", + " { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 1,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'object': 'HP:0012164',\n", + " 'predicate': 'biolink:genetic_association',\n", + " 'subject': 'NCBIGene:4988'},\n", + " '1528772': { 'attributes': [ { 'attribute_source': 'infores:automat-robokop',\n", + " 'attribute_type_id': 'biolink:aggregator_knowledge_source',\n", + " 'original_attribute_name': 'biolink:aggregator_knowledge_source',\n", + " 'value': [ 'infores:pharos',\n", + " 'infores:automat-robokop'],\n", + " 'value_type_id': 'biolink:InformationResource'},\n", + " { 'attribute_source': 'infores:automat-robokop',\n", + " 'attribute_type_id': 'biolink:primary_knowledge_source',\n", + " 'original_attribute_name': 'biolink:primary_knowledge_source',\n", + " 'value': 'infores:disgenet',\n", + " 'value_type_id': 'biolink:InformationResource'},\n", + " { 'attribute_type_id': 'biolink:Attribute',\n", + " 'original_attribute_name': 'score',\n", + " 'value': 0.3,\n", + " 'value_type_id': 'EDAM:data_0006'},\n", + " { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 1,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'object': 'HP:0002322',\n", + " 'predicate': 'biolink:genetic_association',\n", + " 'subject': 'NCBIGene:1565'},\n", + " '16978501': { 'attributes': [ { 'attribute_type_id': 'biolink:Attribute',\n", + " 'original_attribute_name': 'primaryTarget',\n", + " 'value': True,\n", + " 'value_type_id': 'EDAM:data_0006'},\n", + " { 'attribute_source': 'infores:automat-robokop',\n", + " 'attribute_type_id': 'biolink:aggregator_knowledge_source',\n", + " 'original_attribute_name': 'biolink:aggregator_knowledge_source',\n", + " 'value': [ 'infores:automat-robokop'],\n", + " 'value_type_id': 'biolink:InformationResource'},\n", + " { 'attribute_type_id': 'biolink:Attribute',\n", + " 'original_attribute_name': 'affinity',\n", + " 'value': 8.800000190734863,\n", + " 'value_type_id': 'EDAM:data_0006'},\n", + " { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 1,\n", + " 'value_type_id': 'EDAM:data_1669'},\n", + " { 'attribute_type_id': 'biolink:publications',\n", + " 'original_attribute_name': 'publications',\n", + " 'value': ['PMID:9686407'],\n", + " 'value_type_id': 'EDAM:data_0006'},\n", + " { 'attribute_source': 'infores:automat-robokop',\n", + " 'attribute_type_id': 'biolink:primary_knowledge_source',\n", + " 'original_attribute_name': 'biolink:primary_knowledge_source',\n", + " 'value': 'infores:gtopdb',\n", + " 'value_type_id': 'biolink:InformationResource'},\n", + " { 'attribute_type_id': 'biolink:Attribute',\n", + " 'original_attribute_name': 'affinityParameter',\n", + " 'value': 'pKi',\n", + " 'value_type_id': 'EDAM:data_0006'},\n", + " { 'attribute_type_id': 'aragorn:endogenous',\n", + " 'original_attribute_name': 'endogenous',\n", + " 'value': False,\n", + " 'value_type_id': 'xsd:boolean'}],\n", + " 'object': 'NCBIGene:4988',\n", + " 'predicate': 'biolink:affects',\n", + " 'qualifiers': [ { 'qualifier_type_id': 'biolink:object_aspect_qualifier',\n", + " 'qualifier_value': 'activity'},\n", + " { 'qualifier_type_id': 'biolink:qualified_predicate',\n", + " 'qualifier_value': 'biolink:causes'},\n", + " { 'qualifier_type_id': 'biolink:object_direction_qualifier',\n", + " 'qualifier_value': 'increased'}],\n", + " 'subject': 'PUBCHEM.COMPOUND:644073'},\n", + " '4f1fedef-2a2c-4edf-bc41-7540f8f5de5a': { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 1,\n", + " 'value_type_id': 'EDAM:data_1669'},\n", + " { 'attribute_type_id': 'biolink:has_count',\n", + " 'original_attribute_name': 'num_publications',\n", + " 'value': 52,\n", + " 'value_type_id': 'EDAM:data_0006'},\n", + " { 'attribute_source': 'infores:aragorn',\n", + " 'attribute_type_id': 'biolink:primary_knowledge_source',\n", + " 'value': 'infores:omnicorp',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'object': 'PUBCHEM.COMPOUND:644073',\n", + " 'predicate': 'biolink:occurs_together_in_literature_with',\n", + " 'subject': 'HP:0001337'},\n", + " '50901981': { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 1,\n", + " 'value_type_id': 'EDAM:data_1669'},\n", + " { 'attribute_source': 'infores:automat-robokop',\n", + " 'attribute_type_id': 'biolink:primary_knowledge_source',\n", + " 'original_attribute_name': 'biolink:primary_knowledge_source',\n", + " 'value': 'infores:ctd',\n", + " 'value_type_id': 'biolink:InformationResource'},\n", + " { 'attribute_source': 'infores:automat-robokop',\n", + " 'attribute_type_id': 'biolink:aggregator_knowledge_source',\n", + " 'original_attribute_name': 'biolink:aggregator_knowledge_source',\n", + " 'value': [ 'infores:pharos',\n", + " 'infores:automat-robokop'],\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'object': 'HP:0001337',\n", + " 'predicate': 'biolink:genetic_association',\n", + " 'subject': 'NCBIGene:1565'},\n", + " '52652088': { 'attributes': [ { 'attribute_type_id': 'biolink:Attribute',\n", + " 'original_attribute_name': 'affinity',\n", + " 'value': 8.29,\n", + " 'value_type_id': 'EDAM:data_0006'},\n", + " { 'attribute_source': 'infores:automat-robokop',\n", + " 'attribute_type_id': 'biolink:aggregator_knowledge_source',\n", + " 'original_attribute_name': 'biolink:aggregator_knowledge_source',\n", + " 'value': [ 'infores:automat-robokop'],\n", + " 'value_type_id': 'biolink:InformationResource'},\n", + " { 'attribute_type_id': 'biolink:Attribute',\n", + " 'original_attribute_name': 'affinityParameter',\n", + " 'value': 'Ki',\n", + " 'value_type_id': 'EDAM:data_0006'},\n", + " { 'attribute_source': 'infores:automat-robokop',\n", + " 'attribute_type_id': 'biolink:primary_knowledge_source',\n", + " 'original_attribute_name': 'biolink:primary_knowledge_source',\n", + " 'value': 'infores:drugcentral',\n", + " 'value_type_id': 'biolink:InformationResource'},\n", + " { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 1,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'object': 'NCBIGene:4988',\n", + " 'predicate': 'biolink:affects',\n", + " 'qualifiers': [ { 'qualifier_type_id': 'biolink:object_aspect_qualifier',\n", + " 'qualifier_value': 'activity'},\n", + " { 'qualifier_type_id': 'biolink:qualified_predicate',\n", + " 'qualifier_value': 'biolink:causes'},\n", + " { 'qualifier_type_id': 'biolink:object_direction_qualifier',\n", + " 'qualifier_value': 'increased'}],\n", + " 'subject': 'PUBCHEM.COMPOUND:644073'},\n", + " '59229547': { 'attributes': [ { 'attribute_source': 'infores:automat-robokop',\n", + " 'attribute_type_id': 'biolink:aggregator_knowledge_source',\n", + " 'original_attribute_name': 'biolink:aggregator_knowledge_source',\n", + " 'value': [ 'infores:pharos',\n", + " 'infores:automat-robokop'],\n", + " 'value_type_id': 'biolink:InformationResource'},\n", + " { 'attribute_source': 'infores:automat-robokop',\n", + " 'attribute_type_id': 'biolink:primary_knowledge_source',\n", + " 'original_attribute_name': 'biolink:primary_knowledge_source',\n", + " 'value': 'infores:disgenet',\n", + " 'value_type_id': 'biolink:InformationResource'},\n", + " { 'attribute_type_id': 'biolink:Attribute',\n", + " 'original_attribute_name': 'score',\n", + " 'value': 0.3,\n", + " 'value_type_id': 'EDAM:data_0006'},\n", + " { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 1,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'object': 'HP:0025387',\n", + " 'predicate': 'biolink:genetic_association',\n", + " 'subject': 'NCBIGene:1565'},\n", + " '62620896': { 'attributes': [ { 'attribute_source': 'infores:automat-robokop',\n", + " 'attribute_type_id': 'biolink:aggregator_knowledge_source',\n", + " 'original_attribute_name': 'biolink:aggregator_knowledge_source',\n", + " 'value': [ 'infores:pharos',\n", + " 'infores:automat-robokop'],\n", + " 'value_type_id': 'biolink:InformationResource'},\n", + " { 'attribute_source': 'infores:automat-robokop',\n", + " 'attribute_type_id': 'biolink:primary_knowledge_source',\n", + " 'original_attribute_name': 'biolink:primary_knowledge_source',\n", + " 'value': 'infores:disgenet',\n", + " 'value_type_id': 'biolink:InformationResource'},\n", + " { 'attribute_type_id': 'biolink:Attribute',\n", + " 'original_attribute_name': 'score',\n", + " 'value': 0.3,\n", + " 'value_type_id': 'EDAM:data_0006'},\n", + " { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 1,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'object': 'HP:0002174',\n", + " 'predicate': 'biolink:genetic_association',\n", + " 'subject': 'NCBIGene:1565'},\n", + " '63b08844-30f6-4e62-8d51-f70b64e4e60f': { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 1,\n", + " 'value_type_id': 'EDAM:data_1669'},\n", + " { 'attribute_type_id': 'biolink:has_count',\n", + " 'original_attribute_name': 'num_publications',\n", + " 'value': 2,\n", + " 'value_type_id': 'EDAM:data_0006'},\n", + " { 'attribute_source': 'infores:aragorn',\n", + " 'attribute_type_id': 'biolink:primary_knowledge_source',\n", + " 'value': 'infores:omnicorp',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'object': 'PUBCHEM.COMPOUND:644073',\n", + " 'predicate': 'biolink:occurs_together_in_literature_with',\n", + " 'subject': 'HP:0002322'},\n", + " '69086308': { 'attributes': [ { 'attribute_type_id': 'biolink:Attribute',\n", + " 'original_attribute_name': 'affinity',\n", + " 'value': 8.29,\n", + " 'value_type_id': 'EDAM:data_0006'},\n", + " { 'attribute_source': 'infores:automat-robokop',\n", + " 'attribute_type_id': 'biolink:aggregator_knowledge_source',\n", + " 'original_attribute_name': 'biolink:aggregator_knowledge_source',\n", + " 'value': [ 'infores:automat-robokop'],\n", + " 'value_type_id': 'biolink:InformationResource'},\n", + " { 'attribute_source': 'infores:automat-robokop',\n", + " 'attribute_type_id': 'biolink:primary_knowledge_source',\n", + " 'original_attribute_name': 'biolink:primary_knowledge_source',\n", + " 'value': 'infores:pharos',\n", + " 'value_type_id': 'biolink:InformationResource'},\n", + " { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 1,\n", + " 'value_type_id': 'EDAM:data_1669'},\n", + " { 'attribute_type_id': 'biolink:Attribute',\n", + " 'original_attribute_name': 'affinity_parameter',\n", + " 'value': 'Ki',\n", + " 'value_type_id': 'EDAM:data_0006'}],\n", + " 'object': 'NCBIGene:4988',\n", + " 'predicate': 'biolink:affects',\n", + " 'qualifiers': [ { 'qualifier_type_id': 'biolink:object_aspect_qualifier',\n", + " 'qualifier_value': 'activity'},\n", + " { 'qualifier_type_id': 'biolink:qualified_predicate',\n", + " 'qualifier_value': 'biolink:causes'},\n", + " { 'qualifier_type_id': 'biolink:object_direction_qualifier',\n", + " 'qualifier_value': 'increased'}],\n", + " 'subject': 'PUBCHEM.COMPOUND:644073'},\n", + " '697aaebf-3ebe-4ee7-ad23-1187fed57565': { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 1,\n", + " 'value_type_id': 'EDAM:data_1669'},\n", + " { 'attribute_type_id': 'biolink:has_count',\n", + " 'original_attribute_name': 'num_publications',\n", + " 'value': 31,\n", + " 'value_type_id': 'EDAM:data_0006'},\n", + " { 'attribute_source': 'infores:aragorn',\n", + " 'attribute_type_id': 'biolink:primary_knowledge_source',\n", + " 'value': 'infores:omnicorp',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'object': 'PUBCHEM.COMPOUND:644073',\n", + " 'predicate': 'biolink:occurs_together_in_literature_with',\n", + " 'subject': 'NCBIGene:1565'},\n", + " '72763212': { 'attributes': [ { 'attribute_type_id': 'biolink:Attribute',\n", + " 'original_attribute_name': 'affinity_parameter',\n", + " 'value': '-',\n", + " 'value_type_id': 'EDAM:data_0006'},\n", + " { 'attribute_source': 'infores:automat-robokop',\n", + " 'attribute_type_id': 'biolink:aggregator_knowledge_source',\n", + " 'original_attribute_name': 'biolink:aggregator_knowledge_source',\n", + " 'value': [ 'infores:automat-robokop'],\n", + " 'value_type_id': 'biolink:InformationResource'},\n", + " { 'attribute_type_id': 'biolink:publications',\n", + " 'original_attribute_name': 'publications',\n", + " 'value': ['PMID:9686407'],\n", + " 'value_type_id': 'EDAM:data_0006'},\n", + " { 'attribute_source': 'infores:automat-robokop',\n", + " 'attribute_type_id': 'biolink:primary_knowledge_source',\n", + " 'original_attribute_name': 'biolink:primary_knowledge_source',\n", + " 'value': 'infores:pharos',\n", + " 'value_type_id': 'biolink:InformationResource'},\n", + " { 'attribute_type_id': 'biolink:Attribute',\n", + " 'original_attribute_name': 'affinity',\n", + " 'value': 8.80000019,\n", + " 'value_type_id': 'EDAM:data_0006'},\n", + " { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 1,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'object': 'NCBIGene:4988',\n", + " 'predicate': 'biolink:related_to',\n", + " 'subject': 'PUBCHEM.COMPOUND:644073'},\n", + " '75966132': { 'attributes': [ { 'attribute_source': 'infores:automat-robokop',\n", + " 'attribute_type_id': 'biolink:aggregator_knowledge_source',\n", + " 'original_attribute_name': 'biolink:aggregator_knowledge_source',\n", + " 'value': [ 'infores:pharos',\n", + " 'infores:automat-robokop'],\n", + " 'value_type_id': 'biolink:InformationResource'},\n", + " { 'attribute_source': 'infores:automat-robokop',\n", + " 'attribute_type_id': 'biolink:primary_knowledge_source',\n", + " 'original_attribute_name': 'biolink:primary_knowledge_source',\n", + " 'value': 'infores:disgenet',\n", + " 'value_type_id': 'biolink:InformationResource'},\n", + " { 'attribute_type_id': 'biolink:Attribute',\n", + " 'original_attribute_name': 'score',\n", + " 'value': 0.3,\n", + " 'value_type_id': 'EDAM:data_0006'},\n", + " { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 1,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'object': 'HP:0001337',\n", + " 'predicate': 'biolink:genetic_association',\n", + " 'subject': 'NCBIGene:1565'},\n", + " '76822934': { 'attributes': [ { 'attribute_source': 'infores:automat-robokop',\n", + " 'attribute_type_id': 'biolink:aggregator_knowledge_source',\n", + " 'original_attribute_name': 'biolink:aggregator_knowledge_source',\n", + " 'value': [ 'infores:pharos',\n", + " 'infores:automat-robokop'],\n", + " 'value_type_id': 'biolink:InformationResource'},\n", + " { 'attribute_source': 'infores:automat-robokop',\n", + " 'attribute_type_id': 'biolink:primary_knowledge_source',\n", + " 'original_attribute_name': 'biolink:primary_knowledge_source',\n", + " 'value': 'infores:disgenet',\n", + " 'value_type_id': 'biolink:InformationResource'},\n", + " { 'attribute_type_id': 'biolink:Attribute',\n", + " 'original_attribute_name': 'score',\n", + " 'value': 0.3,\n", + " 'value_type_id': 'EDAM:data_0006'},\n", + " { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 1,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'object': 'HP:0200085',\n", + " 'predicate': 'biolink:genetic_association',\n", + " 'subject': 'NCBIGene:1565'},\n", + " '79325668': { 'attributes': [ { 'attribute_type_id': 'biolink:Attribute',\n", + " 'original_attribute_name': 'sentences',\n", + " 'value': 'Buprenorphine '\n", + " 'exhibited potent, '\n", + " 'competitive inhibition '\n", + " 'of CYP2D6 (Ki 10 +/- 2 '\n", + " 'microM and 1.8 +/- 0.2 '\n", + " 'microM) and CYP3A4 (Ki '\n", + " '40 +/- 1.6 microM and '\n", + " '19 +/- 1.2 microM) in '\n", + " 'microsomes from human '\n", + " 'liver and '\n", + " 'cDNA-expressing '\n", + " 'lymphoblasts, '\n", + " 'respectively.|PMID:12756210',\n", + " 'value_type_id': 'EDAM:data_0006'},\n", + " { 'attribute_source': 'infores:automat-robokop',\n", + " 'attribute_type_id': 'biolink:aggregator_knowledge_source',\n", + " 'original_attribute_name': 'biolink:aggregator_knowledge_source',\n", + " 'value': [ 'infores:automat-robokop'],\n", + " 'value_type_id': 'biolink:InformationResource'},\n", + " { 'attribute_type_id': 'biolink:publications',\n", + " 'original_attribute_name': 'publications',\n", + " 'value': ['PMID:12756210'],\n", + " 'value_type_id': 'EDAM:data_0006'},\n", + " { 'attribute_type_id': 'biolink:Attribute',\n", + " 'original_attribute_name': 'biolink:tmkp_confidence_score',\n", + " 'value': '0.99969625',\n", + " 'value_type_id': 'EDAM:data_0006'},\n", + " { 'attribute_type_id': 'biolink:Attribute',\n", + " 'original_attribute_name': 'tmkp_ids',\n", + " 'value': [ 'tmkp:12699a64cae70b20411935b5e5028d220ccbe4f7a0ad13a81978026cb43111bf'],\n", + " 'value_type_id': 'EDAM:data_0006'},\n", + " { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 1,\n", + " 'value_type_id': 'EDAM:data_1669'},\n", + " { 'attribute_source': 'infores:automat-robokop',\n", + " 'attribute_type_id': 'biolink:primary_knowledge_source',\n", + " 'original_attribute_name': 'biolink:primary_knowledge_source',\n", + " 'value': 'infores:textminingkp',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'object': 'NCBIGene:1565',\n", + " 'predicate': 'biolink:regulates',\n", + " 'qualifiers': [ { 'qualifier_type_id': 'biolink:object_direction_qualifier',\n", + " 'qualifier_value': 'downregulated'}],\n", + " 'subject': 'PUBCHEM.COMPOUND:644073'},\n", + " '8608859': { 'attributes': [ { 'attribute_type_id': 'biolink:Attribute',\n", + " 'original_attribute_name': 'NCBITaxon',\n", + " 'value': '9606',\n", + " 'value_type_id': 'EDAM:data_0006'},\n", + " { 'attribute_source': 'infores:automat-robokop',\n", + " 'attribute_type_id': 'biolink:primary_knowledge_source',\n", + " 'original_attribute_name': 'biolink:primary_knowledge_source',\n", + " 'value': 'infores:ctd',\n", + " 'value_type_id': 'biolink:InformationResource'},\n", + " { 'attribute_source': 'infores:automat-robokop',\n", + " 'attribute_type_id': 'biolink:aggregator_knowledge_source',\n", + " 'original_attribute_name': 'biolink:aggregator_knowledge_source',\n", + " 'value': [ 'infores:automat-robokop'],\n", + " 'value_type_id': 'biolink:InformationResource'},\n", + " { 'attribute_type_id': 'biolink:publications',\n", + " 'original_attribute_name': 'publications',\n", + " 'value': ['PMID:12756210'],\n", + " 'value_type_id': 'EDAM:data_0006'},\n", + " { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 1,\n", + " 'value_type_id': 'EDAM:data_1669'},\n", + " { 'attribute_type_id': 'dct:description',\n", + " 'original_attribute_name': 'description',\n", + " 'value': 'increases metabolic '\n", + " 'processing of',\n", + " 'value_type_id': 'EDAM:data_0006'}],\n", + " 'object': 'PUBCHEM.COMPOUND:644073',\n", + " 'predicate': 'biolink:affects',\n", + " 'qualifiers': [ { 'qualifier_type_id': 'biolink:qualified_predicate',\n", + " 'qualifier_value': 'biolink:causes'},\n", + " { 'qualifier_type_id': 'biolink:object_aspect_qualifier',\n", + " 'qualifier_value': 'metabolic_processing'},\n", + " { 'qualifier_type_id': 'biolink:object_direction_qualifier',\n", + " 'qualifier_value': 'increased'}],\n", + " 'subject': 'NCBIGene:1565'},\n", + " '88245379': { 'attributes': [ { 'attribute_source': 'infores:automat-robokop',\n", + " 'attribute_type_id': 'biolink:primary_knowledge_source',\n", + " 'original_attribute_name': 'biolink:primary_knowledge_source',\n", + " 'value': 'infores:hetionet',\n", + " 'value_type_id': 'biolink:InformationResource'},\n", + " { 'attribute_source': 'infores:automat-robokop',\n", + " 'attribute_type_id': 'biolink:aggregator_knowledge_source',\n", + " 'original_attribute_name': 'biolink:aggregator_knowledge_source',\n", + " 'value': [ 'infores:automat-robokop'],\n", + " 'value_type_id': 'biolink:InformationResource'},\n", + " { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 1,\n", + " 'value_type_id': 'EDAM:data_1669'},\n", + " { 'attribute_type_id': 'biolink:Attribute',\n", + " 'original_attribute_name': 'hetio_source',\n", + " 'value': ['DrugBank (enzyme)'],\n", + " 'value_type_id': 'EDAM:data_0006'}],\n", + " 'object': 'NCBIGene:1565',\n", + " 'predicate': 'biolink:directly_physically_interacts_with',\n", + " 'subject': 'PUBCHEM.COMPOUND:644073'},\n", + " '93669526': { 'attributes': [ { 'attribute_source': 'infores:automat-robokop',\n", + " 'attribute_type_id': 'biolink:aggregator_knowledge_source',\n", + " 'original_attribute_name': 'biolink:aggregator_knowledge_source',\n", + " 'value': [ 'infores:pharos',\n", + " 'infores:automat-robokop'],\n", + " 'value_type_id': 'biolink:InformationResource'},\n", + " { 'attribute_source': 'infores:automat-robokop',\n", + " 'attribute_type_id': 'biolink:primary_knowledge_source',\n", + " 'original_attribute_name': 'biolink:primary_knowledge_source',\n", + " 'value': 'infores:disgenet',\n", + " 'value_type_id': 'biolink:InformationResource'},\n", + " { 'attribute_type_id': 'biolink:Attribute',\n", + " 'original_attribute_name': 'score',\n", + " 'value': 0.3,\n", + " 'value_type_id': 'EDAM:data_0006'},\n", + " { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 1,\n", + " 'value_type_id': 'EDAM:data_1669'}],\n", + " 'object': 'HP:0002345',\n", + " 'predicate': 'biolink:genetic_association',\n", + " 'subject': 'NCBIGene:1565'},\n", + " '98415152': { 'attributes': [ { 'attribute_source': 'infores:automat-robokop',\n", + " 'attribute_type_id': 'biolink:primary_knowledge_source',\n", + " 'original_attribute_name': 'biolink:primary_knowledge_source',\n", + " 'value': 'infores:hetionet',\n", + " 'value_type_id': 'biolink:InformationResource'},\n", + " { 'attribute_source': 'infores:automat-robokop',\n", + " 'attribute_type_id': 'biolink:aggregator_knowledge_source',\n", + " 'original_attribute_name': 'biolink:aggregator_knowledge_source',\n", + " 'value': [ 'infores:automat-robokop'],\n", + " 'value_type_id': 'biolink:InformationResource'},\n", + " { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 1,\n", + " 'value_type_id': 'EDAM:data_1669'},\n", + " { 'attribute_type_id': 'biolink:Attribute',\n", + " 'original_attribute_name': 'hetio_source',\n", + " 'value': [ 'ChEMBL',\n", + " 'DrugBank (target)',\n", + " 'DrugCentral '\n", + " '(ChEMBL)'],\n", + " 'value_type_id': 'EDAM:data_0006'}],\n", + " 'object': 'NCBIGene:4988',\n", + " 'predicate': 'biolink:directly_physically_interacts_with',\n", + " 'subject': 'PUBCHEM.COMPOUND:644073'},\n", + " 'af25d08c-0128-44c9-8080-eba56d04ea73': { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 1,\n", + " 'value_type_id': 'EDAM:data_1669'},\n", + " { 'attribute_type_id': 'biolink:has_count',\n", + " 'original_attribute_name': 'num_publications',\n", + " 'value': 1,\n", + " 'value_type_id': 'EDAM:data_0006'},\n", + " { 'attribute_source': 'infores:aragorn',\n", + " 'attribute_type_id': 'biolink:primary_knowledge_source',\n", + " 'value': 'infores:omnicorp',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'object': 'PUBCHEM.COMPOUND:644073',\n", + " 'predicate': 'biolink:occurs_together_in_literature_with',\n", + " 'subject': 'HP:0012164'},\n", + " 'd7fe8088-35ab-4b4d-a13e-f01a37354ad3': { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 1,\n", + " 'value_type_id': 'EDAM:data_1669'},\n", + " { 'attribute_type_id': 'biolink:has_count',\n", + " 'original_attribute_name': 'num_publications',\n", + " 'value': 3,\n", + " 'value_type_id': 'EDAM:data_0006'},\n", + " { 'attribute_source': 'infores:aragorn',\n", + " 'attribute_type_id': 'biolink:primary_knowledge_source',\n", + " 'value': 'infores:omnicorp',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'object': 'NCBIGene:1565',\n", + " 'predicate': 'biolink:occurs_together_in_literature_with',\n", + " 'subject': 'HP:0002322'},\n", + " 'e607219d-f7fa-4f7c-8ff4-e7f906a8d5c2': { 'attributes': [ { 'attribute_type_id': 'biolink:has_numeric_value',\n", + " 'original_attribute_name': 'weight',\n", + " 'value': 1,\n", + " 'value_type_id': 'EDAM:data_1669'},\n", + " { 'attribute_type_id': 'biolink:has_count',\n", + " 'original_attribute_name': 'num_publications',\n", + " 'value': 2,\n", + " 'value_type_id': 'EDAM:data_0006'},\n", + " { 'attribute_source': 'infores:aragorn',\n", + " 'attribute_type_id': 'biolink:primary_knowledge_source',\n", + " 'value': 'infores:omnicorp',\n", + " 'value_type_id': 'biolink:InformationResource'}],\n", + " 'object': 'NCBIGene:1565',\n", + " 'predicate': 'biolink:occurs_together_in_literature_with',\n", + " 'subject': 'HP:0002345'}}\n" + ] + } + ], "source": [ "pp.pprint(kg['edges'])" ] diff --git a/Documentation/HelloRobokop/HelloRobokop_Compare.ipynb b/Documentation/HelloRobokop/HelloRobokop_Compare.ipynb index c469604..805aa27 100644 --- a/Documentation/HelloRobokop/HelloRobokop_Compare.ipynb +++ b/Documentation/HelloRobokop/HelloRobokop_Compare.ipynb @@ -1,15 +1,5 @@ { "cells": [ - { - "cell_type": "markdown", - "id": "ee4a1a5d", - "metadata": {}, - "source": [ - "The purpose of this notebook is to demonstrate how to make comparisons between different sets of results. This is demonstrated by using results of a test query using TRAPI. The first section, [TRAPI query results](#TRAPI-query-results), is to get a set of data to use for comparisons and place them in the same output directory shown in the cell immediately below. Here, the pathways `Buprenorphine-OPRM1-Asterixis` and `Brixadi-OPRM1-Asterixis` are compared.\n", - "\n", - "The compare_results() function is then demonstrated by taking the results from the query and showing a Venn diagram plot showing the number of edges in common and comparison plot showing missing edges. For this notebook, if a different query is used or a different comparison is to be made, the files being read for comparison must be specified manually." - ] - }, { "cell_type": "code", "execution_count": 1, @@ -25,6 +15,15 @@ } ], "source": [ + "# Parameter inputs\n", + "# Parameters to set\n", + "URL_node_normalizer = 'https://nodenormalization-sri.renci.org/get_normalized_nodes'\n", + "trapi_submit_url = \"http://automat-u24.apps.renci.org/robokopkg/1.3/query\"\n", + "\n", + "def URL_name_resolution_search(search_string):\n", + " return(f'https://name-resolution-sri.renci.org/lookup?string={search_string}&offset=0&limit=10')\n", + "\n", + "# Initializing directory to write\n", "from datetime import datetime\n", "from pathlib import Path\n", "\n", @@ -35,6 +34,16 @@ "write_dir.mkdir(parents=True, exist_ok=True)" ] }, + { + "cell_type": "markdown", + "id": "ee4a1a5d", + "metadata": {}, + "source": [ + "The purpose of this notebook is to demonstrate how to make comparisons between different sets of results. This is demonstrated by using results of a test query using TRAPI. The first section, [TRAPI query results](#TRAPI-query-results), is to get a set of data to use for comparisons and place them in the same output directory shown in the cell immediately below. Here, the pathways `Buprenorphine-OPRM1-Asterixis` and `Brixadi-OPRM1-Asterixis` are compared.\n", + "\n", + "The compare_results() function is then demonstrated by taking the results from the query and showing a Venn diagram plot showing the number of edges in common and comparison plot showing missing edges. For this notebook, if a different query is used or a different comparison is to be made, the files being read for comparison must be specified manually." + ] + }, { "cell_type": "markdown", "id": "db32caf1", @@ -72,8 +81,7 @@ "import pprint\n", "pp = pprint.PrettyPrinter(indent=5)\n", "\n", - "search_string = 'Buprenorphine'\n", - "results = requests.post(f'https://name-resolution-sri.renci.org/lookup?string={search_string}&offset=0&limit=10')\n", + "results = requests.post(URL_name_resolution_search('Buprenorphine'))\n", "results_json = results.json()\n", "input_node_id_list = list(results_json.keys())\n", "\n", @@ -82,7 +90,7 @@ " \"conflate\": True\n", "}\n", "\n", - "results = requests.post('https://nodenormalization-sri.renci.org/get_normalized_nodes',json=nn_query)\n", + "results = requests.post(URL_node_normalizer,json=nn_query)\n", "\n", "print(input_node_id_list)" ] @@ -136,8 +144,7 @@ " }\n", " }\n", "\n", - "robokop_submit_url = \" http://automat-u24.apps.renci.org/robokopkg/1.3/query\"\n", - "response = requests.post(robokop_submit_url,json=query)\n", + "response = requests.post(trapi_submit_url,json=query)\n", "print(response.status_code)\n", "number_pathway_results = len(response.json()['message']['results'])\n", "print(len(response.json()['message']['results']))" diff --git a/Documentation/HelloRobokop/HelloRobokop_ExEmPLAR.ipynb b/Documentation/HelloRobokop/HelloRobokop_ExEmPLAR.ipynb index 030eabe..dafcb88 100644 --- a/Documentation/HelloRobokop/HelloRobokop_ExEmPLAR.ipynb +++ b/Documentation/HelloRobokop/HelloRobokop_ExEmPLAR.ipynb @@ -3,6 +3,52 @@ { "cell_type": "code", "execution_count": 1, + "id": "325bd4f1-77a6-4476-94da-09cdaf09868b", + "metadata": {}, + "outputs": [], + "source": [ + "# Parameter inputs\n", + "automat_cypher_submit_url = 'https://automat.renci.org/robokopkg/cypher'\n", + "robokopkg_bolt_url = \"bolt://robokopkg.renci.org:7687\"\n", + "user = 'neo4j'\n", + "pw = ''\n", + "\n", + "# Initializing Neo4j connection class\n", + "from neo4j import GraphDatabase\n", + "class Neo4jConnection:\n", + " \n", + " def __init__(self, uri, user, pwd):\n", + " self.__uri = uri\n", + " self.__user = user\n", + " self.__pwd = pwd\n", + " self.__driver = None\n", + " try:\n", + " self.__driver = GraphDatabase.driver(self.__uri, auth=(self.__user, self.__pwd))\n", + " except Exception as e:\n", + " print(\"Failed to create the driver:\", e)\n", + " \n", + " def close(self):\n", + " if self.__driver is not None:\n", + " self.__driver.close()\n", + " \n", + " def query(self, query, db=None):\n", + " assert self.__driver is not None, \"Driver not initialized!\"\n", + " session = None\n", + " response = None\n", + " try: \n", + " session = self.__driver.session(database=db) if db is not None else self.__driver.session()\n", + " response = list(session.run(query))\n", + " except Exception as e:\n", + " print(\"Query failed:\", e)\n", + " finally: \n", + " if session is not None:\n", + " session.close()\n", + " return response" + ] + }, + { + "cell_type": "code", + "execution_count": 2, "id": "e08945f3", "metadata": {}, "outputs": [], @@ -13,7 +59,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 3, "id": "766ccb76", "metadata": {}, "outputs": [], @@ -106,7 +152,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 4, "id": "20ecf17d-859e-48d2-a975-5673db7afdce", "metadata": {}, "outputs": [], @@ -116,55 +162,23 @@ "WHERE n0_0.name IN ['Buprenorphine'] AND n2_0.name IN ['Tremor'] \n", "RETURN [startNode(r0_0),[type(r0_0),properties(r0_0)],endNode(r0_0)] as edge_1, \n", "[startNode(r1_0),[type(r1_0),properties(r1_0)],endNode(r1_0)] as edge_2, \n", - "[n0_0.name, n1_0.name, n2_0.name] as node_names LIMIT 100\"\"\"\n", - "\n", - "from neo4j import GraphDatabase\n", - "class Neo4jConnection:\n", - " \n", - " def __init__(self, uri, user, pwd):\n", - " self.__uri = uri\n", - " self.__user = user\n", - " self.__pwd = pwd\n", - " self.__driver = None\n", - " try:\n", - " self.__driver = GraphDatabase.driver(self.__uri, auth=(self.__user, self.__pwd))\n", - " except Exception as e:\n", - " print(\"Failed to create the driver:\", e)\n", - " \n", - " def close(self):\n", - " if self.__driver is not None:\n", - " self.__driver.close()\n", - " \n", - " def query(self, query, db=None):\n", - " assert self.__driver is not None, \"Driver not initialized!\"\n", - " session = None\n", - " response = None\n", - " try: \n", - " session = self.__driver.session(database=db) if db is not None else self.__driver.session()\n", - " response = list(session.run(query))\n", - " except Exception as e:\n", - " print(\"Query failed:\", e)\n", - " finally: \n", - " if session is not None:\n", - " session.close()\n", - " return response" + "[n0_0.name, n1_0.name, n2_0.name] as node_names LIMIT 100\"\"\"" ] }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 5, "id": "11dea391-9f52-4152-9c53-2069ee072a9b", "metadata": {}, "outputs": [], "source": [ - "pw = ''\n", - "conn = Neo4jConnection(uri=\"bolt://robokopkg.renci.org:7687\", user = 'neo4j', pwd = pw)\n", + "conn = Neo4jConnection(uri=robokopkg_bolt_url, user = user, pwd = pw)\n", "record_list = conn.query(cypher)" ] }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 6, "id": "25658f6f-f3dc-451a-a72d-748f797f6abd", "metadata": {}, "outputs": [ @@ -247,7 +261,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 7, "id": "321cf3d9", "metadata": {}, "outputs": [], @@ -257,7 +271,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 8, "id": "0a93074e", "metadata": {}, "outputs": [], @@ -268,7 +282,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 9, "id": "ef8fd7bb", "metadata": {}, "outputs": [], @@ -277,13 +291,13 @@ "import json\n", "\n", "j = {'query': cypher_exemplar}\n", - "results = requests.post('https://automat.renci.org/robokopkg/cypher',json=j)\n", + "results = requests.post(automat_cypher_submit_url,json=j)\n", "results_json = results.json()" ] }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 10, "id": "00a244da", "metadata": {}, "outputs": [ @@ -354,60 +368,18 @@ }, { "cell_type": "code", - "execution_count": 4, - "id": "0f99b3e8", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "from neo4j import GraphDatabase\n", - "class Neo4jConnection:\n", - " \n", - " def __init__(self, uri, user, pwd):\n", - " self.__uri = uri\n", - " self.__user = user\n", - " self.__pwd = pwd\n", - " self.__driver = None\n", - " try:\n", - " self.__driver = GraphDatabase.driver(self.__uri, auth=(self.__user, self.__pwd))\n", - " except Exception as e:\n", - " print(\"Failed to create the driver:\", e)\n", - " \n", - " def close(self):\n", - " if self.__driver is not None:\n", - " self.__driver.close()\n", - " \n", - " def query(self, query, db=None):\n", - " assert self.__driver is not None, \"Driver not initialized!\"\n", - " session = None\n", - " response = None\n", - " try: \n", - " session = self.__driver.session(database=db) if db is not None else self.__driver.session()\n", - " response = list(session.run(query))\n", - " except Exception as e:\n", - " print(\"Query failed:\", e)\n", - " finally: \n", - " if session is not None:\n", - " session.close()\n", - " return response" - ] - }, - { - "cell_type": "code", - "execution_count": 16, + "execution_count": 14, "id": "96f112df", "metadata": {}, "outputs": [], "source": [ - "pw = ''\n", - "conn = Neo4jConnection(uri=\"bolt://robokopkg.renci.org:7687\", user = 'neo4j', pwd = pw)\n", + "conn = Neo4jConnection(uri=robokopkg_bolt_url, user = user, pwd = pw)\n", "record_list = conn.query(cypher_exemplar)" ] }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 16, "id": "88c90280", "metadata": { "tags": [] @@ -466,7 +438,7 @@ " print(f\"Result {i}:\")\n", " for label, data in record_data.items():\n", " if 'r' in label:\n", - " print(f\"{data[0]['name']} - {data[1][0]} - {data[2]['name']}\")\n", + " print(f\"{data[0]['name']} - {data[1]} - {data[2]['name']}\")\n", " print()" ] }, diff --git a/Documentation/HelloRobokop/HelloRobokop_Question_Builder.ipynb b/Documentation/HelloRobokop/HelloRobokop_Question_Builder.ipynb index 8c22552..b2e145d 100644 --- a/Documentation/HelloRobokop/HelloRobokop_Question_Builder.ipynb +++ b/Documentation/HelloRobokop/HelloRobokop_Question_Builder.ipynb @@ -2,7 +2,19 @@ "cells": [ { "cell_type": "code", - "execution_count": 3, + "execution_count": 1, + "id": "2fa8b4ef-d074-4f59-9d56-d61fe922a1ce", + "metadata": {}, + "outputs": [], + "source": [ + "# Parameter inputs\n", + "aragorn_submit_url = \"https://aragorn-u24.apps.renci.org/robokop/query\"\n", + "pathway_result_example = \"Buprenorphine_CYP2D6_Tremor\"" + ] + }, + { + "cell_type": "code", + "execution_count": 2, "id": "c2b5bd45", "metadata": {}, "outputs": [], @@ -121,7 +133,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 3, "id": "35558066", "metadata": {}, "outputs": [], @@ -161,7 +173,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 4, "id": "8aabca1a", "metadata": {}, "outputs": [ @@ -175,8 +187,7 @@ } ], "source": [ - "aragorn_submit = \"https://aragorn-u24.apps.renci.org/robokop/query\"\n", - "response = requests.post(aragorn_submit,json=query)\n", + "response = requests.post(aragorn_submit_url,json=query)\n", "print(response.status_code)\n", "number_pathway_results = len(response.json()['message']['results'])\n", "kg = response.json()['message']['knowledge_graph']\n", @@ -186,7 +197,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 5, "id": "3e18935e", "metadata": {}, "outputs": [], @@ -216,7 +227,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 6, "id": "0b5e9964", "metadata": {}, "outputs": [ @@ -239,7 +250,7 @@ ], "source": [ "for i in range(number_pathway_results):\n", - " if \"Buprenorphine_CYP2D6_Tremor\" in combined_node_list[i]:\n", + " if pathway_result_example in combined_node_list[i]:\n", " print(f\"Pathway result: {combined_node_list[i]}\")\n", " edge_bindings = results[i]['edge_bindings']\n", "\n", diff --git a/Documentation/HelloRobokop/HelloRobokop_RobokopKG.ipynb b/Documentation/HelloRobokop/HelloRobokop_RobokopKG.ipynb index 53c48ed..5c8c6da 100644 --- a/Documentation/HelloRobokop/HelloRobokop_RobokopKG.ipynb +++ b/Documentation/HelloRobokop/HelloRobokop_RobokopKG.ipynb @@ -2,7 +2,61 @@ "cells": [ { "cell_type": "code", - "execution_count": 1, + "execution_count": 12, + "id": "a58266f4-8324-4b9c-8072-f3f38def719b", + "metadata": {}, + "outputs": [], + "source": [ + "# Parameter inputs\n", + "robokopkg_bolt_url = \"bolt://robokopkg.renci.org:7687\"\n", + "user = 'neo4j'\n", + "pw = ''\n", + "\n", + "# Initializing directory to write\n", + "from datetime import datetime\n", + "from pathlib import Path\n", + "\n", + "now = datetime.now()\n", + "dt_string = now.strftime(\"%Y-%m-%d_%H%M%S\")\n", + "write_dir = Path(\"output/Cypher_robokopkg\",str(dt_string))\n", + "write_dir.mkdir(parents=True, exist_ok=True)\n", + "\n", + "# Initializing Neo4j connection class\n", + "from neo4j import GraphDatabase\n", + "class Neo4jConnection:\n", + " \n", + " def __init__(self, uri, user, pwd):\n", + " self.__uri = uri\n", + " self.__user = user\n", + " self.__pwd = pwd\n", + " self.__driver = None\n", + " try:\n", + " self.__driver = GraphDatabase.driver(self.__uri, auth=(self.__user, self.__pwd))\n", + " except Exception as e:\n", + " print(\"Failed to create the driver:\", e)\n", + " \n", + " def close(self):\n", + " if self.__driver is not None:\n", + " self.__driver.close()\n", + " \n", + " def query(self, query, db=None):\n", + " assert self.__driver is not None, \"Driver not initialized!\"\n", + " session = None\n", + " response = None\n", + " try: \n", + " session = self.__driver.session(database=db) if db is not None else self.__driver.session()\n", + " response = list(session.run(query))\n", + " except Exception as e:\n", + " print(\"Query failed:\", e)\n", + " finally: \n", + " if session is not None:\n", + " session.close()\n", + " return response" + ] + }, + { + "cell_type": "code", + "execution_count": 13, "id": "e08945f3", "metadata": {}, "outputs": [], @@ -13,7 +67,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 14, "id": "766ccb76", "metadata": {}, "outputs": [], @@ -42,7 +96,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 15, "id": "c028f2de", "metadata": {}, "outputs": [], @@ -57,71 +111,15 @@ }, { "cell_type": "code", - "execution_count": 4, - "id": "0f99b3e8", - "metadata": {}, - "outputs": [], - "source": [ - "from neo4j import GraphDatabase\n", - "class Neo4jConnection:\n", - " \n", - " def __init__(self, uri, user, pwd):\n", - " self.__uri = uri\n", - " self.__user = user\n", - " self.__pwd = pwd\n", - " self.__driver = None\n", - " try:\n", - " self.__driver = GraphDatabase.driver(self.__uri, auth=(self.__user, self.__pwd))\n", - " except Exception as e:\n", - " print(\"Failed to create the driver:\", e)\n", - " \n", - " def close(self):\n", - " if self.__driver is not None:\n", - " self.__driver.close()\n", - " \n", - " def query(self, query, db=None):\n", - " assert self.__driver is not None, \"Driver not initialized!\"\n", - " session = None\n", - " response = None\n", - " try: \n", - " session = self.__driver.session(database=db) if db is not None else self.__driver.session()\n", - " response = list(session.run(query))\n", - " except Exception as e:\n", - " print(\"Query failed:\", e)\n", - " finally: \n", - " if session is not None:\n", - " session.close()\n", - " return response" - ] - }, - { - "cell_type": "code", - "execution_count": 5, + "execution_count": 16, "id": "0cd07b8f", "metadata": {}, "outputs": [], "source": [ - "pw = ''\n", - "conn = Neo4jConnection(uri=\"bolt://robokopkg.renci.org:7687\", user = 'neo4j', pwd = pw)\n", + "conn = Neo4jConnection(uri=robokopkg_bolt_url, user = user, pwd = pw)\n", "record_list = conn.query(cypher)" ] }, - { - "cell_type": "code", - "execution_count": 6, - "id": "e9f9d1b2", - "metadata": {}, - "outputs": [], - "source": [ - "from datetime import datetime\n", - "from pathlib import Path\n", - "\n", - "now = datetime.now()\n", - "dt_string = now.strftime(\"%Y-%m-%d_%H%M%S\")\n", - "write_dir = Path(\"output/Cypher_robokopkg\",str(dt_string))\n", - "write_dir.mkdir(parents=True, exist_ok=True)" - ] - }, { "cell_type": "markdown", "id": "02dc21f4", @@ -142,7 +140,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 17, "id": "2aec8c80", "metadata": {}, "outputs": [ @@ -150,7 +148,7 @@ "name": "stdout", "output_type": "stream", "text": [ - ", ['biolink:affects', {'object_direction_qualifier': 'decreased', 'qualified_predicate': 'biolink:causes', 'biolink:primary_knowledge_source': 'infores:ctd', 'description': 'decreases activity of', 'NCBITaxon': '9606', 'object_aspect_qualifier': 'activity', 'publications': ['PMID:12756210']}], ] edge_2=[, ['biolink:genetic_association', {'score': 0.3, 'biolink:primary_knowledge_source': 'infores:disgenet', 'biolink:aggregator_knowledge_source': ['infores:pharos']}], ] node_names=['Buprenorphine', 'CYP2D6', 'Tremor']>\n" + ", ['biolink:affects', {'object_direction_qualifier': 'decreased', 'qualified_predicate': 'biolink:causes', 'biolink:primary_knowledge_source': 'infores:ctd', 'description': 'decreases activity of', 'NCBITaxon': '9606', 'object_aspect_qualifier': 'activity', 'publications': ['PMID:12756210']}], ] edge_2=[, ['biolink:genetic_association', {'score': 0.3, 'biolink:primary_knowledge_source': 'infores:disgenet', 'biolink:aggregator_knowledge_source': ['infores:pharos']}], ] node_names=['Buprenorphine', 'CYP2D6', 'Tremor']>\n" ] } ], @@ -169,7 +167,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 18, "id": "8dc4eca8", "metadata": {}, "outputs": [ @@ -338,7 +336,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 19, "id": "48a1e58c", "metadata": {}, "outputs": [ @@ -390,7 +388,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 20, "id": "abef16ae", "metadata": {}, "outputs": [], @@ -409,7 +407,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 21, "id": "9a9a8a30", "metadata": {}, "outputs": [], diff --git a/Documentation/HelloRobokop/HelloRobokop_TRAPI_multiple_IDs.ipynb b/Documentation/HelloRobokop/HelloRobokop_TRAPI_multiple_IDs.ipynb index 09e0aa7..f0c6b52 100644 --- a/Documentation/HelloRobokop/HelloRobokop_TRAPI_multiple_IDs.ipynb +++ b/Documentation/HelloRobokop/HelloRobokop_TRAPI_multiple_IDs.ipynb @@ -3,6 +3,30 @@ { "cell_type": "code", "execution_count": 1, + "id": "e8538dff-a079-4613-a8a9-159f8c760a55", + "metadata": {}, + "outputs": [], + "source": [ + "# Parameter inputs\n", + "URL_node_normalizer = 'https://nodenormalization-sri.renci.org/get_normalized_nodes'\n", + "trapi_submit_url = \"http://automat-u24.apps.renci.org/robokopkg/1.3/query\"\n", + "\n", + "def URL_name_resolution_search(search_string):\n", + " return(f'https://name-resolution-sri.renci.org/lookup?string={search_string}&offset=0&limit=10')\n", + "\n", + "# Initializing directory to write\n", + "from datetime import datetime\n", + "from pathlib import Path\n", + "\n", + "now = datetime.now()\n", + "dt_string = now.strftime(\"%Y-%m-%d_%H%M%S\")\n", + "write_dir = Path(\"output/TRAPI\",str(dt_string))\n", + "write_dir.mkdir(parents=True, exist_ok=True)" + ] + }, + { + "cell_type": "code", + "execution_count": 2, "id": "31e6e5b9", "metadata": {}, "outputs": [], @@ -25,20 +49,19 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 3, "id": "273fefff", "metadata": {}, "outputs": [], "source": [ - "search_string = 'Buprenorphine'\n", - "results = requests.post(f'https://name-resolution-sri.renci.org/lookup?string={search_string}&offset=0&limit=10')\n", + "results = requests.post(URL_name_resolution_search('Buprenorphine'))\n", "results_json = results.json()\n", "#print(json.dumps(results_json,indent=4))" ] }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "id": "5e0ecf15", "metadata": {}, "outputs": [], @@ -49,7 +72,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "id": "c0cbbd71", "metadata": {}, "outputs": [ @@ -77,7 +100,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 6, "id": "0277cecd", "metadata": {}, "outputs": [ @@ -102,7 +125,8 @@ " 'id': { 'identifier': 'PUBCHEM.COMPOUND:3033050',\n", " 'label': 'Buprenorphine '\n", " 'hydrochloride'},\n", - " 'type': [ 'biolink:ChemicalMixture',\n", + " 'type': [ 'biolink:MolecularMixture',\n", + " 'biolink:ChemicalMixture',\n", " 'biolink:ChemicalEntity',\n", " 'biolink:NamedThing',\n", " 'biolink:Entity',\n", @@ -110,8 +134,7 @@ " 'biolink:ChemicalOrDrugOrTreatment',\n", " 'biolink:ChemicalEntityOrGeneOrGeneProduct',\n", " 'biolink:ChemicalEntityOrProteinOrPolypeptide',\n", - " 'biolink:PhysicalEssenceOrOccurrent',\n", - " 'biolink:MolecularMixture']},\n", + " 'biolink:PhysicalEssenceOrOccurrent']},\n", " 'PUBCHEM.COMPOUND:644073': { 'equivalent_identifiers': [ { 'identifier': 'PUBCHEM.COMPOUND:644073',\n", " 'label': 'Buprenorphine'},\n", " { 'identifier': 'CHEMBL.COMPOUND:CHEMBL560511',\n", @@ -138,7 +161,8 @@ " 'id': { 'identifier': 'PUBCHEM.COMPOUND:644073',\n", " 'label': 'Buprenorphine'},\n", " 'information_content': 100.0,\n", - " 'type': [ 'biolink:MolecularEntity',\n", + " 'type': [ 'biolink:SmallMolecule',\n", + " 'biolink:MolecularEntity',\n", " 'biolink:ChemicalEntity',\n", " 'biolink:NamedThing',\n", " 'biolink:Entity',\n", @@ -146,15 +170,15 @@ " 'biolink:ChemicalOrDrugOrTreatment',\n", " 'biolink:ChemicalEntityOrGeneOrGeneProduct',\n", " 'biolink:ChemicalEntityOrProteinOrPolypeptide',\n", - " 'biolink:PhysicalEssenceOrOccurrent',\n", - " 'biolink:SmallMolecule']},\n", + " 'biolink:PhysicalEssenceOrOccurrent']},\n", " 'PUBCHEM.COMPOUND:91745467': { 'equivalent_identifiers': [ { 'identifier': 'PUBCHEM.COMPOUND:91745467',\n", " 'label': 'Buprenorphine '\n", " 'tms'},\n", " { 'identifier': 'INCHIKEY:LBXMBXKWTGFREB-UHFFFAOYSA-N'}],\n", " 'id': { 'identifier': 'PUBCHEM.COMPOUND:91745467',\n", " 'label': 'Buprenorphine tms'},\n", - " 'type': [ 'biolink:MolecularEntity',\n", + " 'type': [ 'biolink:SmallMolecule',\n", + " 'biolink:MolecularEntity',\n", " 'biolink:ChemicalEntity',\n", " 'biolink:NamedThing',\n", " 'biolink:Entity',\n", @@ -162,14 +186,14 @@ " 'biolink:ChemicalOrDrugOrTreatment',\n", " 'biolink:ChemicalEntityOrGeneOrGeneProduct',\n", " 'biolink:ChemicalEntityOrProteinOrPolypeptide',\n", - " 'biolink:PhysicalEssenceOrOccurrent',\n", - " 'biolink:SmallMolecule']},\n", + " 'biolink:PhysicalEssenceOrOccurrent']},\n", " 'PUBCHEM.COMPOUND:9811785': { 'equivalent_identifiers': [ { 'identifier': 'PUBCHEM.COMPOUND:9811785',\n", " 'label': 'Buprenorphine(+)'},\n", " { 'identifier': 'INCHIKEY:RMRJXGBAOAMLHD-AGMYMXDYSA-N'}],\n", " 'id': { 'identifier': 'PUBCHEM.COMPOUND:9811785',\n", " 'label': 'Buprenorphine(+)'},\n", - " 'type': [ 'biolink:MolecularEntity',\n", + " 'type': [ 'biolink:SmallMolecule',\n", + " 'biolink:MolecularEntity',\n", " 'biolink:ChemicalEntity',\n", " 'biolink:NamedThing',\n", " 'biolink:Entity',\n", @@ -177,8 +201,7 @@ " 'biolink:ChemicalOrDrugOrTreatment',\n", " 'biolink:ChemicalEntityOrGeneOrGeneProduct',\n", " 'biolink:ChemicalEntityOrProteinOrPolypeptide',\n", - " 'biolink:PhysicalEssenceOrOccurrent',\n", - " 'biolink:SmallMolecule']},\n", + " 'biolink:PhysicalEssenceOrOccurrent']},\n", " 'PUBCHEM.COMPOUND:9848990': { 'equivalent_identifiers': [ { 'identifier': 'PUBCHEM.COMPOUND:9848990',\n", " 'label': 'Brixadi'},\n", " { 'identifier': 'CHEMBL.COMPOUND:CHEMBL511142',\n", @@ -186,7 +209,8 @@ " { 'identifier': 'INCHIKEY:RMRJXGBAOAMLHD-CTAPUXPBSA-N'}],\n", " 'id': { 'identifier': 'PUBCHEM.COMPOUND:9848990',\n", " 'label': 'Brixadi'},\n", - " 'type': [ 'biolink:MolecularEntity',\n", + " 'type': [ 'biolink:SmallMolecule',\n", + " 'biolink:MolecularEntity',\n", " 'biolink:ChemicalEntity',\n", " 'biolink:NamedThing',\n", " 'biolink:Entity',\n", @@ -194,17 +218,16 @@ " 'biolink:ChemicalOrDrugOrTreatment',\n", " 'biolink:ChemicalEntityOrGeneOrGeneProduct',\n", " 'biolink:ChemicalEntityOrProteinOrPolypeptide',\n", - " 'biolink:PhysicalEssenceOrOccurrent',\n", - " 'biolink:SmallMolecule']},\n", + " 'biolink:PhysicalEssenceOrOccurrent']},\n", " 'UMLS:C0366373': { 'equivalent_identifiers': [ { 'identifier': 'UMLS:C0366373',\n", " 'label': 'Buprenorphine:Mass:Pt:Dose:Qn'}],\n", " 'id': { 'identifier': 'UMLS:C0366373',\n", " 'label': 'Buprenorphine:Mass:Pt:Dose:Qn'},\n", - " 'type': [ 'biolink:Attribute',\n", + " 'type': [ 'biolink:ClinicalAttribute',\n", + " 'biolink:Attribute',\n", " 'biolink:NamedThing',\n", " 'biolink:Entity',\n", - " 'biolink:OntologyClass',\n", - " 'biolink:ClinicalAttribute']},\n", + " 'biolink:OntologyClass']},\n", " 'UMLS:C0524040': { 'equivalent_identifiers': [ { 'identifier': 'UMLS:C0524040',\n", " 'label': 'Buprenorphine '\n", " 'measurement '\n", @@ -212,41 +235,42 @@ " 'id': { 'identifier': 'UMLS:C0524040',\n", " 'label': 'Buprenorphine measurement '\n", " '(procedure)'},\n", - " 'type': [ 'biolink:NamedThing',\n", + " 'type': [ 'biolink:Procedure',\n", + " 'biolink:NamedThing',\n", " 'biolink:Entity',\n", " 'biolink:ActivityAndBehavior',\n", " 'biolink:Occurrent',\n", - " 'biolink:PhysicalEssenceOrOccurrent',\n", - " 'biolink:Procedure']},\n", + " 'biolink:PhysicalEssenceOrOccurrent']},\n", " 'UMLS:C0701445': { 'equivalent_identifiers': [ { 'identifier': 'UMLS:C0701445',\n", " 'label': 'buprenorphine '\n", " 'hydrochloride'}],\n", " 'id': { 'identifier': 'UMLS:C0701445',\n", " 'label': 'buprenorphine hydrochloride'},\n", - " 'type': [ 'biolink:NamedThing',\n", + " 'type': [ 'biolink:ChemicalEntity',\n", + " 'biolink:NamedThing',\n", " 'biolink:Entity',\n", " 'biolink:PhysicalEssence',\n", " 'biolink:ChemicalOrDrugOrTreatment',\n", " 'biolink:ChemicalEntityOrGeneOrGeneProduct',\n", " 'biolink:ChemicalEntityOrProteinOrPolypeptide',\n", - " 'biolink:PhysicalEssenceOrOccurrent',\n", - " 'biolink:ChemicalEntity']},\n", + " 'biolink:PhysicalEssenceOrOccurrent']},\n", " 'UMLS:C0799646': { 'equivalent_identifiers': [ { 'identifier': 'UMLS:C0799646',\n", " 'label': 'Buprenorphine:ACnc:Pt:Ser/Plas:Qn'}],\n", " 'id': { 'identifier': 'UMLS:C0799646',\n", " 'label': 'Buprenorphine:ACnc:Pt:Ser/Plas:Qn'},\n", - " 'type': [ 'biolink:Attribute',\n", + " 'type': [ 'biolink:ClinicalAttribute',\n", + " 'biolink:Attribute',\n", " 'biolink:NamedThing',\n", " 'biolink:Entity',\n", - " 'biolink:OntologyClass',\n", - " 'biolink:ClinicalAttribute']},\n", + " 'biolink:OntologyClass']},\n", " 'UMLS:C1171048': { 'equivalent_identifiers': [ { 'identifier': 'UMLS:C1171048',\n", " 'label': 'buprenorphine '\n", " '2 '\n", " 'MG'}],\n", " 'id': { 'identifier': 'UMLS:C1171048',\n", " 'label': 'buprenorphine 2 MG'},\n", - " 'type': [ 'biolink:MolecularMixture',\n", + " 'type': [ 'biolink:Drug',\n", + " 'biolink:MolecularMixture',\n", " 'biolink:ChemicalMixture',\n", " 'biolink:ChemicalEntity',\n", " 'biolink:NamedThing',\n", @@ -256,8 +280,7 @@ " 'biolink:PhysicalEssence',\n", " 'biolink:ChemicalEntityOrGeneOrGeneProduct',\n", " 'biolink:ChemicalEntityOrProteinOrPolypeptide',\n", - " 'biolink:PhysicalEssenceOrOccurrent',\n", - " 'biolink:Drug']}}\n" + " 'biolink:PhysicalEssenceOrOccurrent']}}\n" ] } ], @@ -266,7 +289,7 @@ " \"curies\": input_node_id_list,\n", " \"conflate\": True\n", "}\n", - "results = requests.post('https://nodenormalization-sri.renci.org/get_normalized_nodes',json=nn_query)\n", + "results = requests.post(URL_node_normalizer,json=nn_query)\n", "pp.pprint(results.json())" ] }, @@ -280,7 +303,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 7, "id": "1efdbc6b", "metadata": {}, "outputs": [], @@ -328,7 +351,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 8, "id": "3e8f4cef", "metadata": {}, "outputs": [ @@ -342,8 +365,7 @@ } ], "source": [ - "robokop_submit_url = \"http://automat-u24.apps.renci.org/robokopkg/1.3/query\"\n", - "response = requests.post(robokop_submit_url,json=query)\n", + "response = requests.post(trapi_submit_url,json=query)\n", "print(response.status_code)\n", "number_pathway_results = len(response.json()['message']['results'])\n", "print(len(response.json()['message']['results']))" @@ -357,22 +379,6 @@ "Being a TRAPI query, the response follows the same format described in `HelloRobokop_TRAPI.ipynb`, here omitted." ] }, - { - "cell_type": "code", - "execution_count": 10, - "id": "d784fdad", - "metadata": {}, - "outputs": [], - "source": [ - "from datetime import datetime\n", - "from pathlib import Path\n", - "\n", - "now = datetime.now()\n", - "dt_string = now.strftime(\"%Y-%m-%d_%H%M%S\")\n", - "write_dir = Path(\"output/TRAPI\",str(dt_string))\n", - "write_dir.mkdir(parents=True, exist_ok=True)" - ] - }, { "cell_type": "markdown", "id": "506dac9c", @@ -385,7 +391,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 9, "id": "7005e5a6", "metadata": {}, "outputs": [ @@ -423,10 +429,10 @@ " 0\n", " PUBCHEM.COMPOUND:644073\n", " Buprenorphine\n", - " NCBIGene:1565\n", - " CYP2D6\n", - " HP:0200085\n", - " Limb tremor\n", + " NCBIGene:4988\n", + " OPRM1\n", + " HP:0012164\n", + " Asterixis\n", " \n", " \n", " 0\n", @@ -434,8 +440,8 @@ " Buprenorphine\n", " NCBIGene:1565\n", " CYP2D6\n", - " HP:0002345\n", - " Action tremor\n", + " HP:0002174\n", + " Postural tremor\n", " \n", " \n", " 0\n", @@ -452,8 +458,8 @@ " Buprenorphine\n", " NCBIGene:1565\n", " CYP2D6\n", - " HP:0025387\n", - " Pill-rolling tremor\n", + " HP:0002322\n", + " Resting tremor\n", " \n", " \n", " 0\n", @@ -470,8 +476,8 @@ " Buprenorphine\n", " NCBIGene:1565\n", " CYP2D6\n", - " HP:0002322\n", - " Resting tremor\n", + " HP:0002345\n", + " Action tremor\n", " \n", " \n", " 0\n", @@ -479,17 +485,17 @@ " Buprenorphine\n", " NCBIGene:1565\n", " CYP2D6\n", - " HP:0002174\n", - " Postural tremor\n", + " HP:0025387\n", + " Pill-rolling tremor\n", " \n", " \n", " 0\n", " PUBCHEM.COMPOUND:644073\n", " Buprenorphine\n", - " NCBIGene:4988\n", - " OPRM1\n", - " HP:0012164\n", - " Asterixis\n", + " NCBIGene:1565\n", + " CYP2D6\n", + " HP:0200085\n", + " Limb tremor\n", " \n", " \n", "\n", @@ -497,24 +503,24 @@ ], "text/plain": [ " n00 n00_name n01 n01_name \\\n", - "0 PUBCHEM.COMPOUND:644073 Buprenorphine NCBIGene:1565 CYP2D6 \n", + "0 PUBCHEM.COMPOUND:644073 Buprenorphine NCBIGene:4988 OPRM1 \n", "0 PUBCHEM.COMPOUND:644073 Buprenorphine NCBIGene:1565 CYP2D6 \n", "0 PUBCHEM.COMPOUND:9848990 Brixadi NCBIGene:4988 OPRM1 \n", "0 PUBCHEM.COMPOUND:644073 Buprenorphine NCBIGene:1565 CYP2D6 \n", "0 PUBCHEM.COMPOUND:644073 Buprenorphine NCBIGene:1565 CYP2D6 \n", "0 PUBCHEM.COMPOUND:644073 Buprenorphine NCBIGene:1565 CYP2D6 \n", "0 PUBCHEM.COMPOUND:644073 Buprenorphine NCBIGene:1565 CYP2D6 \n", - "0 PUBCHEM.COMPOUND:644073 Buprenorphine NCBIGene:4988 OPRM1 \n", + "0 PUBCHEM.COMPOUND:644073 Buprenorphine NCBIGene:1565 CYP2D6 \n", "\n", " n02 n02_name \n", - "0 HP:0200085 Limb tremor \n", - "0 HP:0002345 Action tremor \n", "0 HP:0012164 Asterixis \n", - "0 HP:0025387 Pill-rolling tremor \n", - "0 HP:0001337 Tremor \n", - "0 HP:0002322 Resting tremor \n", "0 HP:0002174 Postural tremor \n", - "0 HP:0012164 Asterixis " + "0 HP:0012164 Asterixis \n", + "0 HP:0002322 Resting tremor \n", + "0 HP:0001337 Tremor \n", + "0 HP:0002345 Action tremor \n", + "0 HP:0025387 Pill-rolling tremor \n", + "0 HP:0200085 Limb tremor " ] }, "metadata": {}, @@ -524,14 +530,14 @@ "name": "stdout", "output_type": "stream", "text": [ - "[ 'Buprenorphine_CYP2D6_Limb_tremor',\n", - " 'Buprenorphine_CYP2D6_Action_tremor',\n", + "[ 'Buprenorphine_OPRM1_Asterixis',\n", + " 'Buprenorphine_CYP2D6_Postural_tremor',\n", " 'Brixadi_OPRM1_Asterixis',\n", - " 'Buprenorphine_CYP2D6_Pill-rolling_tremor',\n", - " 'Buprenorphine_CYP2D6_Tremor',\n", " 'Buprenorphine_CYP2D6_Resting_tremor',\n", - " 'Buprenorphine_CYP2D6_Postural_tremor',\n", - " 'Buprenorphine_OPRM1_Asterixis']\n" + " 'Buprenorphine_CYP2D6_Tremor',\n", + " 'Buprenorphine_CYP2D6_Action_tremor',\n", + " 'Buprenorphine_CYP2D6_Pill-rolling_tremor',\n", + " 'Buprenorphine_CYP2D6_Limb_tremor']\n" ] } ], @@ -574,7 +580,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 10, "id": "9bbad287", "metadata": {}, "outputs": [ @@ -582,30 +588,29 @@ "name": "stdout", "output_type": "stream", "text": [ - "Pathway result: Buprenorphine_CYP2D6_Limb_tremor\n", - "{ 'Buprenorphine -> biolink:affects -> CYP2D6': 1,\n", - " 'Buprenorphine -> biolink:directly_physically_interacts_with -> CYP2D6': 1,\n", - " 'Buprenorphine -> biolink:regulates -> CYP2D6': 1,\n", - " 'CYP2D6 -> biolink:affects -> Buprenorphine': 1,\n", - " 'CYP2D6 -> biolink:genetic_association -> Limb tremor': 1}\n", + "Pathway result: Buprenorphine_OPRM1_Asterixis\n", + "{ 'Buprenorphine -> biolink:affects -> OPRM1': 4,\n", + " 'Buprenorphine -> biolink:directly_physically_interacts_with -> OPRM1': 1,\n", + " 'Buprenorphine -> biolink:related_to -> OPRM1': 1,\n", + " 'OPRM1 -> biolink:genetic_association -> Asterixis': 1}\n", "\n", - "Pathway result: Buprenorphine_CYP2D6_Action_tremor\n", + "Pathway result: Buprenorphine_CYP2D6_Postural_tremor\n", "{ 'Buprenorphine -> biolink:affects -> CYP2D6': 1,\n", " 'Buprenorphine -> biolink:directly_physically_interacts_with -> CYP2D6': 1,\n", " 'Buprenorphine -> biolink:regulates -> CYP2D6': 1,\n", " 'CYP2D6 -> biolink:affects -> Buprenorphine': 1,\n", - " 'CYP2D6 -> biolink:genetic_association -> Action tremor': 1}\n", + " 'CYP2D6 -> biolink:genetic_association -> Postural tremor': 1}\n", "\n", "Pathway result: Brixadi_OPRM1_Asterixis\n", "{ 'Brixadi -> biolink:affects -> OPRM1': 1,\n", " 'OPRM1 -> biolink:genetic_association -> Asterixis': 1}\n", "\n", - "Pathway result: Buprenorphine_CYP2D6_Pill-rolling_tremor\n", + "Pathway result: Buprenorphine_CYP2D6_Resting_tremor\n", "{ 'Buprenorphine -> biolink:affects -> CYP2D6': 1,\n", " 'Buprenorphine -> biolink:directly_physically_interacts_with -> CYP2D6': 1,\n", " 'Buprenorphine -> biolink:regulates -> CYP2D6': 1,\n", " 'CYP2D6 -> biolink:affects -> Buprenorphine': 1,\n", - " 'CYP2D6 -> biolink:genetic_association -> Pill-rolling tremor': 1}\n", + " 'CYP2D6 -> biolink:genetic_association -> Resting tremor': 1}\n", "\n", "Pathway result: Buprenorphine_CYP2D6_Tremor\n", "{ 'Buprenorphine -> biolink:affects -> CYP2D6': 1,\n", @@ -614,25 +619,26 @@ " 'CYP2D6 -> biolink:affects -> Buprenorphine': 1,\n", " 'CYP2D6 -> biolink:genetic_association -> Tremor': 2}\n", "\n", - "Pathway result: Buprenorphine_CYP2D6_Resting_tremor\n", + "Pathway result: Buprenorphine_CYP2D6_Action_tremor\n", "{ 'Buprenorphine -> biolink:affects -> CYP2D6': 1,\n", " 'Buprenorphine -> biolink:directly_physically_interacts_with -> CYP2D6': 1,\n", " 'Buprenorphine -> biolink:regulates -> CYP2D6': 1,\n", " 'CYP2D6 -> biolink:affects -> Buprenorphine': 1,\n", - " 'CYP2D6 -> biolink:genetic_association -> Resting tremor': 1}\n", + " 'CYP2D6 -> biolink:genetic_association -> Action tremor': 1}\n", "\n", - "Pathway result: Buprenorphine_CYP2D6_Postural_tremor\n", + "Pathway result: Buprenorphine_CYP2D6_Pill-rolling_tremor\n", "{ 'Buprenorphine -> biolink:affects -> CYP2D6': 1,\n", " 'Buprenorphine -> biolink:directly_physically_interacts_with -> CYP2D6': 1,\n", " 'Buprenorphine -> biolink:regulates -> CYP2D6': 1,\n", " 'CYP2D6 -> biolink:affects -> Buprenorphine': 1,\n", - " 'CYP2D6 -> biolink:genetic_association -> Postural tremor': 1}\n", + " 'CYP2D6 -> biolink:genetic_association -> Pill-rolling tremor': 1}\n", "\n", - "Pathway result: Buprenorphine_OPRM1_Asterixis\n", - "{ 'Buprenorphine -> biolink:affects -> OPRM1': 4,\n", - " 'Buprenorphine -> biolink:directly_physically_interacts_with -> OPRM1': 1,\n", - " 'Buprenorphine -> biolink:related_to -> OPRM1': 1,\n", - " 'OPRM1 -> biolink:genetic_association -> Asterixis': 1}\n", + "Pathway result: Buprenorphine_CYP2D6_Limb_tremor\n", + "{ 'Buprenorphine -> biolink:affects -> CYP2D6': 1,\n", + " 'Buprenorphine -> biolink:directly_physically_interacts_with -> CYP2D6': 1,\n", + " 'Buprenorphine -> biolink:regulates -> CYP2D6': 1,\n", + " 'CYP2D6 -> biolink:affects -> Buprenorphine': 1,\n", + " 'CYP2D6 -> biolink:genetic_association -> Limb tremor': 1}\n", "\n" ] }