{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import biolqm\n", "import ginsim" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Small model" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ "Downloading http://ginsim.org/sites/default/files/phageLambda4.zginml" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "lqm = biolqm.load(\"http://ginsim.org/sites/default/files/phageLambda4.zginml\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "By default, the layout is performed with `neato`:" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "scrolled": false }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "lrg = biolqm.to_ginsim(lqm)\n", "ginsim.show(lrg)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The layout can be modified with `biolqm.autolayout`, using the `method` parameter. The methods are the one supported by [GraphViz](https://www.graphviz.org/documentation/), which include `dot`, `neato`, `circo`, `fdp`, `twopi`, `pathwork`, `osage`, and `sfdp` (for large graphs).\n", "Scaling can be adjusted with the `scale` parameter." ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "scrolled": false }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "biolqm.autolayout(lqm, method=\"patchwork\")\n", "lrg = biolqm.to_ginsim(lqm)\n", "ginsim.show(lrg)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The layout can also be specifed at the (first) call to `to_ginsim` with the `layout_method` parameter:" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ "Downloading http://ginsim.org/sites/default/files/phageLambda4.zginml" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "lqm = biolqm.load(\"http://ginsim.org/sites/default/files/phageLambda4.zginml\")\n", "lrg = biolqm.to_ginsim(lqm, layout_method=\"circo\")\n", "ginsim.show(lrg)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Medium size models" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ "Downloading http://ginsim.org/sites/default/files/SuppMat_Model_Master_Model.zginml" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "lqm2 = biolqm.load(\"http://ginsim.org/sites/default/files/SuppMat_Model_Master_Model.zginml\")\n", "lrg = biolqm.to_ginsim(lqm2)\n", "ginsim.show(lrg)" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "biolqm.autolayout(lqm2, method=\"patchwork\")\n", "lrg = biolqm.to_ginsim(lqm2)\n", "ginsim.show(lrg)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Large models" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "tags": [ "cellcollective" ] }, "outputs": [ { "data": { "text/markdown": [ "Downloading http://api.cellcollective.org/model/export/2171?type=SBML" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "lqm3 = biolqm.load(\"https://research.cellcollective.org/?dashboard=true#2171:1/t-cell-receptor-signaling/1\")\n", "lqm3 = biolqm.sanitize(lqm3)\n", "lrg = biolqm.to_ginsim(lqm3, layout_scale=0.55)\n", "ginsim.show(lrg)" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "tags": [ "cellcollective" ] }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "biolqm.autolayout(lqm3, method=\"patchwork\")\n", "lrg = biolqm.to_ginsim(lqm3)\n", "ginsim.show(lrg)" ] }, { "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 }