{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# BioLQM tutorial\n", "\n", "This notebook illustrates the main features of the python API of the `biolqm` toolkit. We will show how to load a model, perform simple dynamical analysis (simulation and identification of attractors) and apply perturbations.\n", "\n", "The code from this tutorial can be executed on the standard python interpreter, the IPython shell or the Jupyter notebook web interface." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ "This notebook has been executed using the docker image `colomoto/colomoto-docker:for-next`" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import pandas as pd # for the visualization of lists of states\n", "import biolqm" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Load a model\n", "\n", "\n", "The `biolqm.load` function allows to load a model froma file given as parameter. It can be a local file or a web URL to downloadit. bioLQM will use the file extension to guess the format.\n", "See https://github.com/colomoto/bioLQM#how-to-use-it for a list of supported formats, notably GINsim (`.zginml` or `.ginml` files) and SBML qual (`.sbml` files).\n", "\n", "When using the web interface, calling the load function without specifying the parameter enables to pick and upload a local file.\n", "\n", "Here we load a published model of the mammalian cell cycle." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "Using local file boolean_cell_cycle.zginml
" ], "text/plain": [ "/notebook/tutorials/bioLQM/boolean_cell_cycle.zginml" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "lqm = biolqm.load(\"http://ginsim.org/sites/default/files/boolean_cell_cycle.zginml\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Deterministic simulations\n", "\n", "Starting with an initial state (by default where all components are inactive), we can compute the evolution of all components over time by evaluating the logical functions of the model. The `biolqm.trace` function returns an iterator from which we can obtain a list of successive states.\n", "\n", "These simulations are limited to *deterministic* updating modes, where each state has a single successor.\n", "The simulation stops when reaching a stable state or a maximal number of steps (1000 by default)." ] }, { "cell_type": "code", "execution_count": 3, "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", "
CycDRbE2FCycECycAp27Cdc20cdh1UbcH10CycB
00000000000
10110010111
20000001010
30110010110
40100010100
\n", "
" ], "text/plain": [ " CycD Rb E2F CycE CycA p27 Cdc20 cdh1 UbcH10 CycB\n", "0 0 0 0 0 0 0 0 0 0 0\n", "1 0 1 1 0 0 1 0 1 1 1\n", "2 0 0 0 0 0 0 1 0 1 0\n", "3 0 1 1 0 0 1 0 1 1 0\n", "4 0 1 0 0 0 1 0 1 0 0" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "trace = biolqm.trace(lqm)\n", "pd.DataFrame( [s for s in trace] )" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The `biolqm.trace` function can take an additional argument to specify simulation parameters. These parameters are specified in a single string and identified by the following flags:\n", "* `-u` for the updating mode (synchronous by default, can also be sequential)\n", "* `-i` for the initial state (following the internal component ordering)\n", "* `-m` for the maximal number of steps." ] }, { "cell_type": "code", "execution_count": 4, "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", "
CycDRbE2FCycECycAp27Cdc20cdh1UbcH10CycB
00010000000
10111110111
20000001010
30110010110
40100010100
\n", "
" ], "text/plain": [ " CycD Rb E2F CycE CycA p27 Cdc20 cdh1 UbcH10 CycB\n", "0 0 0 1 0 0 0 0 0 0 0\n", "1 0 1 1 1 1 1 0 1 1 1\n", "2 0 0 0 0 0 0 1 0 1 0\n", "3 0 1 1 0 0 1 0 1 1 0\n", "4 0 1 0 0 0 1 0 1 0 0" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "trace = biolqm.trace(lqm, \"-u synchronous -i 0010000000 -m 50\")\n", "pd.DataFrame( [s for s in trace] )" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Random walk in non-deterministic simulations\n", "\n", "Logical models can also be updated in a *non-deterministic* mode, where each state can have many alternative successors.\n", "The `biolqm.random` function allows to perform a random walk in the complex dynamics obtained with non-deterministic updating modes.\n", "\n", "Like `biolqm.trace`, the `biolqm.random` function takes an additional argument for simulation parameters:\n", "* `-u` for the updating mode (asynchronous by default, can also be complete)\n", "* `-i` for the initial state (following the internal component ordering)\n", "* `-m` for the maximal number of steps." ] }, { "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", " \n", " \n", " \n", " \n", "
CycDRbE2FCycECycAp27Cdc20cdh1UbcH10CycB
00010000000
10110000000
20100000000
30100000010
40100000110
50100010110
60100010100
\n", "
" ], "text/plain": [ " CycD Rb E2F CycE CycA p27 Cdc20 cdh1 UbcH10 CycB\n", "0 0 0 1 0 0 0 0 0 0 0\n", "1 0 1 1 0 0 0 0 0 0 0\n", "2 0 1 0 0 0 0 0 0 0 0\n", "3 0 1 0 0 0 0 0 0 1 0\n", "4 0 1 0 0 0 0 0 1 1 0\n", "5 0 1 0 0 0 1 0 1 1 0\n", "6 0 1 0 0 0 1 0 1 0 0" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "random = biolqm.random(lqm, \"-i 0010000000 -m 50\")\n", "pd.DataFrame( [s for s in random] )" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "As this type of simulation is a random walk, successive calls often yield different trajectories." ] }, { "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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
CycDRbE2FCycECycAp27Cdc20cdh1UbcH10CycB
00010000000
10010000010
20011000010
30011000011
40011100011
50001100011
60000100011
70000101011
80000101010
90000001010
100100001010
110100000010
120100010010
130100010011
140100000011
150100001011
160100001010
170100001110
180100000110
190100000100
200100010100
\n", "
" ], "text/plain": [ " CycD Rb E2F CycE CycA p27 Cdc20 cdh1 UbcH10 CycB\n", "0 0 0 1 0 0 0 0 0 0 0\n", "1 0 0 1 0 0 0 0 0 1 0\n", "2 0 0 1 1 0 0 0 0 1 0\n", "3 0 0 1 1 0 0 0 0 1 1\n", "4 0 0 1 1 1 0 0 0 1 1\n", "5 0 0 0 1 1 0 0 0 1 1\n", "6 0 0 0 0 1 0 0 0 1 1\n", "7 0 0 0 0 1 0 1 0 1 1\n", "8 0 0 0 0 1 0 1 0 1 0\n", "9 0 0 0 0 0 0 1 0 1 0\n", "10 0 1 0 0 0 0 1 0 1 0\n", "11 0 1 0 0 0 0 0 0 1 0\n", "12 0 1 0 0 0 1 0 0 1 0\n", "13 0 1 0 0 0 1 0 0 1 1\n", "14 0 1 0 0 0 0 0 0 1 1\n", "15 0 1 0 0 0 0 1 0 1 1\n", "16 0 1 0 0 0 0 1 0 1 0\n", "17 0 1 0 0 0 0 1 1 1 0\n", "18 0 1 0 0 0 0 0 1 1 0\n", "19 0 1 0 0 0 0 0 1 0 0\n", "20 0 1 0 0 0 1 0 1 0 0" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pd.DataFrame( [s for s in random] )" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "While bioLQM implements non-deterministic updating modes, their simulation requires a more complex engine and data structure which are beyond the scope of bioLQM: use other tools such as GINsim or (py)boolnet to perform non-deterministic simulations." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Identification of stable states (fixed points)\n", "\n", "The `biolqm.fixpoints` functions implements a constraint-solving method (based on decision diagrams) for the efficient identification of the stable states of a model without performing simulation." ] }, { "cell_type": "code", "execution_count": 7, "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", "
CycDRbE2FCycECycAp27Cdc20cdh1UbcH10CycB
00100010100
\n", "
" ], "text/plain": [ " CycD Rb E2F CycE CycA p27 Cdc20 cdh1 UbcH10 CycB\n", "0 0 1 0 0 0 1 0 1 0 0" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "fps = biolqm.fixpoints(lqm)\n", "pd.DataFrame(fps)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Identification of stable motifs (trapspaces)\n", "\n", "A stable motif (also called symbolic steady state) is a partially assigned state such that all possible successors of all states which belong to the motif also belong to the motif. Like stable states, these stable motifs can be identified efficiently using constraint-solving methods.\n", "\n", "Following this definition, all stable motifs contain at least an attractor. The stable states and the full state space are trivially identified stable motifs. Note that some stable motifs are embded inside others (in particular, they are all part of the full state space). The stable motifs which do not contain such smaller sub-motifs are called *terminal* and provide a good approximation of the attractors of the model (yet some attractors may be missed by this approximation).\n", "\n", "The `biolqm.trapspace` function computes these stable motifs. An additional argument allows to show only the terminal ones.\n", "\n", "In the output below, the non-assigned components in each motif are denoted by the joker value `254`." ] }, { "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", "
CycDRbE2FCycECycAp27Cdc20cdh1UbcH10CycB
00100010100
1102542542540254254254254
\n", "
" ], "text/plain": [ " CycD Rb E2F CycE CycA p27 Cdc20 cdh1 UbcH10 CycB\n", "0 0 1 0 0 0 1 0 1 0 0\n", "1 1 0 254 254 254 0 254 254 254 254" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "traps = biolqm.trapspace(lqm)\n", "pd.DataFrame(traps)" ] }, { "cell_type": "code", "execution_count": 9, "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", "
CycDRbE2FCycECycAp27Cdc20cdh1UbcH10CycB
00100010100
1102542542540254254254254
\n", "
" ], "text/plain": [ " CycD Rb E2F CycE CycA p27 Cdc20 cdh1 UbcH10 CycB\n", "0 0 1 0 0 0 1 0 1 0 0\n", "1 1 0 254 254 254 0 254 254 254 254" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "traps = biolqm.trapspace(lqm, \"terminal\")\n", "pd.DataFrame(traps)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Model perturbation\n", "\n", "the `biolqm.perturbation` function enables the construction of a variant of the model, where the logical function of one (or several) component has been modified. A textual parameter describes the modification:\n", "\n", "* `component%0` defines a knockout of a component\n", "* `component%1` defines an ectopic expression\n", "* `component%1:2` restricts the range of values for multi-valued components\n", "* `regulator:component%0` allows to remove a regulator\n", "\n", "In the following, we show the impact of the ectopic expression of the `CycD` component on the stable states and trapspaces on the model." ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [], "source": [ "pert = biolqm.perturbation(lqm, \"CycD%1\")" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
\n", "
" ], "text/plain": [ "Empty DataFrame\n", "Columns: []\n", "Index: []" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "fps = biolqm.fixpoints(pert)\n", "pd.DataFrame(fps)" ] }, { "cell_type": "code", "execution_count": 12, "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", "
CycDRbE2FCycECycAp27Cdc20cdh1UbcH10CycB
0102542542540254254254254
\n", "
" ], "text/plain": [ " CycD Rb E2F CycE CycA p27 Cdc20 cdh1 UbcH10 CycB\n", "0 1 0 254 254 254 0 254 254 254 254" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "traps = biolqm.trapspace(pert, \"terminal\")\n", "pd.DataFrame(traps)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Multiple perturbations are comma-separated. Here we show the effect of the ectopic expression of both `CycD` and `Rb`." ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [], "source": [ "pert = biolqm.perturbation(lqm, \"CycD%1 Rb%1\")" ] }, { "cell_type": "code", "execution_count": 14, "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", "
CycDRbE2FCycECycAp27Cdc20cdh1UbcH10CycB
01100000100
\n", "
" ], "text/plain": [ " CycD Rb E2F CycE CycA p27 Cdc20 cdh1 UbcH10 CycB\n", "0 1 1 0 0 0 0 0 1 0 0" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "fps = biolqm.fixpoints(pert)\n", "pd.DataFrame(fps)" ] }, { "cell_type": "code", "execution_count": 15, "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", "
CycDRbE2FCycECycAp27Cdc20cdh1UbcH10CycB
01100000100
\n", "
" ], "text/plain": [ " CycD Rb E2F CycE CycA p27 Cdc20 cdh1 UbcH10 CycB\n", "0 1 1 0 0 0 0 0 1 0 0" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "traps = biolqm.trapspace(pert, \"terminal\")\n", "pd.DataFrame(traps)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Export to other tools" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "- PyBoolNet:" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'Cdc20': [[{'CycB': 0}], [{'CycB': 1}]],\n", " 'CycA': [[{'UbcH10': 1, 'cdh1': 1},\n", " {'CycA': 0, 'E2F': 0},\n", " {'Rb': 1},\n", " {'Cdc20': 1}],\n", " [{'Cdc20': 0, 'E2F': 1, 'Rb': 0, 'cdh1': 0},\n", " {'Cdc20': 0, 'E2F': 1, 'Rb': 0, 'UbcH10': 0},\n", " {'Cdc20': 0, 'CycA': 1, 'Rb': 0, 'cdh1': 0},\n", " {'Cdc20': 0, 'CycA': 1, 'Rb': 0, 'UbcH10': 0}]],\n", " 'CycB': [[{'cdh1': 1}, {'Cdc20': 1}], [{'Cdc20': 0, 'cdh1': 0}]],\n", " 'CycD': [[{'CycD': 0}], [{'CycD': 1}]],\n", " 'CycE': [[{'Rb': 1}, {'E2F': 0}], [{'E2F': 1, 'Rb': 0}]],\n", " 'E2F': [[{'CycA': 1, 'p27': 0}, {'Rb': 1}, {'CycB': 1}],\n", " [{'CycB': 0, 'Rb': 0, 'p27': 1}, {'CycA': 0, 'CycB': 0, 'Rb': 0}]],\n", " 'Rb': [[{'CycE': 1, 'p27': 0},\n", " {'CycA': 1, 'p27': 0},\n", " {'CycD': 1},\n", " {'CycB': 1}],\n", " [{'CycA': 0, 'CycB': 0, 'CycD': 0, 'CycE': 0},\n", " {'CycB': 0, 'CycD': 0, 'p27': 1}]],\n", " 'UbcH10': [[{'Cdc20': 0, 'CycA': 0, 'CycB': 0, 'cdh1': 1},\n", " {'UbcH10': 0, 'cdh1': 1}],\n", " [{'CycB': 1, 'UbcH10': 1},\n", " {'CycA': 1, 'UbcH10': 1},\n", " {'Cdc20': 1, 'UbcH10': 1},\n", " {'cdh1': 0}]],\n", " 'cdh1': [[{'Cdc20': 0, 'CycA': 1, 'p27': 0}, {'Cdc20': 0, 'CycB': 1}],\n", " [{'CycB': 0, 'p27': 1}, {'CycA': 0, 'CycB': 0}, {'Cdc20': 1}]],\n", " 'p27': [[{'CycE': 1, 'p27': 0},\n", " {'CycA': 1, 'p27': 0},\n", " {'CycA': 1, 'CycE': 1},\n", " {'CycD': 1},\n", " {'CycB': 1}],\n", " [{'CycB': 0, 'CycD': 0, 'CycE': 0, 'p27': 1},\n", " {'CycA': 0, 'CycB': 0, 'CycD': 0, 'p27': 1},\n", " {'CycA': 0, 'CycB': 0, 'CycD': 0, 'CycE': 0}]]}" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "b = biolqm.to_pyboolnet(lqm)\n", "b" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "- Pint:" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "an = biolqm.to_pint(lqm)\n", "an" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "- MaBoSS:" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "n = biolqm.to_maboss(lqm)\n", "n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "- minibn:" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Cdc20 <- CycB\n", "CycA <- (!Cdc20&CycA&!Rb&!UbcH10)|(!Cdc20&CycA&!Rb&!cdh1)|(!Cdc20&E2F&!Rb&!UbcH10)|(!Cdc20&E2F&!Rb&!cdh1)\n", "CycB <- !Cdc20&!cdh1\n", "CycD <- CycD\n", "CycE <- E2F&!Rb\n", "E2F <- (!CycA&!CycB&!Rb)|(!CycB&!Rb&p27)\n", "Rb <- (!CycA&!CycB&!CycD&!CycE)|(!CycB&!CycD&p27)\n", "UbcH10 <- !cdh1|(Cdc20&UbcH10)|(CycA&UbcH10)|(CycB&UbcH10)\n", "cdh1 <- Cdc20|(!CycA&!CycB)|(!CycB&p27)\n", "p27 <- (!CycA&!CycB&!CycD&!CycE)|(!CycA&!CycB&!CycD&p27)|(!CycB&!CycD&!CycE&p27)" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "f = biolqm.to_minibn(lqm)\n", "f" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "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.11.8" } }, "nbformat": 4, "nbformat_minor": 4 }