{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ "This notebook has been executed using the docker image `colomoto/colomoto-docker:2020-07-01`" ], "text/plain": [ "<IPython.core.display.Markdown object>" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import biolqm\n", "import stablemotifs\n", "from colomoto_jupyter import tabulate\n", "import pandas as pd" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Model name: Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz\r\n" ] } ], "source": [ "!lscpu|grep name" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Lets first import the T-LGL leukemia model used in Zanudo et al. 2015 (DOI: 10.1371/journal.pcbi.1004571) and display its Boolean rules" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ "Downloading http://ginsim.org/sites/default/files/SuppMat_Model_Master_Model.zginml" ], "text/plain": [ "<IPython.core.display.Markdown object>" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "model = biolqm.load(\"http://ginsim.org/sites/default/files/SuppMat_Model_Master_Model.zginml\")" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "target = {\"CellCycleArrest\": 1,\"EMT\":1,\"Invasion\":1,\"Migration\":1,\"Metastasis\":1,\"Apoptosis\":0}" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The model contains a large number of cycles, so the algorithm in StableMotifs needs to include a threshold in the maximal cycle length it uses to construct the stable motifs, which are then used to obtain the reprogramming interventions.\n", "\n", "Note: There are more efficient algorithms for finding stable motifs that are not yet implemented (e.g. the one in PyBoolNet: https://github.com/hklarner/PyBoolNet). Using these more efficient algorithms would not require such a threshold and would make the program much faster. Future releases will include these more efficient algorithms." ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "CPU times: user 21.2 ms, sys: 15.9 ms, total: 37 ms\n", "Wall time: 2min 30s\n" ] } ], "source": [ "fixed = {\"ECMicroenv\": 0, \"DNAdamage\": 0}\n", "%time stm00 = stablemotifs.load(model, fixed, mcl=10, msm=10000, quiet=True) #Max cycle size for SM seems to be 10" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "CPU times: user 13.8 ms, sys: 10.6 ms, total: 24.5 ms\n", "Wall time: 1min 11s\n" ] } ], "source": [ "fixed = {\"ECMicroenv\": 1, \"DNAdamage\": 0}\n", "%time stm10 = stablemotifs.load(model,fixed, mcl=5, msm=10000, quiet=True) #Max cycle size for SM seems to be 5" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "CPU times: user 125 ms, sys: 274 ms, total: 398 ms\n", "Wall time: 44min 22s\n" ] } ], "source": [ "fixed = {\"ECMicroenv\": 0, \"DNAdamage\": 1}\n", "%time stm01 = stablemotifs.load(model, fixed, mcl=7, msm=10000, quiet=True) #Max cycle size for SM seems to be 7" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "CPU times: user 24.4 ms, sys: 35.8 ms, total: 60.2 ms\n", "Wall time: 5min 22s\n" ] } ], "source": [ "fixed = {\"ECMicroenv\": 1, \"DNAdamage\": 1}\n", "%time stm11 = stablemotifs.load(model, fixed, mcl=5, msm=10000, quiet=True) #Max cycle size for SM seems to be 5" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[]" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "r00 = stm00.reprogramming_to_attractor(target)\n", "r00" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[FromCondition('input', TemporaryPerturbation(SNAI2=1)),\n", " FromCondition('input', TemporaryPerturbation(p53=0))]" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "r10 = stm10.reprogramming_to_attractor(target)\n", "r10" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/html": [ "<style type=\"text/css\" >\n", " #T_cbca7e0a_bc42_11ea_a9e3_0242ac110002 th {\n", " border-right: 1px solid black;\n", " } #T_cbca7e0a_bc42_11ea_a9e3_0242ac110002 td {\n", " border-right: 1px solid black;\n", " min-width: 2em;\n", " } #T_cbca7e0a_bc42_11ea_a9e3_0242ac110002 th.col_heading {\n", " writing-mode: vertical-lr;\n", " transform: rotateZ(180deg);\n", " vertical-align: top;\n", " border-bottom: 1px solid black;\n", " text-orientation: mixed;\n", " } #T_cbca7e0a_bc42_11ea_a9e3_0242ac110002row0_col1 {\n", " color: black;\n", " background-color: lime;\n", " } #T_cbca7e0a_bc42_11ea_a9e3_0242ac110002row1_col0 {\n", " color: black;\n", " background-color: red;\n", " }</style><table id=\"T_cbca7e0a_bc42_11ea_a9e3_0242ac110002\" ><thead> <tr> <th class=\"blank level0\" ></th> <th class=\"col_heading level0 col0\" >SNAI2</th> <th class=\"col_heading level0 col1\" >p53</th> </tr></thead><tbody>\n", " <tr>\n", " <th id=\"T_cbca7e0a_bc42_11ea_a9e3_0242ac110002level0_row0\" class=\"row_heading level0 row0\" >0</th>\n", " <td id=\"T_cbca7e0a_bc42_11ea_a9e3_0242ac110002row0_col0\" class=\"data row0 col0\" ></td>\n", " <td id=\"T_cbca7e0a_bc42_11ea_a9e3_0242ac110002row0_col1\" class=\"data row0 col1\" >0</td>\n", " </tr>\n", " <tr>\n", " <th id=\"T_cbca7e0a_bc42_11ea_a9e3_0242ac110002level0_row1\" class=\"row_heading level0 row1\" >1</th>\n", " <td id=\"T_cbca7e0a_bc42_11ea_a9e3_0242ac110002row1_col0\" class=\"data row1 col0\" >1</td>\n", " <td id=\"T_cbca7e0a_bc42_11ea_a9e3_0242ac110002row1_col1\" class=\"data row1 col1\" ></td>\n", " </tr>\n", " </tbody></table>" ], "text/plain": [ "<pandas.io.formats.style.Styler at 0x7f6923da3c10>" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "r10.as_table()" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "image/svg+xml": [ "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n", "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n", " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n", "<!-- Generated by graphviz version 2.38.0 (20140413.2041)\n", " -->\n", "<!-- Title: %3 Pages: 1 -->\n", "<svg width=\"287pt\" height=\"44pt\"\n", " viewBox=\"0.00 0.00 287.33 44.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n", "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 40)\">\n", "<title>%3</title>\n", "<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-40 283.331,-40 283.331,4 -4,4\"/>\n", "<!-- target -->\n", "<g id=\"node1\" class=\"node\"><title>target</title>\n", "<polygon fill=\"palegreen\" stroke=\"black\" points=\"223.262,-36 167.125,-18 223.262,-3.55271e-15 279.4,-18 223.262,-36\"/>\n", "<polyline fill=\"none\" stroke=\"black\" points=\"178.552,-21.664 178.552,-14.336 \"/>\n", "<polyline fill=\"none\" stroke=\"black\" points=\"211.835,-3.66397 234.689,-3.66397 \"/>\n", "<polyline fill=\"none\" stroke=\"black\" points=\"267.973,-14.336 267.973,-21.664 \"/>\n", "<polyline fill=\"none\" stroke=\"black\" points=\"234.689,-32.336 211.835,-32.336 \"/>\n", "<text text-anchor=\"middle\" x=\"223.262\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\">target</text>\n", "</g>\n", "<!-- input -->\n", "<g id=\"node2\" class=\"node\"><title>input</title>\n", "<g id=\"a_node2\"><a xlink:title=\"Condition\">\n", "<ellipse fill=\"none\" stroke=\"black\" cx=\"35.0969\" cy=\"-18\" rx=\"35.194\" ry=\"18\"/>\n", "<text text-anchor=\"middle\" x=\"35.0969\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\">input</text>\n", "</a>\n", "</g>\n", "</g>\n", "<!-- input->target -->\n", "<g id=\"edge1\" class=\"edge\"><title>input->target</title>\n", "<path fill=\"none\" stroke=\"black\" d=\"M70.2425,-18C94.4683,-18 127.742,-18 156.985,-18\"/>\n", "<polygon fill=\"black\" stroke=\"black\" points=\"157.139,-21.5001 167.139,-18 157.139,-14.5001 157.139,-21.5001\"/>\n", "<g id=\"a_edge1-label\"><a xlink:title=\"TemporaryPerturbation(SNAI2=1)\">\n", "<text text-anchor=\"middle\" x=\"118.694\" y=\"-21\" font-family=\"Times,serif\" font-size=\"10.00\">T(SNAI2=1)</text>\n", "</a>\n", "</g>\n", "</g>\n", "<!-- input->target -->\n", "<g id=\"edge2\" class=\"edge\"><title>input->target</title>\n", "<path fill=\"none\" stroke=\"black\" d=\"M64.7181,-8.20318C72.2626,-6.05191 80.4584,-4.09143 88.1938,-3 115.039,0.787765 122.221,-0.260044 149.194,-3 159.63,-4.06012 170.777,-5.95107 181.14,-8.04097\"/>\n", "<polygon fill=\"black\" stroke=\"black\" points=\"180.678,-11.5208 191.187,-10.1738 182.132,-4.6734 180.678,-11.5208\"/>\n", "<g id=\"a_edge2-label\"><a xlink:title=\"TemporaryPerturbation(p53=0)\">\n", "<text text-anchor=\"middle\" x=\"118.694\" y=\"-6\" font-family=\"Times,serif\" font-size=\"10.00\">T(p53=0)</text>\n", "</a>\n", "</g>\n", "</g>\n", "</g>\n", "</svg>\n" ], "text/plain": [ "<pydot.Dot at 0x7f6922f67050>" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "r10.as_graph()" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[]" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "r01 = stm01.reprogramming_to_attractor(target)\n", "r01" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[FromCondition('input', TemporaryPerturbation(NICD=1, SNAI2=1)),\n", " FromCondition('input', TemporaryPerturbation(SNAI2=1, p63=0)),\n", " FromCondition('input', TemporaryPerturbation(NICD=1, ZEB1=1, p53=0)),\n", " FromCondition('input', TemporaryPerturbation(NICD=1, miR200=0, p53=0)),\n", " FromCondition('input', TemporaryPerturbation(NICD=1, p53=0, p73=0)),\n", " FromCondition('input', TemporaryPerturbation(ZEB1=1, p53=0, p63=0)),\n", " FromCondition('input', TemporaryPerturbation(p53=0, p63=0, p73=0))]" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "r11 = stm11.reprogramming_to_attractor(target)\n", "r11" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "data": { "text/html": [ "<style type=\"text/css\" >\n", " #T_cbda2440_bc42_11ea_a9e3_0242ac110002 th {\n", " border-right: 1px solid black;\n", " } #T_cbda2440_bc42_11ea_a9e3_0242ac110002 td {\n", " border-right: 1px solid black;\n", " min-width: 2em;\n", " } #T_cbda2440_bc42_11ea_a9e3_0242ac110002 th.col_heading {\n", " writing-mode: vertical-lr;\n", " transform: rotateZ(180deg);\n", " vertical-align: top;\n", " border-bottom: 1px solid black;\n", " text-orientation: mixed;\n", " } #T_cbda2440_bc42_11ea_a9e3_0242ac110002row0_col4 {\n", " color: black;\n", " background-color: lime;\n", " } #T_cbda2440_bc42_11ea_a9e3_0242ac110002row0_col5 {\n", " color: black;\n", " background-color: lime;\n", " } #T_cbda2440_bc42_11ea_a9e3_0242ac110002row0_col6 {\n", " color: black;\n", " background-color: lime;\n", " } #T_cbda2440_bc42_11ea_a9e3_0242ac110002row1_col2 {\n", " color: black;\n", " background-color: red;\n", " } #T_cbda2440_bc42_11ea_a9e3_0242ac110002row1_col4 {\n", " color: black;\n", " background-color: lime;\n", " } #T_cbda2440_bc42_11ea_a9e3_0242ac110002row1_col5 {\n", " color: black;\n", " background-color: lime;\n", " } #T_cbda2440_bc42_11ea_a9e3_0242ac110002row2_col1 {\n", " color: black;\n", " background-color: red;\n", " } #T_cbda2440_bc42_11ea_a9e3_0242ac110002row2_col5 {\n", " color: black;\n", " background-color: lime;\n", " } #T_cbda2440_bc42_11ea_a9e3_0242ac110002row3_col0 {\n", " color: black;\n", " background-color: red;\n", " } #T_cbda2440_bc42_11ea_a9e3_0242ac110002row3_col4 {\n", " color: black;\n", " background-color: lime;\n", " } #T_cbda2440_bc42_11ea_a9e3_0242ac110002row3_col6 {\n", " color: black;\n", " background-color: lime;\n", " } #T_cbda2440_bc42_11ea_a9e3_0242ac110002row4_col0 {\n", " color: black;\n", " background-color: red;\n", " } #T_cbda2440_bc42_11ea_a9e3_0242ac110002row4_col3 {\n", " color: black;\n", " background-color: lime;\n", " } #T_cbda2440_bc42_11ea_a9e3_0242ac110002row4_col4 {\n", " color: black;\n", " background-color: lime;\n", " } #T_cbda2440_bc42_11ea_a9e3_0242ac110002row5_col0 {\n", " color: black;\n", " background-color: red;\n", " } #T_cbda2440_bc42_11ea_a9e3_0242ac110002row5_col2 {\n", " color: black;\n", " background-color: red;\n", " } #T_cbda2440_bc42_11ea_a9e3_0242ac110002row5_col4 {\n", " color: black;\n", " background-color: lime;\n", " } #T_cbda2440_bc42_11ea_a9e3_0242ac110002row6_col0 {\n", " color: black;\n", " background-color: red;\n", " } #T_cbda2440_bc42_11ea_a9e3_0242ac110002row6_col1 {\n", " color: black;\n", " background-color: red;\n", " }</style><table id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002\" ><thead> <tr> <th class=\"blank level0\" ></th> <th class=\"col_heading level0 col0\" >NICD</th> <th class=\"col_heading level0 col1\" >SNAI2</th> <th class=\"col_heading level0 col2\" >ZEB1</th> <th class=\"col_heading level0 col3\" >miR200</th> <th class=\"col_heading level0 col4\" >p53</th> <th class=\"col_heading level0 col5\" >p63</th> <th class=\"col_heading level0 col6\" >p73</th> </tr></thead><tbody>\n", " <tr>\n", " <th id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002level0_row0\" class=\"row_heading level0 row0\" >0</th>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row0_col0\" class=\"data row0 col0\" ></td>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row0_col1\" class=\"data row0 col1\" ></td>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row0_col2\" class=\"data row0 col2\" ></td>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row0_col3\" class=\"data row0 col3\" ></td>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row0_col4\" class=\"data row0 col4\" >0</td>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row0_col5\" class=\"data row0 col5\" >0</td>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row0_col6\" class=\"data row0 col6\" >0</td>\n", " </tr>\n", " <tr>\n", " <th id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002level0_row1\" class=\"row_heading level0 row1\" >1</th>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row1_col0\" class=\"data row1 col0\" ></td>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row1_col1\" class=\"data row1 col1\" ></td>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row1_col2\" class=\"data row1 col2\" >1</td>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row1_col3\" class=\"data row1 col3\" ></td>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row1_col4\" class=\"data row1 col4\" >0</td>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row1_col5\" class=\"data row1 col5\" >0</td>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row1_col6\" class=\"data row1 col6\" ></td>\n", " </tr>\n", " <tr>\n", " <th id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002level0_row2\" class=\"row_heading level0 row2\" >2</th>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row2_col0\" class=\"data row2 col0\" ></td>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row2_col1\" class=\"data row2 col1\" >1</td>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row2_col2\" class=\"data row2 col2\" ></td>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row2_col3\" class=\"data row2 col3\" ></td>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row2_col4\" class=\"data row2 col4\" ></td>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row2_col5\" class=\"data row2 col5\" >0</td>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row2_col6\" class=\"data row2 col6\" ></td>\n", " </tr>\n", " <tr>\n", " <th id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002level0_row3\" class=\"row_heading level0 row3\" >3</th>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row3_col0\" class=\"data row3 col0\" >1</td>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row3_col1\" class=\"data row3 col1\" ></td>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row3_col2\" class=\"data row3 col2\" ></td>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row3_col3\" class=\"data row3 col3\" ></td>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row3_col4\" class=\"data row3 col4\" >0</td>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row3_col5\" class=\"data row3 col5\" ></td>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row3_col6\" class=\"data row3 col6\" >0</td>\n", " </tr>\n", " <tr>\n", " <th id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002level0_row4\" class=\"row_heading level0 row4\" >4</th>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row4_col0\" class=\"data row4 col0\" >1</td>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row4_col1\" class=\"data row4 col1\" ></td>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row4_col2\" class=\"data row4 col2\" ></td>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row4_col3\" class=\"data row4 col3\" >0</td>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row4_col4\" class=\"data row4 col4\" >0</td>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row4_col5\" class=\"data row4 col5\" ></td>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row4_col6\" class=\"data row4 col6\" ></td>\n", " </tr>\n", " <tr>\n", " <th id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002level0_row5\" class=\"row_heading level0 row5\" >5</th>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row5_col0\" class=\"data row5 col0\" >1</td>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row5_col1\" class=\"data row5 col1\" ></td>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row5_col2\" class=\"data row5 col2\" >1</td>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row5_col3\" class=\"data row5 col3\" ></td>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row5_col4\" class=\"data row5 col4\" >0</td>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row5_col5\" class=\"data row5 col5\" ></td>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row5_col6\" class=\"data row5 col6\" ></td>\n", " </tr>\n", " <tr>\n", " <th id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002level0_row6\" class=\"row_heading level0 row6\" >6</th>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row6_col0\" class=\"data row6 col0\" >1</td>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row6_col1\" class=\"data row6 col1\" >1</td>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row6_col2\" class=\"data row6 col2\" ></td>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row6_col3\" class=\"data row6 col3\" ></td>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row6_col4\" class=\"data row6 col4\" ></td>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row6_col5\" class=\"data row6 col5\" ></td>\n", " <td id=\"T_cbda2440_bc42_11ea_a9e3_0242ac110002row6_col6\" class=\"data row6 col6\" ></td>\n", " </tr>\n", " </tbody></table>" ], "text/plain": [ "<pandas.io.formats.style.Styler at 0x7f69237f2850>" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "r11.as_table()" ] }, { "cell_type": "raw", "metadata": {}, "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "As a reprogramming example, consider the case of the environmental signal ECMicroenv=1 DNAdamage=1. Under this threshold, we can identify the two attractors. Specifically, we identify attractors HS and EMT2 (using the terminology of Cohen et al.)." ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "data": { "text/html": [ "<div>\n", "<style scoped>\n", " .dataframe tbody tr th:only-of-type {\n", " vertical-align: middle;\n", " }\n", "\n", " .dataframe tbody tr th {\n", " vertical-align: top;\n", " }\n", "\n", " .dataframe thead th {\n", " text-align: right;\n", " }\n", "</style>\n", "<table border=\"1\" class=\"dataframe\">\n", " <thead>\n", " <tr style=\"text-align: right;\">\n", " <th></th>\n", " <th>CellCycleArrest</th>\n", " <th>ECMicroenv</th>\n", " <th>Metastasis</th>\n", " <th>Apoptosis</th>\n", " <th>DNAdamage</th>\n", " <th>Migration</th>\n", " <th>Invasion</th>\n", " <th>TGFbeta</th>\n", " <th>CTNNB1</th>\n", " <th>miR203</th>\n", " <th>miR200</th>\n", " <th>TWIST1</th>\n", " <th>SNAI2</th>\n", " <th>SNAI1</th>\n", " <th>miR34</th>\n", " <th>NICD</th>\n", " <th>ZEB1</th>\n", " <th>ZEB2</th>\n", " <th>DKK1</th>\n", " <th>SMAD</th>\n", " <th>AKT1</th>\n", " <th>AKT2</th>\n", " <th>CDH1</th>\n", " <th>CDH2</th>\n", " <th>ERK</th>\n", " <th>VIM</th>\n", " <th>p21</th>\n", " <th>EMT</th>\n", " <th>p63</th>\n", " <th>p53</th>\n", " <th>p73</th>\n", " <th>GF</th>\n", " </tr>\n", " </thead>\n", " <tbody>\n", " <tr>\n", " <th>1</th>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>1</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " </tr>\n", " <tr>\n", " <th>0</th>\n", " <td>1</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>1</td>\n", " <td>1</td>\n", " <td>1</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>1</td>\n", " <td>1</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>1</td>\n", " <td>0</td>\n", " <td>1</td>\n", " <td>1</td>\n", " <td>1</td>\n", " <td>0</td>\n", " <td>1</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>1</td>\n", " </tr>\n", " </tbody>\n", "</table>\n", "</div>" ], "text/plain": [ " CellCycleArrest ECMicroenv Metastasis Apoptosis DNAdamage Migration \\\n", "1 0 0 0 0 0 0 \n", "0 1 0 0 0 0 0 \n", "\n", " Invasion TGFbeta CTNNB1 miR203 miR200 TWIST1 SNAI2 SNAI1 miR34 \\\n", "1 0 0 0 0 0 0 0 0 0 \n", "0 0 0 0 0 0 1 1 1 0 \n", "\n", " NICD ZEB1 ZEB2 DKK1 SMAD AKT1 AKT2 CDH1 CDH2 ERK VIM p21 EMT \\\n", "1 0 0 0 0 0 0 0 1 0 0 0 0 0 \n", "0 0 1 1 0 0 0 1 0 1 1 1 0 1 \n", "\n", " p63 p53 p73 GF \n", "1 0 0 0 0 \n", "0 0 0 0 1 " ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "tabulate(stm00.attractors)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "These attractors have the associated stable motfis and reprogramming interventions" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[{'CDH2': 1,\n", " 'CTNNB1': 0,\n", " 'SNAI1': 1,\n", " 'TWIST1': 1,\n", " 'miR203': 0,\n", " 'miR34': 0,\n", " 'p53': 0},\n", " {'AKT2': 0,\n", " 'CDH1': 1,\n", " 'CTNNB1': 0,\n", " 'SNAI1': 0,\n", " 'SNAI2': 0,\n", " 'TWIST1': 0,\n", " 'ZEB1': 0,\n", " 'ZEB2': 0}]" ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "stm00.stable_motifs" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{0: [{'SNAI1': 1}, {'TWIST1': 1, 'miR34': 0}, {'TWIST1': 1, 'p53': 0}],\n", " 1: [{'CDH1': 1, 'SNAI1': 0},\n", " {'CDH1': 1, 'TWIST1': 0},\n", " {'CTNNB1': 0, 'SNAI1': 0},\n", " {'CTNNB1': 0, 'TWIST1': 0},\n", " {'SNAI2': 0, 'TWIST1': 0, 'ZEB1': 0}]}" ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "stm00.control_sets" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can now identify reprogramming interventions for each of the attractors with EMT=0, which is only one of them in this case (named HS in the work of Cohen et al.)." ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[FromCondition('input', TemporaryPerturbation(CDH1=1, SNAI1=0)),\n", " FromCondition('input', TemporaryPerturbation(CDH1=1, TWIST1=0)),\n", " FromCondition('input', TemporaryPerturbation(CTNNB1=0, SNAI1=0)),\n", " FromCondition('input', TemporaryPerturbation(CTNNB1=0, TWIST1=0)),\n", " FromCondition('input', TemporaryPerturbation(SNAI2=0, TWIST1=0, ZEB1=0))]" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "stm00.reprogramming_to_attractor(EMT=0)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "As another reprogramming example, consider the case of the environmental signal ECMicroenv=1 DNAdamage=1. Under this threshold, we can identify two of the three attractors. Specifically, we identify attractors Apo3 and M1." ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [ { "data": { "text/html": [ "<div>\n", "<style scoped>\n", " .dataframe tbody tr th:only-of-type {\n", " vertical-align: middle;\n", " }\n", "\n", " .dataframe tbody tr th {\n", " vertical-align: top;\n", " }\n", "\n", " .dataframe thead th {\n", " text-align: right;\n", " }\n", "</style>\n", "<table border=\"1\" class=\"dataframe\">\n", " <thead>\n", " <tr style=\"text-align: right;\">\n", " <th></th>\n", " <th>CellCycleArrest</th>\n", " <th>ECMicroenv</th>\n", " <th>Metastasis</th>\n", " <th>Apoptosis</th>\n", " <th>DNAdamage</th>\n", " <th>Migration</th>\n", " <th>Invasion</th>\n", " <th>TGFbeta</th>\n", " <th>CTNNB1</th>\n", " <th>miR203</th>\n", " <th>miR200</th>\n", " <th>TWIST1</th>\n", " <th>SNAI2</th>\n", " <th>SNAI1</th>\n", " <th>miR34</th>\n", " <th>NICD</th>\n", " <th>ZEB1</th>\n", " <th>ZEB2</th>\n", " <th>DKK1</th>\n", " <th>SMAD</th>\n", " <th>AKT1</th>\n", " <th>AKT2</th>\n", " <th>CDH1</th>\n", " <th>CDH2</th>\n", " <th>ERK</th>\n", " <th>VIM</th>\n", " <th>p21</th>\n", " <th>EMT</th>\n", " <th>p63</th>\n", " <th>p53</th>\n", " <th>p73</th>\n", " <th>GF</th>\n", " </tr>\n", " </thead>\n", " <tbody>\n", " <tr>\n", " <th>0</th>\n", " <td>1</td>\n", " <td>1</td>\n", " <td>0</td>\n", " <td>1</td>\n", " <td>1</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>1</td>\n", " <td>0</td>\n", " <td>1</td>\n", " <td>1</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>1</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>1</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>1</td>\n", " <td>0</td>\n", " <td>0</td>\n", " </tr>\n", " <tr>\n", " <th>1</th>\n", " <td>1</td>\n", " <td>1</td>\n", " <td>1</td>\n", " <td>0</td>\n", " <td>1</td>\n", " <td>1</td>\n", " <td>1</td>\n", " <td>1</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>1</td>\n", " <td>1</td>\n", " <td>1</td>\n", " <td>0</td>\n", " <td>1</td>\n", " <td>1</td>\n", " <td>1</td>\n", " <td>1</td>\n", " <td>1</td>\n", " <td>0</td>\n", " <td>1</td>\n", " <td>0</td>\n", " <td>1</td>\n", " <td>1</td>\n", " <td>1</td>\n", " <td>0</td>\n", " <td>1</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>0</td>\n", " <td>1</td>\n", " </tr>\n", " </tbody>\n", "</table>\n", "</div>" ], "text/plain": [ " CellCycleArrest ECMicroenv Metastasis Apoptosis DNAdamage Migration \\\n", "0 1 1 0 1 1 0 \n", "1 1 1 1 0 1 1 \n", "\n", " Invasion TGFbeta CTNNB1 miR203 miR200 TWIST1 SNAI2 SNAI1 miR34 \\\n", "0 0 1 0 1 1 0 0 0 0 \n", "1 1 1 0 0 0 1 1 1 0 \n", "\n", " NICD ZEB1 ZEB2 DKK1 SMAD AKT1 AKT2 CDH1 CDH2 ERK VIM p21 EMT \\\n", "0 0 0 0 0 0 0 0 1 0 0 0 1 0 \n", "1 1 1 1 1 1 0 1 0 1 1 1 0 1 \n", "\n", " p63 p53 p73 GF \n", "0 0 1 0 0 \n", "1 0 0 0 1 " ] }, "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ "tabulate(stm11.attractors)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "These attractors have the associated stable motfis and reprogramming interventions" ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[{'AKT1': 0, 'AKT2': 0, 'SNAI2': 0, 'p53': 1, 'p73': 0},\n", " {'NICD': 1,\n", " 'SNAI2': 1,\n", " 'ZEB1': 1,\n", " 'miR200': 0,\n", " 'miR203': 0,\n", " 'miR34': 0,\n", " 'p53': 0,\n", " 'p63': 0,\n", " 'p73': 0}]" ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ "stm11.stable_motifs" ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{0: [{'p53': 1}, {'AKT1': 0, 'AKT2': 0, 'SNAI2': 0, 'p73': 0}],\n", " 1: [{'NICD': 1, 'SNAI2': 1},\n", " {'SNAI2': 1, 'p63': 0},\n", " {'NICD': 1, 'ZEB1': 1, 'p53': 0},\n", " {'NICD': 1, 'miR200': 0, 'p53': 0},\n", " {'NICD': 1, 'p53': 0, 'p73': 0},\n", " {'ZEB1': 1, 'p53': 0, 'p63': 0},\n", " {'p53': 0, 'p63': 0, 'p73': 0}]}" ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "stm11.control_sets" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can now identify reprogramming interventions for each of the attractors with Apoptosis=1, which is only one of them in this case (Apo3 in the work of Cohen et al.).\n", "\n", "Note that because of the threshold in the cycle length, we cannot guarantee that the intervention will reprogram the system to the target attractor with 100% effectiveness. We still expect the intervention to be very effective, even if not necessarily 100% effective. This is because any motifs we miss involve long cycles, which are expected to be associated with a smaller basin of attraction." ] }, { "cell_type": "code", "execution_count": 23, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[FromCondition('input', TemporaryPerturbation(p53=1)),\n", " FromCondition('input', TemporaryPerturbation(AKT1=0, AKT2=0, SNAI2=0, p73=0))]" ] }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ "stm11.reprogramming_to_attractor(Apoptosis=1)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "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.7.6" } }, "nbformat": 4, "nbformat_minor": 2 }