{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import caspo_control\n", "import biolqm" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Downloading of the model" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ "Downloading http://ginsim.org/sites/default/files/Bladder_Model.zginml" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "model = biolqm.load(\"http://ginsim.org/sites/default/files/Bladder_Model.zginml\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Conversion of the model from multivalued to Boolean " ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "inputs = {\n", " \"GrowthInhibitors\":1,\n", " \"EGFR_stimulus\":1,\n", " \"FGFR3_stimulus\":1\n", "}\n", "target = {\"Apoptosis_b1\": 1, \"RB1\": 1}" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "cc = caspo_control.load(model, inputs)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[FromCondition('input', PermanentPerturbation(DNAdamage=1, RB1=1)),\n", " FromCondition('input', PermanentPerturbation(ATM_b1=1, RB1=1)),\n", " FromCondition('input', PermanentPerturbation(Apoptosis_b1=1, RB1=1)),\n", " FromCondition('input', PermanentPerturbation(RB1=1, TP53=1))]" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "s = cc.reprogramming_to_attractor(target, maxsize=2)\n", "s" ] }, { "cell_type": "code", "execution_count": 6, "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", "
ATM_b1 Apoptosis_b1 DNAdamage RB1 TP53
011
111
211
311
" ], "text/plain": [ "" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "s.as_table()" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "image/svg+xml": [ "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "target\n", "\n", "\n", "\n", "\n", "\n", "target\n", "\n", "\n", "\n", "input\n", "\n", "\n", "input\n", "\n", "\n", "\n", "\n", "\n", "input->target\n", "\n", "\n", "\n", "P(DNAdamage=1, RB1=1)\n", "\n", "\n", "\n", "\n", "\n", "input->target\n", "\n", "\n", "\n", "P(ATM_b1=1, RB1=1)\n", "\n", "\n", "\n", "\n", "\n", "input->target\n", "\n", "\n", "\n", "P(Apoptosis_b1=1, RB1=1)\n", "\n", "\n", "\n", "\n", "\n", "input->target\n", "\n", "\n", "\n", "P(RB1=1, TP53=1)\n", "\n", "\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "s.as_graph()" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
EGFR_stimulusFGFR3_stimulusGrowthInhibitors
input111
\n", "
" ], "text/plain": [ " EGFR_stimulus FGFR3_stimulus GrowthInhibitors\n", "input 1 1 1" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "s.aliases" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [], "source": [ "from colomoto_jupyter import tabulate" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [], "source": [ "test = biolqm.to_minibn(model, ensure_boolean=True)\n", "for n, v in inputs.items():\n", " test[n] = v\n", "test[\"RB1\"] = 1\n", "test[\"TP53\"] = 1" ] }, { "cell_type": "code", "execution_count": 11, "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", "
AKTATM_b1ATM_b2Apoptosis_b1Apoptosis_b2CDC25ACHEK1_2_b1CHEK1_2_b2CyclinACyclinD1CyclinE1DNAdamageE2F1_b1E2F1_b2E2F3_b1E2F3_b2EGFREGFR_stimulusFGFR3FGFR3_stimulusGRB2GrowthInhibitorsGrowth_ArrestMDM2PI3KPTENProliferationRASRB1RBL2SPRYTP53p14ARFp16INK4ap21CIP
000010000000000000111011001011111001
101010010000100000111011001011111001
\n", "
" ], "text/plain": [ " AKT ATM_b1 ATM_b2 Apoptosis_b1 Apoptosis_b2 CDC25A CHEK1_2_b1 \\\n", "0 0 0 0 1 0 0 0 \n", "1 0 1 0 1 0 0 1 \n", "\n", " CHEK1_2_b2 CyclinA CyclinD1 CyclinE1 DNAdamage E2F1_b1 E2F1_b2 \\\n", "0 0 0 0 0 0 0 0 \n", "1 0 0 0 0 1 0 0 \n", "\n", " E2F3_b1 E2F3_b2 EGFR EGFR_stimulus FGFR3 FGFR3_stimulus GRB2 \\\n", "0 0 0 0 1 1 1 0 \n", "1 0 0 0 1 1 1 0 \n", "\n", " GrowthInhibitors Growth_Arrest MDM2 PI3K PTEN Proliferation RAS RB1 \\\n", "0 1 1 0 0 1 0 1 1 \n", "1 1 1 0 0 1 0 1 1 \n", "\n", " RBL2 SPRY TP53 p14ARF p16INK4a p21CIP \n", "0 1 1 1 0 0 1 \n", "1 1 1 1 0 0 1 " ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "tabulate(biolqm.fixpoints(test.to_biolqm()))" ] }, { "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.7" } }, "nbformat": 4, "nbformat_minor": 2 }