From 3ab7193ea684542ddea356ea27d000173186fe4d Mon Sep 17 00:00:00 2001 From: vicpaton Date: Thu, 21 Nov 2024 19:34:27 +0100 Subject: [PATCH] added initial vignette w pertpy --- docs/src/vignettes/B_pertpy.ipynb | 1362 +++++++++++++++++++++++++++++ 1 file changed, 1362 insertions(+) create mode 100644 docs/src/vignettes/B_pertpy.ipynb diff --git a/docs/src/vignettes/B_pertpy.ipynb b/docs/src/vignettes/B_pertpy.ipynb new file mode 100644 index 0000000..0ce87a4 --- /dev/null +++ b/docs/src/vignettes/B_pertpy.ipynb @@ -0,0 +1,1362 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Vignette B: Pertpy bridging to NetworkCommons" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In this vignette, we showcase how the resources from pertpy can be used with NetworkCommons. Here, we will use part of the vignette [Use-case: Deconvoluting drug responses in cancer cell lines](https://pertpy.readthedocs.io/en/latest/tutorials/notebooks/mcfarland_use_case.html), available in the [pertpy documentation](https://pertpy.readthedocs.org). This dataset contains single-cell RNA-seq perturbational profiles from 172 cancer cell lines treated with 13 drugs. Due to computational power constrains, we will only showcase this with one cell line and one dataset. However, this can be expanded " + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "import pertpy as pt\n", + "import scanpy as sc\n", + "import numpy as np\n", + "import pandas as pd" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "import networkcommons as nc" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 1. Processing with pertpy" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This section was taken from the pertpy documentation, [Use-case: Deconvoluting drug responses in cancer cell lines](https://pertpy.readthedocs.io/en/latest/tutorials/notebooks/mcfarland_use_case.html). Please refer to this for further details." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "adata = pt.dt.mcfarland_2020()\n", + "adata" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [], + "source": [ + "adata.write_h5ad(\n", + " \"adata.h5ad\"\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "adata = sc.read_h5ad(\"adata.h5ad\")" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['Navitoclax',\n", + " 'BRD3379',\n", + " 'AZD5591',\n", + " 'Taselisib',\n", + " 'Everolimus',\n", + " 'Idasanutlin',\n", + " 'Bortezomib',\n", + " 'sgLACZ',\n", + " 'sgGPX4-1',\n", + " 'control',\n", + " 'Trametinib',\n", + " 'sgOR2J2',\n", + " 'Afatinib',\n", + " 'Dabrafenib',\n", + " 'sgGPX4-2',\n", + " 'Gemcitabine',\n", + " 'JQ1',\n", + " 'Prexasertib']" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "adata.obs[\"perturbation\"].unique().tolist()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "sc.pp.filter_genes(adata, min_cells=30)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "adata.layers[\"raw_counts\"] = adata.X.copy()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Metadata annotation\n", + "cl_metadata = pt.md.CellLine()\n", + "cl_metadata.annotate(\n", + " adata,\n", + " query_id=\"DepMap_ID\",\n", + " reference_id=\"ModelID\",\n", + " fetch=[\"CellLineName\", \"Age\", \"OncotreePrimaryDisease\", \"SangerModelID\", \"OncotreeLineage\"],\n", + ")\n", + "\n", + "moa_metadata = pt.md.Moa()\n", + "moa_metadata.annotate(\n", + " adata,\n", + " query_id=\"perturbation\",\n", + ")\n", + "\n", + "# Add control annotations\n", + "adata.obs[\"moa\"] = [\"Control\" if pert == \"control\" else moa for moa, pert in zip(adata.obs[\"moa\"], adata.obs[\"perturbation\"])]\n", + "adata.obs[\"target\"] = [\"Control\" if pert == \"control\" else target for target, pert in zip(adata.obs[\"target\"], adata.obs[\"perturbation\"])]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "sc.pl.umap(adata, color=[\"moa\"])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "cl_metadata.annotate_from_gdsc(\n", + " adata,\n", + " query_id=\"SangerModelID\",\n", + " reference_id=\"sanger_model_id\",\n", + " query_perturbation='perturbation',\n", + " gdsc_dataset=\"gdsc_1\",\n", + ")\n", + "adata.obs[\"ln_ic50_GDSC1\"] = adata.obs[\"ln_ic50\"].copy()\n", + "\n", + "cl_metadata.annotate_from_gdsc(\n", + " adata,\n", + " query_id=\"SangerModelID\",\n", + " reference_id=\"sanger_model_id\",\n", + " query_perturbation='perturbation',\n", + " gdsc_dataset=\"gdsc_2\",\n", + ")\n", + "adata.obs[\"ln_ic50_GDSC2\"] = adata.obs[\"ln_ic50\"].copy()\n", + "\n", + "del adata.obs[\"ln_ic50\"]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "adata_dabrafenib = adata[adata.obs[\"perturbation\"].isin([\"control\", \"Dabrafenib\"])]" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "adata_dabrafenib = sc.read_h5ad(\"adata_dabrafenib.h5ad\")" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [], + "source": [ + "subset_cells = np.random.choice(adata_dabrafenib.obs[\"SangerModelID\"].unique().tolist(), size=10, replace=False)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array(['SIDM00759', 'SIDM00582', 'SIDM00963', 'SIDM01150', 'SIDM00143',\n", + " 'SIDM00756', 'SIDM01060', 'SIDM00139', 'SIDM01167', 'SIDM01026'],\n", + " dtype='\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", + " \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", + "
RP11-34P13.7AL627309.1AP006222.2RP4-669L17.10RP11-206L10.3RP11-206L10.2RP11-206L10.9FAM87BLINC00115FAM41C...MT-ND6MT-CYBAC145212.1MGC39584AC011043.1AL592183.1AC011841.1AL354822.1PNRC2-1SRSF10-1
SIDM01150-0.029041-0.1546880.0075700.1358630.0804120.3478780.3467630.000000-0.148709-0.343955...0.366750-0.1003240.0111690.132036-0.0253710.1456050.0131510.025349-0.126633-0.186471
SIDM001430.0000000.2949660.046804-0.2188130.4971960.000000-0.2188510.0000000.439098-0.302195...0.4006220.121451-0.2912700.0000000.4837290.0861450.3286630.168367-0.0065780.451708
SIDM010600.0432880.000000-0.1625890.0659010.027507-0.0332830.0005900.000000-0.502486-0.351066...0.2247240.005616-0.0172900.000000-0.198974-0.3999490.0000000.1316910.000000-0.250337
SIDM011670.0000000.1581820.4841590.0477780.0477580.000000-0.186445-0.1025640.5463400.195960...0.0896150.0638650.0630880.000000-0.3268810.0009770.0000000.1146010.000000-0.475517
\n", + "

4 rows × 21805 columns

\n", + "" + ], + "text/plain": [ + " RP11-34P13.7 AL627309.1 AP006222.2 RP4-669L17.10 RP11-206L10.3 \\\n", + "SIDM01150 -0.029041 -0.154688 0.007570 0.135863 0.080412 \n", + "SIDM00143 0.000000 0.294966 0.046804 -0.218813 0.497196 \n", + "SIDM01060 0.043288 0.000000 -0.162589 0.065901 0.027507 \n", + "SIDM01167 0.000000 0.158182 0.484159 0.047778 0.047758 \n", + "\n", + " RP11-206L10.2 RP11-206L10.9 FAM87B LINC00115 FAM41C ... \\\n", + "SIDM01150 0.347878 0.346763 0.000000 -0.148709 -0.343955 ... \n", + "SIDM00143 0.000000 -0.218851 0.000000 0.439098 -0.302195 ... \n", + "SIDM01060 -0.033283 0.000590 0.000000 -0.502486 -0.351066 ... \n", + "SIDM01167 0.000000 -0.186445 -0.102564 0.546340 0.195960 ... \n", + "\n", + " MT-ND6 MT-CYB AC145212.1 MGC39584 AC011043.1 AL592183.1 \\\n", + "SIDM01150 0.366750 -0.100324 0.011169 0.132036 -0.025371 0.145605 \n", + "SIDM00143 0.400622 0.121451 -0.291270 0.000000 0.483729 0.086145 \n", + "SIDM01060 0.224724 0.005616 -0.017290 0.000000 -0.198974 -0.399949 \n", + "SIDM01167 0.089615 0.063865 0.063088 0.000000 -0.326881 0.000977 \n", + "\n", + " AC011841.1 AL354822.1 PNRC2-1 SRSF10-1 \n", + "SIDM01150 0.013151 0.025349 -0.126633 -0.186471 \n", + "SIDM00143 0.328663 0.168367 -0.006578 0.451708 \n", + "SIDM01060 0.000000 0.131691 0.000000 -0.250337 \n", + "SIDM01167 0.000000 0.114601 0.000000 -0.475517 \n", + "\n", + "[4 rows x 21805 columns]" + ] + }, + "execution_count": 70, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "logfc_df.head()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 2. TF activity estimation with decoupler-py" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now that we have the gene changes in response to the perturbation, we can perform TF activity estimation with decoupler and CollecTRI. This scores will be the input for the network contextualization methods from NetworkCommons. " + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": {}, + "outputs": [], + "source": [ + "import decoupler as dc" + ] + }, + { + "cell_type": "code", + "execution_count": 42, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "INFO:root:Downloading data from `https://omnipathdb.org/queries/enzsub?format=json`\n", + "INFO:root:Downloading data from `https://omnipathdb.org/queries/interactions?format=json`\n", + "INFO:root:Downloading data from `https://omnipathdb.org/queries/complexes?format=json`\n", + "INFO:root:Downloading data from `https://omnipathdb.org/queries/annotations?format=json`\n", + "INFO:root:Downloading data from `https://omnipathdb.org/queries/intercell?format=json`\n", + "INFO:root:Downloading data from `https://omnipathdb.org/about?format=text`\n" + ] + } + ], + "source": [ + "net = dc.get_collectri()" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": {}, + "outputs": [], + "source": [ + "tf_acts, pvals = dc.run_ulm(logfc_df, net)" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": {}, + "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", + " \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", + "
ABL1AEBP1AHRAHRRAIPAIREAP1APEX1ARARID1A...ZNF382ZNF384ZNF395ZNF410ZNF436ZNF699ZNF76ZNF804AZNF91ZXDC
SIDM011500.080080-1.6311651.822143-0.486594-0.783931-0.8443521.723601-1.519310-0.3443631.623128...-4.2380111.965072-2.0040190.0691872.652415-0.182054-1.793975-0.1435991.938493-0.277062
SIDM00143-1.3322591.5921151.1834830.7997851.0258600.4684134.497127-1.4301492.6006412.156102...-0.7894683.996778-1.028295-0.5172140.5982311.0871190.778563-0.5999001.412452-2.276532
SIDM01060-0.652209-2.475549-1.5809861.089401-1.9441080.399068-5.066813-2.765601-0.934723-0.981179...1.715413-0.1582271.4809320.409427-0.044302-0.413981-0.048804-2.6923911.406787-0.253700
SIDM01167-1.3349100.017429-2.3678930.8137632.198922-0.660442-2.465387-1.764444-2.9834761.955569...0.219701-0.641184-0.172258-0.6535101.0875622.267288-1.447545-0.4005571.555596-0.400194
\n", + "

4 rows × 735 columns

\n", + "
" + ], + "text/plain": [ + " ABL1 AEBP1 AHR AHRR AIP AIRE \\\n", + "SIDM01150 0.080080 -1.631165 1.822143 -0.486594 -0.783931 -0.844352 \n", + "SIDM00143 -1.332259 1.592115 1.183483 0.799785 1.025860 0.468413 \n", + "SIDM01060 -0.652209 -2.475549 -1.580986 1.089401 -1.944108 0.399068 \n", + "SIDM01167 -1.334910 0.017429 -2.367893 0.813763 2.198922 -0.660442 \n", + "\n", + " AP1 APEX1 AR ARID1A ... ZNF382 ZNF384 \\\n", + "SIDM01150 1.723601 -1.519310 -0.344363 1.623128 ... -4.238011 1.965072 \n", + "SIDM00143 4.497127 -1.430149 2.600641 2.156102 ... -0.789468 3.996778 \n", + "SIDM01060 -5.066813 -2.765601 -0.934723 -0.981179 ... 1.715413 -0.158227 \n", + "SIDM01167 -2.465387 -1.764444 -2.983476 1.955569 ... 0.219701 -0.641184 \n", + "\n", + " ZNF395 ZNF410 ZNF436 ZNF699 ZNF76 ZNF804A \\\n", + "SIDM01150 -2.004019 0.069187 2.652415 -0.182054 -1.793975 -0.143599 \n", + "SIDM00143 -1.028295 -0.517214 0.598231 1.087119 0.778563 -0.599900 \n", + "SIDM01060 1.480932 0.409427 -0.044302 -0.413981 -0.048804 -2.692391 \n", + "SIDM01167 -0.172258 -0.653510 1.087562 2.267288 -1.447545 -0.400557 \n", + "\n", + " ZNF91 ZXDC \n", + "SIDM01150 1.938493 -0.277062 \n", + "SIDM00143 1.412452 -2.276532 \n", + "SIDM01060 1.406787 -0.253700 \n", + "SIDM01167 1.555596 -0.400194 \n", + "\n", + "[4 rows x 735 columns]" + ] + }, + "execution_count": 45, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "tf_acts" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "metadata": {}, + "outputs": [], + "source": [ + "measurements = tf_acts.loc[\"SIDM01060\"].sort_values(ascending=False, key=abs)[0:25].to_dict()\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 3. Network inference with NetworkCommons" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now that we have scores for upstream and downstream layers, we can perform network inference with NetworkCommons. For the sake of simplicity and just for demonstration purposes, we will only use the shortest path approach. " + ] + }, + { + "cell_type": "code", + "execution_count": 59, + "metadata": {}, + "outputs": [], + "source": [ + "network = nc.data.network.get_omnipath()\n", + "graph = nc.utils.network_from_df(network)" + ] + }, + { + "cell_type": "code", + "execution_count": 60, + "metadata": {}, + "outputs": [], + "source": [ + "source = {'BRAF': -1}" + ] + }, + { + "cell_type": "code", + "execution_count": 68, + "metadata": {}, + "outputs": [], + "source": [ + "shortest_path_network, shortest_path_list = nc.methods.run_shortest_paths(graph, source, measurements)\n", + "shortest_sc_network, shortest_sc_list = nc.methods.run_sign_consistency(shortest_path_network, shortest_path_list, source, measurements)" + ] + }, + { + "cell_type": "code", + "execution_count": 69, + "metadata": {}, + "outputs": [ + { + "data": { + "image/svg+xml": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "BRAF\n", + "\n", + "BRAF\n", + "\n", + "\n", + "\n", + "MAP2K1\n", + "\n", + "MAP2K1\n", + "\n", + "\n", + "\n", + "BRAF->MAP2K1\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "MAP2K2\n", + "\n", + "MAP2K2\n", + "\n", + "\n", + "\n", + "BRAF->MAP2K2\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "MAP4K1\n", + "\n", + "MAP4K1\n", + "\n", + "\n", + "\n", + "BRAF->MAP4K1\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "MAPK3\n", + "\n", + "MAPK3\n", + "\n", + "\n", + "\n", + "MAP2K1->MAPK3\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "MAPK1\n", + "\n", + "MAPK1\n", + "\n", + "\n", + "\n", + "MAP2K1->MAPK1\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "GSK3B\n", + "\n", + "GSK3B\n", + "\n", + "\n", + "\n", + "MAP2K1->GSK3B\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "RPS6KA4\n", + "\n", + "RPS6KA4\n", + "\n", + "\n", + "\n", + "MAP2K1->RPS6KA4\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "MAP2K2->MAPK3\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "MAP2K2->MAPK1\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "MAP4K1->MAPK1\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "MAP3K7\n", + "\n", + "MAP3K7\n", + "\n", + "\n", + "\n", + "MAP4K1->MAP3K7\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "CEBPB\n", + "\n", + "CEBPB\n", + "\n", + "\n", + "\n", + "MAPK3->CEBPB\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "E2F1\n", + "\n", + "E2F1\n", + "\n", + "\n", + "\n", + "MAPK3->E2F1\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "MYC\n", + "\n", + "MYC\n", + "\n", + "\n", + "\n", + "MAPK3->MYC\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "ATF2\n", + "\n", + "ATF2\n", + "\n", + "\n", + "\n", + "MAPK3->ATF2\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "MITF\n", + "\n", + "MITF\n", + "\n", + "\n", + "\n", + "MAPK3->MITF\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "PML\n", + "\n", + "PML\n", + "\n", + "\n", + "\n", + "MAPK3->PML\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "HIF1A\n", + "\n", + "HIF1A\n", + "\n", + "\n", + "\n", + "MAPK3->HIF1A\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "MAPK1->CEBPB\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "MAPK1->MYC\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "MAPK1->ATF2\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "MAPK1->PML\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "MAPK1->HIF1A\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "CDK2\n", + "\n", + "CDK2\n", + "\n", + "\n", + "\n", + "MAPK1->CDK2\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "RELA\n", + "\n", + "RELA\n", + "\n", + "\n", + "\n", + "MAPK1->RELA\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "JUN\n", + "\n", + "JUN\n", + "\n", + "\n", + "\n", + "MAPK1->JUN\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "CREBBP\n", + "\n", + "CREBBP\n", + "\n", + "\n", + "\n", + "MAPK1->CREBBP\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "GSK3B->CEBPB\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "GSK3B->RELA\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "NFKB1\n", + "\n", + "NFKB1\n", + "\n", + "\n", + "\n", + "GSK3B->NFKB1\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "SREBF1\n", + "\n", + "SREBF1\n", + "\n", + "\n", + "\n", + "GSK3B->SREBF1\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "CTNNB1\n", + "\n", + "CTNNB1\n", + "\n", + "\n", + "\n", + "GSK3B->CTNNB1\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "CREB1\n", + "\n", + "CREB1\n", + "\n", + "\n", + "\n", + "GSK3B->CREB1\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "RPS6KA4->RELA\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "MAPK14\n", + "\n", + "MAPK14\n", + "\n", + "\n", + "\n", + "MAP3K7->MAPK14\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "IKBKG\n", + "\n", + "IKBKG\n", + "\n", + "\n", + "\n", + "MAP3K7->IKBKG\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "E2F4\n", + "\n", + "E2F4\n", + "\n", + "\n", + "\n", + "CEBPB->E2F4\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "CHEK1\n", + "\n", + "CHEK1\n", + "\n", + "\n", + "\n", + "E2F1->CHEK1\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "TFDP1\n", + "\n", + "TFDP1\n", + "\n", + "\n", + "\n", + "E2F1->TFDP1\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "MYC->TFDP1\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "YAP1\n", + "\n", + "YAP1\n", + "\n", + "\n", + "\n", + "PML->YAP1\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "CDK2->CHEK1\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "RB1\n", + "\n", + "RB1\n", + "\n", + "\n", + "\n", + "CDK2->RB1\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "TCF4\n", + "\n", + "TCF4\n", + "\n", + "\n", + "\n", + "JUN->TCF4\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "RELB\n", + "\n", + "RELB\n", + "\n", + "\n", + "\n", + "CREBBP->RELB\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "FOXO4\n", + "\n", + "FOXO4\n", + "\n", + "\n", + "\n", + "CTNNB1->FOXO4\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "CREB1->FOXO4\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "MAPK14->RB1\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "NFKBIB\n", + "\n", + "NFKBIB\n", + "\n", + "\n", + "\n", + "IKBKG->NFKBIB\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "E2F3\n", + "\n", + "E2F3\n", + "\n", + "\n", + "\n", + "CHEK1->E2F3\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "TEAD1\n", + "\n", + "TEAD1\n", + "\n", + "\n", + "\n", + "YAP1->TEAD1\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "RB1->E2F3\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "E2F2\n", + "\n", + "E2F2\n", + "\n", + "\n", + "\n", + "RB1->E2F2\n", + "\n", + "\n", + "\n", + "\n", + "\n" + ], + "text/plain": [ + ">" + ] + }, + "execution_count": 69, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "visualizer = nc.visual.NetworkXVisualizer(shortest_sc_network)\n", + "visualizer.visualize_network(source, measurements, network_type='sign_consistent')" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "networkcommons-DX9y6Uxu-py3.10", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.12" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +}