{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "In this notebook, we show how the computational of the fixpoints of qualitative regulatory networks can be done with different methods, which should give equivalent results, using *GINsim* and *Pint*." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Model loading\n", "\n", "We load a simple model available on http://ginsim.org/node/41" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from colomoto_jupyter import tabulate # for displaying list of fixpoints\n", "import ginsim" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ "Downloading http://ginsim.org/sites/default/files/Th_17.zginml" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "th17 = ginsim.load(\"http://ginsim.org/sites/default/files/Th_17.zginml\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Computation of fixpoints with bioLQM" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "import biolqm" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "th17_lqm = ginsim.to_biolqm(th17)" ] }, { "cell_type": "code", "execution_count": 5, "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", "
IFNgIFNgRSTAT1TbetSOCS1IFNbIFNbRIL18IL18RIRAKIL12IL12RSTAT4IL4IL4RSTAT6GATA3
000000000000000000
100000000000001111
211111000000000000
321121000000000000
\n", "
" ], "text/plain": [ " IFNg IFNgR STAT1 Tbet SOCS1 IFNb IFNbR IL18 IL18R IRAK IL12 \\\n", "0 0 0 0 0 0 0 0 0 0 0 0 \n", "1 0 0 0 0 0 0 0 0 0 0 0 \n", "2 1 1 1 1 1 0 0 0 0 0 0 \n", "3 2 1 1 2 1 0 0 0 0 0 0 \n", "\n", " IL12R STAT4 IL4 IL4R STAT6 GATA3 \n", "0 0 0 0 0 0 0 \n", "1 0 0 1 1 1 1 \n", "2 0 0 0 0 0 0 \n", "3 0 0 0 0 0 0 " ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "fps_lqm = biolqm.fixpoints(th17_lqm)\n", "tabulate(fps_lqm)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Computation of fixpoints with Pint" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "import pypint" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "th17_an = biolqm.to_pint(th17_lqm)" ] }, { "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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
IFNgIFNgRSTAT1TbetSOCS1IFNbIFNbRIL18IL18RIRAKIL12IL12RSTAT4IL4IL4RSTAT6GATA3
000000000000000000
100000000000001111
211111000000000000
321121000000000000
\n", "
" ], "text/plain": [ " IFNg IFNgR STAT1 Tbet SOCS1 IFNb IFNbR IL18 IL18R IRAK IL12 \\\n", "0 0 0 0 0 0 0 0 0 0 0 0 \n", "1 0 0 0 0 0 0 0 0 0 0 0 \n", "2 1 1 1 1 1 0 0 0 0 0 0 \n", "3 2 1 1 2 1 0 0 0 0 0 0 \n", "\n", " IL12R STAT4 IL4 IL4R STAT6 GATA3 \n", "0 0 0 0 0 0 0 \n", "1 0 0 1 1 1 1 \n", "2 0 0 0 0 0 0 \n", "3 0 0 0 0 0 0 " ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "fps_an = pypint.fixpoints(th17_an)\n", "tabulate(fps_an)" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "### Display fixpoint using GINsim" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ginsim.show(th17, fps_lqm[1]) # or fps_an[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.7" } }, "nbformat": 4, "nbformat_minor": 2 }