Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions appyters/KEA3_Appyter/KEA3-Appyter.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@
"from IPython.display import HTML, display, Image, FileLink, Markdown\n",
"import plotly.graph_objects as go\n",
"import kaleido\n",
"import os "
"import os \n",
"import html"
]
},
{
Expand Down Expand Up @@ -197,19 +198,19 @@
" k_libs_palette = {'BioGRID': 'rgb(196, 8, 8)', 'ChengKSIN': 'rgb(244, 109, 67)', 'ChengPPI': 'rgb(242, 172, 68)',\n",
" 'HIPPIE': 'rgb(236, 252, 68)', 'mentha': 'rgb(165, 242, 162)', 'MINT': 'rgb(92, 217, 78)',\n",
" 'PhosDAll': 'rgb(0, 138, 64)', 'prePPI': 'rgb(96, 191, 235)', 'PTMsigDB': 'rgb(14, 130, 201)',\n",
" 'STRING': 'rgb(58, 50, 168)', 'STRING.bind': 'rgb(158, 50, 168)'}\n",
" 'STRING': 'rgb(58, 50, 168)', 'STRING.bind': 'rgb(158, 50, 168)', 'The_Kinase_Library': 'rgb(235, 0, 235)'}\n",
" \n",
" k_libs_means = {'STRING.bind': [0] * 10, 'ChengPPI': [0] * 10, 'PhosDAll': [0] * 10, 'BioGRID': [0] * 10,\n",
" 'HIPPIE': [0] * 10, 'ChengKSIN': [0] * 10,\n",
" 'STRING': [0] * 10, 'MINT': [0] * 10, 'mentha': [0] * 10, 'prePPI': [0] * 10,\n",
" 'PTMsigDB': [0] * 10}\n",
" 'PTMsigDB': [0] * 10, 'The_Kinase_Library': [0] * 10}\n",
"\n",
" libs_sorted = ['BioGRID', 'ChengKSIN', 'ChengPPI', 'HIPPIE', 'mentha', 'MINT', 'PhosDAll', 'prePPI', 'PTMsigDB', 'STRING', 'STRING.bind', 'The_Kinase_Library']\n",
"\n",
" libs_sorted = ['BioGRID', 'ChengKSIN', 'ChengPPI', 'HIPPIE', 'mentha', 'MINT', 'PhosDAll', 'prePPI', 'PTMsigDB', 'STRING', 'STRING.bind']\n",
" \n",
" results_mr_t = [r for r in results['Integrated--meanRank'] if len(r['Library'].split(';')) >= threshold][:num_kinases]\n",
" # results_mr_t.sort(key=lambda kin: sum([int(k.split(',')[1]) for k in kin['Library'].split(';')]))\n",
" results_mr_t = results_mr_t[::-1]\n",
" sorted_kinases = [k['TF'] for k in results_mr_t[:num_kinases]]\n",
" sorted_kinases = [k['TF'] for k in results_mr_t[:num_kinases]] \n",
"\n",
" for i, kin in enumerate(results_mr_t[:num_kinases]):\n",
" scores = kin['Library'].split(';')\n",
Expand Down Expand Up @@ -237,12 +238,17 @@
" )\n",
" )\n",
"\n",
" html_str = fig.to_html(include_plotlyjs='cdn')\n",
" escaped_html = html.escape(html_str)\n",
" iframe = f\"\"\"\n",
" <iframe srcdoc=\"{escaped_html}\" width=\"100%\" height=\"400\" frameborder=\"0\" scrolling=\"no\" style=\"overflow:hidden\"></iframe>\n",
" \"\"\"\n",
" display(HTML(iframe))\n",
" display(HTML(\n",
" '<h2>This interactive bar chart summarizes the ranks of the top kinases from the different libraries.</h2>'))\n",
" display(HTML(\n",
" f'<i>Kinases are sorted by MeanRank. Only kinases with at least {threshold} contributed libraries are shown. ' +\n",
" 'To download the file as a PNG, click the camera button in the upper right corner of the chart.</i>'))\n",
" fig.show()"
" 'To download the file as a PNG, click the camera button in the upper right corner of the chart.</i>'))"
]
},
{
Expand Down Expand Up @@ -271,7 +277,7 @@
"\n",
" display(HTML('<h2>The following tables display the rankings of the top kinases from each library.</h2>'))\n",
"\n",
" display_tables(['ChengKSIN', 'PTMsigDB', 'PhosDAll'], 'Kinase-substrate interaction')\n",
" display_tables(['ChengKSIN', 'PTMsigDB', 'PhosDAll', 'The_Kinase_Library'], 'Kinase-substrate interaction')\n",
" display_tables(['prePPI', 'BioGRID', 'mentha', 'MINT','HIPPIE', 'STRING.bind', 'ChengPPI'], 'Protein-protein interaction')\n",
" display_tables(['STRING'], 'All associations')"
]
Expand Down
Loading