{ "cells": [ { "cell_type": "markdown", "id": "c04d11fc-504e-4339-a46e-00808370e67f", "metadata": {}, "source": [ "# Glioblastoma multiforme multi-omics example" ] }, { "cell_type": "markdown", "id": "a2626513-0b15-453e-a529-f05e38335270", "metadata": {}, "source": [ "__Multi-modal GBM example__\n", "\n", "In this notebook, we demonstrate the NetFlow multi-modal pipeline on TCGA multi-omic GBM data.\n", "\n", "The data was pre-processed as described in [1], and can be found in the provided supplementary data.\n", "\n", "__Brief data description:__\n", "- 213 samples\n", "- mRNA gene expression (12,042 genes with 7,092 genes in largest connected component of HPRD)\n", "- DNA methylation (methy; 1,305 features)\n", "- miRNA expression (534 features)\n", "\n", "Here, we consider mRNA gene expression for the 7,092 genes in the largest connected component of the HPRD network." ] }, { "cell_type": "markdown", "id": "b8a7b414-1091-4a18-a5eb-b8a4696cf737", "metadata": {}, "source": [ "# Load libraries" ] }, { "cell_type": "code", "execution_count": 1, "id": "313069d0-408a-4b7c-bcb7-771317a4d2f0", "metadata": {}, "outputs": [], "source": [ "from pathlib import Path\n", "import sys\n", "\n", "import matplotlib.pyplot as plt\n", "import matplotlib.colors as mcolors\n", "import networkx as nx\n", "import numpy as np\n", "import pandas as pd\n", "import plotly.colors as pc\n", "\n", "from lifelines import KaplanMeierFitter\n", "from lifelines.plotting import add_at_risk_counts\n", "from lifelines.statistics import logrank_test, multivariate_logrank_test" ] }, { "cell_type": "markdown", "id": "8609264a-058a-4d2c-a729-317d3e5395dc", "metadata": {}, "source": [ "If ``netflow`` has not been installed, add the path to the library:" ] }, { "cell_type": "code", "execution_count": 2, "id": "861ec4a5-6a00-4065-8d20-dc52b64d4dc3", "metadata": {}, "outputs": [], "source": [ "sys.path.insert(0, Path(Path('.').absolute()).parents[3].resolve().as_posix())\n", "# sys.path.insert(0, Path(Path('.').absolute()).parents[0].resolve().as_posix())" ] }, { "cell_type": "code", "execution_count": 3, "id": "866da40c-5ae9-4bd4-b5a8-e5ebd3a54fd4", "metadata": {}, "outputs": [], "source": [ "import netflow as nf\n", "import netflow.probe.clustering as nfc\n", "import netflow.probe.visualization as nfv" ] }, { "cell_type": "markdown", "id": "9a3079e8-2af5-4f24-8c47-7db932aea290", "metadata": {}, "source": [ "# Colors" ] }, { "cell_type": "markdown", "id": "3b4f94d9-ab4b-4b4f-9569-7280486e8fd4", "metadata": {}, "source": [ "First, we set a discrete colormap with more than 20 colors for plotting later" ] }, { "cell_type": "code", "execution_count": 4, "id": "55c2f96a-db89-4fa2-a3a6-057b1e05e265", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "36\n" ] }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAgAAAABACAYAAABsv8+/AAAAGHRFWHRUaXRsZQBmcm9tX2xpc3QgY29sb3JtYXBDL89FAAAAHnRFWHREZXNjcmlwdGlvbgBmcm9tX2xpc3QgY29sb3JtYXABtCnOAAAAMHRFWHRBdXRob3IATWF0cGxvdGxpYiB2My43LjEsIGh0dHBzOi8vbWF0cGxvdGxpYi5vcmcqr/hNAAAAMnRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHYzLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZwQJZ2oAAAIdSURBVHic7dYxSxYAFIXh+wWCQyC4GZG6NCUSOEVFuDY0SAi61BItuZVDNTVYi0sEDg1Wgxa0ueYUTvkHwiLTrSHIJaSw/3C3OM+zn/XwDsaXt06q6dvwQms3NXmutXu38qe12772orX7/XO1tauqmp9cbu1eDn9o7a5cfdPaLQ7et3bPb0y3dlVVTx/0dnMHI63d0ce3rd3XC+ut3c5Ua1ZVVceP9lq7/e9Lrd2PwWxrd2nvXmu3ubLb2lVVnVncb+0mbv1t7WYWXrV2n24+bO2Ofz1r7aqq1k4/bu3u3B9t7c5/WW/tRj9fbO2ezLxu7aqqRu4OtXaXN8Zau63D3t9cP9xu7U7O3m7tqqpOtZcAwH9LAABAIAEAAIEEAAAEEgAAEEgAAEAgAQAAgQQAAAQSAAAQSAAAQCABAACB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