Skip to content

Commit

Permalink
Update statement df generation and HTML assembly
Browse files Browse the repository at this point in the history
  • Loading branch information
bgyori committed Jul 31, 2024
1 parent 516ae4c commit 39bf53e
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 128 deletions.
161 changes: 54 additions & 107 deletions notebooks/beta_catenin_dou/beta_catenin_dou.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@
"cells": [
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 1,
"id": "d11a7ef4",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"INFO: [2024-07-31 09:54:02] indra_cogex.client.neo4j_client - Using configured URL for INDRA neo4j connection\n",
"INFO: [2024-07-31 09:54:02] indra_cogex.client.neo4j_client - Using configured credentials for INDRA neo4j connection\n",
"INFO: [2024-07-31 09:54:05] indra_cogex.analysis.protein_analysis - Dataframe of protiens that have INDRA relationships with source that have been filtered:\n",
"INFO: [2024-07-31 12:28:26] numexpr.utils - NumExpr defaulting to 10 threads.\n",
"INFO: [2024-07-31 12:28:27] indra_cogex.client.neo4j_client - Using configured URL for INDRA neo4j connection\n",
"INFO: [2024-07-31 12:28:27] indra_cogex.client.neo4j_client - Using configured credentials for INDRA neo4j connection\n",
"INFO: [2024-07-31 12:28:30] indra_cogex.analysis.protein_analysis - Dataframe of protiens that have INDRA relationships with source that have been filtered:\n",
" name stmt_json target_type \\\n",
"3904 FABP4 {\"type\": \"Complex\", \"members\": [{\"name\": \"CTNN... HGNC \n",
"3905 FABP4 {\"type\": \"Activation\", \"subj\": {\"name\": \"CTNNB... HGNC \n",
Expand All @@ -36,44 +37,44 @@
"5547 17810 Complex \n",
"6246 15718 Complex \n",
"6370 1452 Activation \n",
"INFO: [2024-07-31 09:54:05] indra_cogex.client.neo4j_client - Using configured URL for INDRA neo4j connection\n",
"INFO: [2024-07-31 09:54:05] indra_cogex.client.neo4j_client - Using configured credentials for INDRA neo4j connection\n",
"INFO: [2024-07-31 09:54:05] indra_cogex.client.neo4j_client - Using configured URL for INDRA neo4j connection\n",
"INFO: [2024-07-31 09:54:05] indra_cogex.client.neo4j_client - Using configured credentials for INDRA neo4j connection\n",
"INFO: [2024-07-31 09:54:05] indra_cogex.client.neo4j_client - Using configured URL for INDRA neo4j connection\n",
"INFO: [2024-07-31 09:54:05] indra_cogex.client.neo4j_client - Using configured credentials for INDRA neo4j connection\n",
"INFO: [2024-07-31 09:54:06] indra_cogex.client.neo4j_client - Using configured URL for INDRA neo4j connection\n",
"INFO: [2024-07-31 09:54:06] indra_cogex.client.neo4j_client - Using configured credentials for INDRA neo4j connection\n",
"INFO: [2024-07-31 09:54:06] indra_cogex.client.neo4j_client - Using configured URL for INDRA neo4j connection\n",
"INFO: [2024-07-31 09:54:06] indra_cogex.client.neo4j_client - Using configured credentials for INDRA neo4j connection\n",
"INFO: [2024-07-31 09:54:06] indra_cogex.client.neo4j_client - Using configured URL for INDRA neo4j connection\n",
"INFO: [2024-07-31 09:54:06] indra_cogex.client.neo4j_client - Using configured credentials for INDRA neo4j connection\n",
"INFO: [2024-07-31 09:54:06] indra_cogex.client.neo4j_client - Using configured URL for INDRA neo4j connection\n",
"INFO: [2024-07-31 09:54:06] indra_cogex.client.neo4j_client - Using configured credentials for INDRA neo4j connection\n",
"INFO: [2024-07-31 09:54:07] indra_cogex.client.neo4j_client - Using configured URL for INDRA neo4j connection\n",
"INFO: [2024-07-31 09:54:07] indra_cogex.client.neo4j_client - Using configured credentials for INDRA neo4j connection\n",
"INFO: [2024-07-31 09:54:07] indra_cogex.client.neo4j_client - Using configured URL for INDRA neo4j connection\n",
"INFO: [2024-07-31 09:54:07] indra_cogex.client.neo4j_client - Using configured credentials for INDRA neo4j connection\n",
"INFO: [2024-07-31 09:54:07] indra_cogex.client.neo4j_client - Using configured URL for INDRA neo4j connection\n",
"INFO: [2024-07-31 09:54:07] indra_cogex.client.neo4j_client - Using configured credentials for INDRA neo4j connection\n",
"INFO: [2024-07-31 09:54:08] indra_cogex.client.neo4j_client - Using configured URL for INDRA neo4j connection\n",
"INFO: [2024-07-31 09:54:08] indra_cogex.client.neo4j_client - Using configured credentials for INDRA neo4j connection\n",
"INFO: [2024-07-31 09:54:08] indra_cogex.client.neo4j_client - Using configured URL for INDRA neo4j connection\n",
"INFO: [2024-07-31 09:54:08] indra_cogex.client.neo4j_client - Using configured credentials for INDRA neo4j connection\n",
"INFO: [2024-07-31 09:54:08] indra_cogex.client.neo4j_client - Using configured URL for INDRA neo4j connection\n",
"INFO: [2024-07-31 09:54:08] indra_cogex.client.neo4j_client - Using configured credentials for INDRA neo4j connection\n",
"INFO: [2024-07-31 09:54:09] indra_cogex.client.neo4j_client - Using configured URL for INDRA neo4j connection\n",
"INFO: [2024-07-31 09:54:09] indra_cogex.client.neo4j_client - Using configured credentials for INDRA neo4j connection\n",
"INFO: [2024-07-31 09:54:09] indra_cogex.client.neo4j_client - Using configured URL for INDRA neo4j connection\n",
"INFO: [2024-07-31 09:54:09] indra_cogex.client.neo4j_client - Using configured credentials for INDRA neo4j connection\n",
"INFO: [2024-07-31 09:54:09] indra_cogex.client.neo4j_client - Using configured URL for INDRA neo4j connection\n",
"INFO: [2024-07-31 09:54:09] indra_cogex.client.neo4j_client - Using configured credentials for INDRA neo4j connection\n",
"INFO: [2024-07-31 09:54:10] indra_cogex.client.neo4j_client - Using configured URL for INDRA neo4j connection\n",
"INFO: [2024-07-31 09:54:10] indra_cogex.client.neo4j_client - Using configured credentials for INDRA neo4j connection\n",
"INFO: [2024-07-31 09:54:10] indra_cogex.analysis.protein_analysis - There are no shared protein family complexes\n",
"INFO: [2024-07-31 09:54:10] indra_cogex.client.neo4j_client - Using configured URL for INDRA neo4j connection\n",
"INFO: [2024-07-31 09:54:10] indra_cogex.client.neo4j_client - Using configured credentials for INDRA neo4j connection\n",
"INFO: [2024-07-31 09:54:10] indra_cogex.analysis.protein_analysis - These are the shared upstream bioentities between thegene list and source_protein\n",
"INFO: [2024-07-31 12:28:30] indra_cogex.client.neo4j_client - Using configured URL for INDRA neo4j connection\n",
"INFO: [2024-07-31 12:28:30] indra_cogex.client.neo4j_client - Using configured credentials for INDRA neo4j connection\n",
"INFO: [2024-07-31 12:28:30] indra_cogex.client.neo4j_client - Using configured URL for INDRA neo4j connection\n",
"INFO: [2024-07-31 12:28:30] indra_cogex.client.neo4j_client - Using configured credentials for INDRA neo4j connection\n",
"INFO: [2024-07-31 12:28:30] indra_cogex.client.neo4j_client - Using configured URL for INDRA neo4j connection\n",
"INFO: [2024-07-31 12:28:30] indra_cogex.client.neo4j_client - Using configured credentials for INDRA neo4j connection\n",
"INFO: [2024-07-31 12:28:31] indra_cogex.client.neo4j_client - Using configured URL for INDRA neo4j connection\n",
"INFO: [2024-07-31 12:28:31] indra_cogex.client.neo4j_client - Using configured credentials for INDRA neo4j connection\n",
"INFO: [2024-07-31 12:28:31] indra_cogex.client.neo4j_client - Using configured URL for INDRA neo4j connection\n",
"INFO: [2024-07-31 12:28:31] indra_cogex.client.neo4j_client - Using configured credentials for INDRA neo4j connection\n",
"INFO: [2024-07-31 12:28:31] indra_cogex.client.neo4j_client - Using configured URL for INDRA neo4j connection\n",
"INFO: [2024-07-31 12:28:31] indra_cogex.client.neo4j_client - Using configured credentials for INDRA neo4j connection\n",
"INFO: [2024-07-31 12:28:31] indra_cogex.client.neo4j_client - Using configured URL for INDRA neo4j connection\n",
"INFO: [2024-07-31 12:28:31] indra_cogex.client.neo4j_client - Using configured credentials for INDRA neo4j connection\n",
"INFO: [2024-07-31 12:28:32] indra_cogex.client.neo4j_client - Using configured URL for INDRA neo4j connection\n",
"INFO: [2024-07-31 12:28:32] indra_cogex.client.neo4j_client - Using configured credentials for INDRA neo4j connection\n",
"INFO: [2024-07-31 12:28:32] indra_cogex.client.neo4j_client - Using configured URL for INDRA neo4j connection\n",
"INFO: [2024-07-31 12:28:32] indra_cogex.client.neo4j_client - Using configured credentials for INDRA neo4j connection\n",
"INFO: [2024-07-31 12:28:32] indra_cogex.client.neo4j_client - Using configured URL for INDRA neo4j connection\n",
"INFO: [2024-07-31 12:28:32] indra_cogex.client.neo4j_client - Using configured credentials for INDRA neo4j connection\n",
"INFO: [2024-07-31 12:28:32] indra_cogex.client.neo4j_client - Using configured URL for INDRA neo4j connection\n",
"INFO: [2024-07-31 12:28:33] indra_cogex.client.neo4j_client - Using configured credentials for INDRA neo4j connection\n",
"INFO: [2024-07-31 12:28:33] indra_cogex.client.neo4j_client - Using configured URL for INDRA neo4j connection\n",
"INFO: [2024-07-31 12:28:33] indra_cogex.client.neo4j_client - Using configured credentials for INDRA neo4j connection\n",
"INFO: [2024-07-31 12:28:33] indra_cogex.client.neo4j_client - Using configured URL for INDRA neo4j connection\n",
"INFO: [2024-07-31 12:28:33] indra_cogex.client.neo4j_client - Using configured credentials for INDRA neo4j connection\n",
"INFO: [2024-07-31 12:28:33] indra_cogex.client.neo4j_client - Using configured URL for INDRA neo4j connection\n",
"INFO: [2024-07-31 12:28:33] indra_cogex.client.neo4j_client - Using configured credentials for INDRA neo4j connection\n",
"INFO: [2024-07-31 12:28:34] indra_cogex.client.neo4j_client - Using configured URL for INDRA neo4j connection\n",
"INFO: [2024-07-31 12:28:34] indra_cogex.client.neo4j_client - Using configured credentials for INDRA neo4j connection\n",
"INFO: [2024-07-31 12:28:34] indra_cogex.client.neo4j_client - Using configured URL for INDRA neo4j connection\n",
"INFO: [2024-07-31 12:28:34] indra_cogex.client.neo4j_client - Using configured credentials for INDRA neo4j connection\n",
"INFO: [2024-07-31 12:28:34] indra_cogex.client.neo4j_client - Using configured URL for INDRA neo4j connection\n",
"INFO: [2024-07-31 12:28:34] indra_cogex.client.neo4j_client - Using configured credentials for INDRA neo4j connection\n",
"INFO: [2024-07-31 12:28:34] indra_cogex.analysis.protein_analysis - There are no shared protein family complexes\n",
"INFO: [2024-07-31 12:28:34] indra_cogex.client.neo4j_client - Using configured URL for INDRA neo4j connection\n",
"INFO: [2024-07-31 12:28:34] indra_cogex.client.neo4j_client - Using configured credentials for INDRA neo4j connection\n",
"INFO: [2024-07-31 12:28:35] indra_cogex.analysis.protein_analysis - These are the shared upstream bioentities between thegene list and source_protein\n",
" CURIE Name p-value q-value\n",
"0 chebi:33216 bisphenol A 1.040000e-11 5.100000e-07\n",
"1 chebi:39867 valproic acid 1.420000e-09 3.470000e-05\n",
Expand All @@ -88,72 +89,10 @@
"192 hgnc:10967 SLC22A3 1.910000e-04 4.850000e-02\n",
"\n",
"[106 rows x 4 columns]\n",
"--- Logging error ---\n",
"Traceback (most recent call last):\n",
" File \"/opt/homebrew/Cellar/python@3.10/3.10.14_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/logging/__init__.py\", line 1100, in emit\n",
" msg = self.format(record)\n",
" File \"/opt/homebrew/Cellar/python@3.10/3.10.14_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/logging/__init__.py\", line 943, in format\n",
" return fmt.format(record)\n",
" File \"/opt/homebrew/Cellar/python@3.10/3.10.14_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/logging/__init__.py\", line 678, in format\n",
" record.message = record.getMessage()\n",
" File \"/opt/homebrew/Cellar/python@3.10/3.10.14_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/logging/__init__.py\", line 368, in getMessage\n",
" msg = msg % self.args\n",
"TypeError: not all arguments converted during string formatting\n",
"Call stack:\n",
" File \"/opt/homebrew/Cellar/python@3.10/3.10.14_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py\", line 196, in _run_module_as_main\n",
" return _run_code(code, main_globals, None,\n",
" File \"/opt/homebrew/Cellar/python@3.10/3.10.14_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py\", line 86, in _run_code\n",
" exec(code, run_globals)\n",
" File \"/Users/ben/.virtualenvs/py310/lib/python3.10/site-packages/ipykernel_launcher.py\", line 17, in <module>\n",
" app.launch_new_instance()\n",
" File \"/Users/ben/.virtualenvs/py310/lib/python3.10/site-packages/traitlets/config/application.py\", line 1041, in launch_instance\n",
" app.start()\n",
" File \"/Users/ben/.virtualenvs/py310/lib/python3.10/site-packages/ipykernel/kernelapp.py\", line 736, in start\n",
" self.io_loop.start()\n",
" File \"/Users/ben/.virtualenvs/py310/lib/python3.10/site-packages/tornado/platform/asyncio.py\", line 215, in start\n",
" self.asyncio_loop.run_forever()\n",
" File \"/opt/homebrew/Cellar/python@3.10/3.10.14_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/base_events.py\", line 603, in run_forever\n",
" self._run_once()\n",
" File \"/opt/homebrew/Cellar/python@3.10/3.10.14_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/base_events.py\", line 1909, in _run_once\n",
" handle._run()\n",
" File \"/opt/homebrew/Cellar/python@3.10/3.10.14_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/events.py\", line 80, in _run\n",
" self._context.run(self._callback, *self._args)\n",
" File \"/Users/ben/.virtualenvs/py310/lib/python3.10/site-packages/ipykernel/kernelbase.py\", line 516, in dispatch_queue\n",
" await self.process_one()\n",
" File \"/Users/ben/.virtualenvs/py310/lib/python3.10/site-packages/ipykernel/kernelbase.py\", line 505, in process_one\n",
" await dispatch(*args)\n",
" File \"/Users/ben/.virtualenvs/py310/lib/python3.10/site-packages/ipykernel/kernelbase.py\", line 412, in dispatch_shell\n",
" await result\n",
" File \"/Users/ben/.virtualenvs/py310/lib/python3.10/site-packages/ipykernel/kernelbase.py\", line 740, in execute_request\n",
" reply_content = await reply_content\n",
" File \"/Users/ben/.virtualenvs/py310/lib/python3.10/site-packages/ipykernel/ipkernel.py\", line 422, in do_execute\n",
" res = shell.run_cell(\n",
" File \"/Users/ben/.virtualenvs/py310/lib/python3.10/site-packages/ipykernel/zmqshell.py\", line 546, in run_cell\n",
" return super().run_cell(*args, **kwargs)\n",
" File \"/Users/ben/.virtualenvs/py310/lib/python3.10/site-packages/IPython/core/interactiveshell.py\", line 3024, in run_cell\n",
" result = self._run_cell(\n",
" File \"/Users/ben/.virtualenvs/py310/lib/python3.10/site-packages/IPython/core/interactiveshell.py\", line 3079, in _run_cell\n",
" result = runner(coro)\n",
" File \"/Users/ben/.virtualenvs/py310/lib/python3.10/site-packages/IPython/core/async_helpers.py\", line 129, in _pseudo_sync_runner\n",
" coro.send(None)\n",
" File \"/Users/ben/.virtualenvs/py310/lib/python3.10/site-packages/IPython/core/interactiveshell.py\", line 3284, in run_cell_async\n",
" has_raised = await self.run_ast_nodes(code_ast.body, cell_name,\n",
" File \"/Users/ben/.virtualenvs/py310/lib/python3.10/site-packages/IPython/core/interactiveshell.py\", line 3466, in run_ast_nodes\n",
" if await self.run_code(code, result, async_=asy):\n",
" File \"/Users/ben/.virtualenvs/py310/lib/python3.10/site-packages/IPython/core/interactiveshell.py\", line 3526, in run_code\n",
" exec(code_obj, self.user_global_ns, self.user_ns)\n",
" File \"/var/folders/ym/hnp69kx106q1b1937qwtsm_h0000gq/T/ipykernel_66196/1911498723.py\", line 9, in <module>\n",
" explain_downstream(source_protein_name, target_protein_names, 'analysis_test')\n",
" File \"/Users/ben/Dropbox/postdoc/yfa/src/indra_cogex/src/indra_cogex/analysis/protein_analysis.py\", line 537, in explain_downstream\n",
" return run_explain_downstream_analysis(source_hgnc_id, target_hgnc_ids, output_path)\n",
" File \"/Users/ben/Dropbox/postdoc/yfa/src/indra_cogex/src/indra_cogex/analysis/protein_analysis.py\", line 503, in run_explain_downstream_analysis\n",
" shared_go_df = find_shared_go_terms(source_go_terms, go_fname)\n",
" File \"/Users/ben/Dropbox/postdoc/yfa/src/indra_cogex/src/indra_cogex/analysis/protein_analysis.py\", line 387, in find_shared_go_terms\n",
" logger.info(\"These are shared complexes between the gene list and the\",\n",
"Message: 'These are shared complexes between the gene list and the'\n",
"Arguments: ('source_protein\\n', CURIE Name p-value q-value\n",
"INFO: [2024-07-31 12:28:35] indra_cogex.analysis.protein_analysis - These are shared complexes between the gene list and the source_protein\n",
" CURIE Name p-value q-value\n",
"1 go:0005515 protein binding 3.180000e-07 0.00219\n",
"11 go:1990907 beta-catenin-TCF complex 2.250000e-05 0.02590)\n"
"11 go:1990907 beta-catenin-TCF complex 2.250000e-05 0.02590\n"
]
},
{
Expand Down Expand Up @@ -188,6 +127,14 @@
"\n",
"explain_downstream(source_protein_name, target_protein_names, 'analysis_test')"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "9c2aed0a",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
Loading

0 comments on commit 39bf53e

Please sign in to comment.