From da23cd1ad8946f5fdd232a94949d3ad7394aed69 Mon Sep 17 00:00:00 2001 From: Tooba Abbassi-Daloii Date: Wed, 18 Sep 2024 12:00:56 +0200 Subject: [PATCH 1/2] Update gene_to_graph_workflow.ipynb --- examples/gene_to_graph_workflow.ipynb | 304 +++++++++++++++++--------- 1 file changed, 200 insertions(+), 104 deletions(-) diff --git a/examples/gene_to_graph_workflow.ipynb b/examples/gene_to_graph_workflow.ipynb index ee30794..cfd9306 100644 --- a/examples/gene_to_graph_workflow.ipynb +++ b/examples/gene_to_graph_workflow.ipynb @@ -1968,7 +1968,111 @@ "cell_type": "code", "execution_count": 12, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "E:\\BioDataFuse\\pyBiodatafuse\\src\\pyBiodatafuse\\annotators\\opentargets.py:1081: UserWarning: Not all values in column 'adverse_effect_count' have the correct type ''.\n", + " check_columns_against_constants(\n", + "E:\\BioDataFuse\\pyBiodatafuse\\src\\pyBiodatafuse\\annotators\\opentargets.py:1081: UserWarning: Not all values in column 'adverse_effect' have the correct type ''.\n", + " check_columns_against_constants(\n" + ] + }, + { + "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", + "
identifieridentifier.sourcetargettarget.sourceOpenTargets_disease_compounds
0UMLS_C0000786UMLSEFO_1001255EFO[{'chembl_id': 'CHEMBL1276308', 'drugbank_id':...
1UMLS_C0000889UMLSEFO_1000660EFO[{'chembl_id': 'CHEMBL1431', 'drugbank_id': 'D...
2UMLS_C0002940UMLSEFO_0004264EFO[{'chembl_id': 'CHEMBL1491', 'drugbank_id': 'D...
3UMLS_C0002940UMLSEFO_0009659EFO[{'chembl_id': 'CHEMBL526', 'drugbank_id': 'DB...
4UMLS_C0003873UMLSEFO_0000685EFO[{'chembl_id': 'CHEMBL2103743', 'drugbank_id':...
\n", + "
" + ], + "text/plain": [ + " identifier identifier.source target target.source \\\n", + "0 UMLS_C0000786 UMLS EFO_1001255 EFO \n", + "1 UMLS_C0000889 UMLS EFO_1000660 EFO \n", + "2 UMLS_C0002940 UMLS EFO_0004264 EFO \n", + "3 UMLS_C0002940 UMLS EFO_0009659 EFO \n", + "4 UMLS_C0003873 UMLS EFO_0000685 EFO \n", + "\n", + " OpenTargets_disease_compounds \n", + "0 [{'chembl_id': 'CHEMBL1276308', 'drugbank_id':... \n", + "1 [{'chembl_id': 'CHEMBL1431', 'drugbank_id': 'D... \n", + "2 [{'chembl_id': 'CHEMBL1491', 'drugbank_id': 'D... \n", + "3 [{'chembl_id': 'CHEMBL526', 'drugbank_id': 'DB... \n", + "4 [{'chembl_id': 'CHEMBL2103743', 'drugbank_id':... " + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "(\n", " opentargets_disease_compound_df,\n", @@ -2092,7 +2196,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 14, "metadata": {}, "outputs": [ { @@ -2184,7 +2288,7 @@ "4 [{'pathway_id': nan, 'pathway_label': nan, 'pa... " ] }, - "execution_count": 6, + "execution_count": 14, "metadata": {}, "output_type": "execute_result" } @@ -2198,7 +2302,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 15, "metadata": {}, "outputs": [ { @@ -2209,15 +2313,14 @@ " 'query': {'size': 6,\n", " 'input_type': 'Ensembl',\n", " 'MINERVA project': 'COVID19 Disease Map',\n", - " 'MINERVA project URL': 'https://covid19map.elixir-luxembourg.org/minerva/',\n", - " 'time': '0:00:47.612140',\n", - " 'date': '2024-09-10 15:23:35',\n", + " 'time': '0:00:50.511626',\n", + " 'date': '2024-09-18 11:50:04',\n", " 'url': 'https://covid19map.elixir-luxembourg.org/minerva/',\n", " 'number_of_added_nodes': 1,\n", " 'number_of_added_edges': 1}}" ] }, - "execution_count": 7, + "execution_count": 15, "metadata": {}, "output_type": "execute_result" } @@ -2228,7 +2331,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 16, "metadata": {}, "outputs": [ { @@ -2239,7 +2342,7 @@ " 'pathway_gene_count': 45.0}]" ] }, - "execution_count": 15, + "execution_count": 16, "metadata": {}, "output_type": "execute_result" } @@ -2257,7 +2360,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 17, "metadata": {}, "outputs": [ { @@ -2295,7 +2398,7 @@ " HGNC\n", " 196\n", " NCBI Gene\n", - " [{'pathway_id': 'WP4673', 'pathway_label': 'Ma...\n", + " [{'pathway_id': 'WP3893', 'pathway_label': 'De...\n", " \n", " \n", " 1\n", @@ -2311,7 +2414,7 @@ " HGNC\n", " 1756\n", " NCBI Gene\n", - " [{'pathway_id': 'WP5356', 'pathway_label': 'Af...\n", + " [{'pathway_id': 'WP2858', 'pathway_label': 'Ec...\n", " \n", " \n", " 3\n", @@ -2342,14 +2445,14 @@ "4 SCN4A HGNC 6329 NCBI Gene \n", "\n", " WikiPathways \n", - "0 [{'pathway_id': 'WP4673', 'pathway_label': 'Ma... \n", + "0 [{'pathway_id': 'WP3893', 'pathway_label': 'De... \n", "1 [{'pathway_id': nan, 'pathway_label': nan, 'pa... \n", - "2 [{'pathway_id': 'WP5356', 'pathway_label': 'Af... \n", + "2 [{'pathway_id': 'WP2858', 'pathway_label': 'Ec... \n", "3 [{'pathway_id': 'WP706', 'pathway_label': 'Sud... \n", "4 [{'pathway_id': nan, 'pathway_label': nan, 'pa... " ] }, - "execution_count": 16, + "execution_count": 17, "metadata": {}, "output_type": "execute_result" } @@ -2361,54 +2464,54 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 18, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "[{'pathway_id': 'WP4673',\n", - " 'pathway_label': 'Male infertility',\n", - " 'pathway_gene_count': 145.0},\n", - " {'pathway_id': 'WP5088',\n", - " 'pathway_label': 'Prostaglandin signaling',\n", - " 'pathway_gene_count': 31.0},\n", + "[{'pathway_id': 'WP3893',\n", + " 'pathway_label': 'Development and heterogeneity of the ILC family',\n", + " 'pathway_gene_count': 32.0},\n", + " {'pathway_id': 'WP5044',\n", + " 'pathway_label': 'Kynurenine pathway and links to cell senescence',\n", + " 'pathway_gene_count': 10.0},\n", " {'pathway_id': 'WP3869',\n", " 'pathway_label': 'Cannabinoid receptor signaling',\n", " 'pathway_gene_count': 31.0},\n", - " {'pathway_id': 'WP2882',\n", - " 'pathway_label': 'Nuclear receptors meta-pathway',\n", - " 'pathway_gene_count': 318.0},\n", + " {'pathway_id': 'WP4673',\n", + " 'pathway_label': 'Male infertility',\n", + " 'pathway_gene_count': 145.0},\n", + " {'pathway_id': 'WP5115',\n", + " 'pathway_label': 'Network map of SARS-CoV-2 signaling',\n", + " 'pathway_gene_count': 276.0},\n", " {'pathway_id': 'WP5130',\n", " 'pathway_label': 'Th17 cell differentiation pathway',\n", " 'pathway_gene_count': 71.0},\n", + " {'pathway_id': 'WP236',\n", + " 'pathway_label': 'Adipogenesis',\n", + " 'pathway_gene_count': 131.0},\n", + " {'pathway_id': 'WP2586',\n", + " 'pathway_label': 'Aryl hydrocarbon receptor pathway',\n", + " 'pathway_gene_count': 45.0},\n", " {'pathway_id': 'WP2873',\n", " 'pathway_label': 'Aryl hydrocarbon receptor pathway',\n", " 'pathway_gene_count': 46.0},\n", - " {'pathway_id': 'WP3893',\n", - " 'pathway_label': 'Development and heterogeneity of the ILC family',\n", - " 'pathway_gene_count': 32.0},\n", + " {'pathway_id': 'WP5088',\n", + " 'pathway_label': 'Prostaglandin signaling',\n", + " 'pathway_gene_count': 31.0},\n", " {'pathway_id': 'WP465',\n", " 'pathway_label': 'Tryptophan metabolism',\n", " 'pathway_gene_count': 32.0},\n", - " {'pathway_id': 'WP5115',\n", - " 'pathway_label': 'Network map of SARS-CoV-2 signaling',\n", - " 'pathway_gene_count': 276.0},\n", - " {'pathway_id': 'WP2586',\n", - " 'pathway_label': 'Aryl hydrocarbon receptor pathway',\n", - " 'pathway_gene_count': 45.0},\n", - " {'pathway_id': 'WP236',\n", - " 'pathway_label': 'Adipogenesis',\n", - " 'pathway_gene_count': 131.0},\n", - " {'pathway_id': 'WP5044',\n", - " 'pathway_label': 'Kynurenine pathway and links to cell senescence',\n", - " 'pathway_gene_count': 10.0},\n", + " {'pathway_id': 'WP2882',\n", + " 'pathway_label': 'Nuclear receptors meta-pathway',\n", + " 'pathway_gene_count': 318.0},\n", " {'pathway_id': 'WP3594',\n", " 'pathway_label': 'Circadian rhythm genes',\n", " 'pathway_gene_count': 209.0}]" ] }, - "execution_count": 17, + "execution_count": 18, "metadata": {}, "output_type": "execute_result" } @@ -2426,7 +2529,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 19, "metadata": {}, "outputs": [ { @@ -2518,7 +2621,7 @@ "4 [{'pathway_label': 'Phase 0 - rapid depolarisa... " ] }, - "execution_count": 18, + "execution_count": 19, "metadata": {}, "output_type": "execute_result" } @@ -2532,7 +2635,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 20, "metadata": {}, "outputs": [ { @@ -2548,7 +2651,7 @@ " 'pathway_id': 'R-HSA-8937144'}]" ] }, - "execution_count": 19, + "execution_count": 20, "metadata": {}, "output_type": "execute_result" } @@ -2566,7 +2669,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 21, "metadata": {}, "outputs": [ { @@ -2658,7 +2761,7 @@ "4 [{'go_id': 'GO:0035725', 'go_name': 'sodium io... " ] }, - "execution_count": 20, + "execution_count": 21, "metadata": {}, "output_type": "execute_result" } @@ -2672,7 +2775,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 22, "metadata": {}, "outputs": [ { @@ -2802,7 +2905,7 @@ " 'go_type': 'P'}]" ] }, - "execution_count": 21, + "execution_count": 22, "metadata": {}, "output_type": "execute_result" } @@ -2820,7 +2923,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 23, "metadata": {}, "outputs": [ { @@ -2922,7 +3025,7 @@ "4 [{'chembl_id': 'CHEMBL1077896', 'drugbank_id':... " ] }, - "execution_count": 22, + "execution_count": 23, "metadata": {}, "output_type": "execute_result" } @@ -2936,7 +3039,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 24, "metadata": {}, "outputs": [ { @@ -2953,7 +3056,7 @@ " 'adverse_effect': None}]" ] }, - "execution_count": 23, + "execution_count": 24, "metadata": {}, "output_type": "execute_result" } @@ -2971,7 +3074,7 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": 25, "metadata": {}, "outputs": [ { @@ -3063,7 +3166,7 @@ "4 [{'compound_name': nan, 'inchikey': nan, 'smil... " ] }, - "execution_count": 24, + "execution_count": 25, "metadata": {}, "output_type": "execute_result" } @@ -3075,7 +3178,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 26, "metadata": {}, "outputs": [ { @@ -3134,7 +3237,7 @@ "47 [{'compound_name': 'Lidocaine', 'inchikey': 'N... " ] }, - "execution_count": 25, + "execution_count": 26, "metadata": {}, "output_type": "execute_result" } @@ -3153,7 +3256,7 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 27, "metadata": {}, "outputs": [ { @@ -3245,7 +3348,7 @@ "4 [{'pubchem_assay_id': nan, 'assay_type': nan, ... " ] }, - "execution_count": 26, + "execution_count": 27, "metadata": {}, "output_type": "execute_result" } @@ -3259,7 +3362,7 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": 28, "metadata": {}, "outputs": [ { @@ -3274,7 +3377,7 @@ " 'inchi': nan}]" ] }, - "execution_count": 27, + "execution_count": 28, "metadata": {}, "output_type": "execute_result" } @@ -3292,7 +3395,7 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": 29, "metadata": {}, "outputs": [ { @@ -3392,7 +3495,7 @@ "4 [{'stringdb_link_to': nan, 'Ensembl': nan, 'sc... " ] }, - "execution_count": 28, + "execution_count": 29, "metadata": {}, "output_type": "execute_result" } @@ -3404,7 +3507,7 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": 30, "metadata": {}, "outputs": [ { @@ -3414,7 +3517,7 @@ " {'stringdb_link_to': 'CHRNG', 'Ensembl': 'ENSP00000498757', 'score': 0.454}]" ] }, - "execution_count": 29, + "execution_count": 30, "metadata": {}, "output_type": "execute_result" } @@ -3432,7 +3535,7 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": 31, "metadata": {}, "outputs": [ { @@ -3550,7 +3653,7 @@ " [{'anatomical_entity_id': 'UBERON_0000178', 'a...\n", " [{'disease_name': 'Muscular Dystrophy, Duchenn...\n", " [{'pathway_id': nan, 'pathway_label': nan, 'pa...\n", - " [{'pathway_id': 'WP5356', 'pathway_label': 'Af...\n", + " [{'pathway_id': 'WP2858', 'pathway_label': 'Ec...\n", " [{'pathway_label': 'Striated Muscle Contractio...\n", " [{'go_id': 'GO:0016010', 'go_name': 'dystrophi...\n", " [{'chembl_id': 'CHEMBL2108278', 'drugbank_id':...\n", @@ -3596,7 +3699,7 @@ "1 [{'pathway_id': nan, 'pathway_label': nan, 'pa... \n", "2 [{'pathway_id': nan, 'pathway_label': nan, 'pa... \n", "3 [{'pathway_id': nan, 'pathway_label': nan, 'pa... \n", - "4 [{'pathway_id': 'WP5356', 'pathway_label': 'Af... \n", + "4 [{'pathway_id': 'WP2858', 'pathway_label': 'Ec... \n", "\n", " OpenTargets_reactome \\\n", "0 [{'pathway_label': 'Highly sodium permeable po... \n", @@ -3641,7 +3744,7 @@ "4 [{'stringdb_link_to': 'SCN4A', 'Ensembl': 'ENS... " ] }, - "execution_count": 30, + "execution_count": 31, "metadata": {}, "output_type": "execute_result" } @@ -3667,7 +3770,7 @@ }, { "cell_type": "code", - "execution_count": 31, + "execution_count": 32, "metadata": {}, "outputs": [ { @@ -3676,7 +3779,7 @@ "(1622, 14)" ] }, - "execution_count": 31, + "execution_count": 32, "metadata": {}, "output_type": "execute_result" } @@ -3713,7 +3816,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 33, "metadata": {}, "outputs": [ { @@ -3831,7 +3934,7 @@ " [{'anatomical_entity_id': 'UBERON_0000178', 'a...\n", " [{'disease_name': 'Muscular Dystrophy, Duchenn...\n", " [{'pathway_id': nan, 'pathway_label': nan, 'pa...\n", - " [{'pathway_id': 'WP5356', 'pathway_label': 'Af...\n", + " [{'pathway_id': 'WP2858', 'pathway_label': 'Ec...\n", " [{'pathway_label': 'Striated Muscle Contractio...\n", " [{'go_id': 'GO:0016010', 'go_name': 'dystrophi...\n", " [{'chembl_id': 'CHEMBL2108278', 'drugbank_id':...\n", @@ -3877,7 +3980,7 @@ "1 [{'pathway_id': nan, 'pathway_label': nan, 'pa... \n", "2 [{'pathway_id': nan, 'pathway_label': nan, 'pa... \n", "3 [{'pathway_id': nan, 'pathway_label': nan, 'pa... \n", - "4 [{'pathway_id': 'WP5356', 'pathway_label': 'Af... \n", + "4 [{'pathway_id': 'WP2858', 'pathway_label': 'Ec... \n", "\n", " OpenTargets_reactome \\\n", "0 [{'pathway_label': 'Highly sodium permeable po... \n", @@ -3922,7 +4025,7 @@ "4 [{'stringdb_link_to': 'SCN4A', 'Ensembl': 'ENS... " ] }, - "execution_count": 6, + "execution_count": 33, "metadata": {}, "output_type": "execute_result" } @@ -3938,7 +4041,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 34, "metadata": {}, "outputs": [ { @@ -4030,7 +4133,7 @@ "4 [{'chembl_id': 'CHEMBL2103743', 'drugbank_id':... " ] }, - "execution_count": 7, + "execution_count": 34, "metadata": {}, "output_type": "execute_result" } @@ -4041,7 +4144,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 35, "metadata": {}, "outputs": [], "source": [ @@ -4057,7 +4160,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 36, "metadata": {}, "outputs": [], "source": [ @@ -4101,7 +4204,7 @@ "source": [ "from pyBiodatafuse.graph import cytoscape\n", "\n", - "cytoscape.load_graph(pygraph, network_name=\"PCS network\")" + "cytoscape.load_graph(pygraph, network_name=\"Test network\")" ] }, { @@ -4113,13 +4216,13 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 37, "metadata": {}, "outputs": [], "source": [ "from pyBiodatafuse.graph import neo4j\n", "\n", - "neo4j.save_graph_to_graphml(pygraph, \"pcs_networkx_graph.graphml\")" + "neo4j.save_graph_to_graphml(pygraph, \"networkx_graph_test.graphml\")" ] }, { @@ -4135,16 +4238,14 @@ "source": [ "- Add `.graphml` file in **import** subfolder of the DBMS folder\n", "- Install apoc plugin\n", - "- Add `apoc.conf` file to **conf** subfolder of the DBMS folder\n", - "\n", - " `apoc.conf` file:\n", + "- Create `apoc.conf` file:\n", " ```\n", " apoc.trigger.enabled=true\n", " apoc.import.file.enabled=true\n", " apoc.export.file.enabled=true\n", " apoc.import.file.use_neo4j_config=true\n", " ```\n", - "\n", + "- Add `apoc.conf` file to **conf** subfolder of the DBMS folder\n", "- Open Neo4j Browser\n", "- (Optionl, only run if you have imported a graph before) Remove all the nodes before importing `.graphml` file\n", "\n", @@ -4152,25 +4253,20 @@ "\n", "- Import `.graphml` file\n", "\n", - " ```call apoc.import.graphml('file:///pcs_networkx_graph.graphml',{readLabels:TRUE})```\n", + " ```call apoc.import.graphml('file:///networkx_graph_test.graphml',{readLabels:TRUE})```\n", "\n", "- Add indexes after importing the graph for improving the performance of queries\n", "\n", - " ```create index Gene for (n:Gene) on (n.node_type)```\n", - "\n", - " ```create index Pathway for (n:Pathway) on (n.node_type)```\n", - "\n", - " ```create index `Biological Process` for (n:`Biological Process`) on (n.node_type)```\n", - "\n", - " ```create index `Molecular Function` for (n:`Molecular Function`) on (n.node_type)```\n", - "\n", - " ```create index `Cellular Component` for (n:`Cellular Component`) on (n.node_type)```\n", - "\n", - " ```create index Disease for (n:Disease) on (n.node_type)```\n", - "\n", - " ```create index Compound for (n:Compound) on (n.node_type)```\n", - "\n", - " ```create index `Side Effect` for (n:`Side Effect`) on (n.node_type)```\n", + " ```\n", + " create index Gene for (n:Gene) on (n.node_type)\n", + " create index Pathway for (n:Pathway) on (n.node_type)\n", + " create index `Biological Process` for (n:`Biological Process`) on (n.node_type)\n", + " create index `Molecular Function` for (n:`Molecular Function`) on (n.node_type)\n", + " create index `Cellular Component` for (n:`Cellular Component`) on (n.node_type)\n", + " create index Disease for (n:Disease) on (n.node_type)\n", + " create index Compound for (n:Compound) on (n.node_type)\n", + " create index `Side Effect` for (n:`Side Effect`) on (n.node_type)\n", + " ```\n", " \n", "\n", "- Count the number of each node type\n", @@ -4201,7 +4297,7 @@ "\n", "- Export the graph as a `.csv` file\n", "\n", - " ```call apoc.export.csv.all(\"pcs_networkx_graph.csv\",{})```" + " ```call apoc.export.csv.all(\"networkx_graph_test.csv\",{})```" ] } ], From 11d41eff548d6a11f2cf1ef11a2e5738419edb06 Mon Sep 17 00:00:00 2001 From: Tooba Abbassi-Daloii Date: Wed, 18 Sep 2024 12:01:53 +0200 Subject: [PATCH 2/2] Update PCS_usecase.ipynb --- examples/usecases/PCS/PCS_usecase.ipynb | 35 ++++++++++--------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/examples/usecases/PCS/PCS_usecase.ipynb b/examples/usecases/PCS/PCS_usecase.ipynb index cd68ffd..f14fa42 100644 --- a/examples/usecases/PCS/PCS_usecase.ipynb +++ b/examples/usecases/PCS/PCS_usecase.ipynb @@ -2884,46 +2884,39 @@ "source": [ "- Add `.graphml` file in **import** subfolder of the DBMS folder\n", "- Install apoc plugin\n", - "- Add `apoc.conf` file to **conf** subfolder of the DBMS folder\n", - "\n", - " `apoc.conf` file:\n", + "- Create `apoc.conf` file:\n", " ```\n", " apoc.trigger.enabled=true\n", " apoc.import.file.enabled=true\n", " apoc.export.file.enabled=true\n", " apoc.import.file.use_neo4j_config=true\n", " ```\n", - "\n", + "- Add `apoc.conf` file to **conf** subfolder of the DBMS folder\n", "- Open Neo4j Browser\n", "- (Optionl, only run if you have imported a graph before) Remove all the nodes before importing `.graphml` file\n", "\n", " ```\n", - " ```MATCH (n) DETACH DELETE n\n", + " MATCH (n) DETACH DELETE n\n", " ```\n", "\n", "- Import `.graphml` file\n", "\n", " ```\n", - " ```call apoc.import.graphml('file:///pcs_networkx_graph.graphml',{readLabels:TRUE})\n", + " call apoc.import.graphml('file:///pcs_networkx_graph.graphml',{readLabels:TRUE})\n", " ```\n", "\n", "- Add indexes after importing the graph for improving the performance of queries\n", "\n", - " ```create index Gene for (n:Gene) on (n.node_type)```\n", - "\n", - " ```create index Pathway for (n:Pathway) on (n.node_type)```\n", - "\n", - " ```create index `Biological Process` for (n:`Biological Process`) on (n.node_type)```\n", - "\n", - " ```create index `Molecular Function` for (n:`Molecular Function`) on (n.node_type)```\n", - "\n", - " ```create index `Cellular Component` for (n:`Cellular Component`) on (n.node_type)```\n", - "\n", - " ```create index Disease for (n:Disease) on (n.node_type)```\n", - "\n", - " ```create index Compound for (n:Compound) on (n.node_type)```\n", - "\n", - " ```create index `Side Effect` for (n:`Side Effect`) on (n.node_type)```\n", + " ```\n", + " create index Gene for (n:Gene) on (n.node_type)\n", + " create index Pathway for (n:Pathway) on (n.node_type)\n", + " create index `Biological Process` for (n:`Biological Process`) on (n.node_type)\n", + " create index `Molecular Function` for (n:`Molecular Function`) on (n.node_type)\n", + " create index `Cellular Component` for (n:`Cellular Component`) on (n.node_type)\n", + " create index Disease for (n:Disease) on (n.node_type)\n", + " create index Compound for (n:Compound) on (n.node_type)\n", + " create index `Side Effect` for (n:`Side Effect`) on (n.node_type)\n", + " ```\n", "\n", "- Count the number of each node type\n", " - total (```MATCH (n) RETURN count(n)```) = 19859\n",