{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "#Tracing regulatory routes in metabolism using generalised supply-demand analysis\n", "\n", "In this notebook the results shown in the manuscript are recreated using the Python Simulator for Cellular Systems and (`PySCeS`) its add-on package `PySCeSToolbox`. \n", "\n", "###Instructions\n", "\n", "The first time `PySCeS` is imported it creates a directory `~/Pysces`. This is the `PySCeS` working directory. Within this directory is a subdirectory `~/Pysces/psc` in which model files are stored by default.\n", "\n", "In this notebook we make the assumption that the models `Hoefnagel_moiety_ratio.psc` and `Curien.psc` located in the `psc` directory. If this is the first time using `PySCeS` then run the next cell and move the models to the newly created `psc` subdirectory of the `~/Pysces` directory. \n", "\n", "Cells can be run using the command under the `Cell` menu above or by pressing `Shift + Enter` while a desired cell is selected. After the models are in the `psc` directory the `Run All` option can be selected.\n", "\n", "A running kernel is indicated by `In [*]:` left of the executed cell and a filled circle next to `Python 2` in the top right-hand corner. Wait for the computation to complete (the asterisk will disappear and the circle will change to an open circle)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "####Importing the packages" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "%matplotlib inline\n", "import pysces #Python Simulator for Cellular Systems\n", "import psctb #PySCeSToolbox\n", "import numpy" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Now move the files `Hoefnagel_moiety_ratio.psc`, `Curien.psc` and `Curien_combined_blocks.psc` to `~/Pysces/psc`**\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##Pyruvate branch model\n", "\n", "####Loading the model" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "hoefnagel_model = pysces.model('Hoefnagel_moiety_ratio')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "####Creating GSDA analysis object with RateChar" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "hoefnagel_gsda = psctb.RateChar(hoefnagel_model)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "####Performing parameter scans of $\\phi_A$ and $\\phi_N$" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "hoefnagel_gsda.do_ratechar(fixed='R_A', #variable to fix and scan\n", " scan_min=0.06, #minimum scan point value\n", " scan_max=457.51, #maximum scan point value\n", " scan_points=256) #number of scan points (samples)\n", "\n", "hoefnagel_gsda.do_ratechar(fixed='R_N', #variable to fix and scan\n", " scan_min=0.0002, #minimum scan point value\n", " scan_max=1.77, #maximum scan point value\n", " scan_points=256) #number of scan points (samples)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "####Visualising results for $\\phi_A$ " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#####Figure 4A" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "Figure_4_A = hoefnagel_gsda.R_A.plot()\n", "\n", "Figure_4_A.toggle_category('Supply', True)\n", "Figure_4_A.toggle_category('Total Supply', True)\n", "Figure_4_A.toggle_category('Demand', True)\n", "Figure_4_A.toggle_category('Fluxes', True)\n", "Figure_4_A.toggle_category('J_v_1', True)\n", "Figure_4_A.toggle_category('J_v_5', True)\n", "Figure_4_A.toggle_category('J_v_12', True)\n", "\n", "Figure_4_A.interact()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#####Figure 4B" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "Figure_4_B = hoefnagel_gsda.R_A.plot()\n", "\n", "Figure_4_B.toggle_category('Supply', True)\n", "Figure_4_B.toggle_category('Demand', True)\n", "Figure_4_B.toggle_category('Fluxes', True)\n", "Figure_4_B.toggle_category('Response Coefficients', True)\n", "Figure_4_B.toggle_category('Partial Response Coefficients', True)\n", "Figure_4_B.toggle_category('J_v_5', True)\n", "\n", "Figure_4_B.toggle_line('prcJv_5_R_A_v_12', False)\n", "\n", "Figure_4_B.ax.set_xlim([2.5,10])\n", "Figure_4_B.ax.set_ylim([6,12])\n", "\n", "Figure_4_B.interact()" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "#####Figure 5" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false, "scrolled": true }, "outputs": [], "source": [ "R_A_prc_scan, _ = hoefnagel_gsda.R_A.do_mca_scan()" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "Figure_5 = R_A_prc_scan.plot()\n", "\n", "Figure_5.toggle_category('Response Coefficients', True)\n", "Figure_5.toggle_category('Partial Response Coefficients', True)\n", "Figure_5.toggle_category('rcJv_5_R_A', True)\n", "Figure_5.toggle_category('prcJv_5_R_A_v_5', True)\n", "Figure_5.toggle_category('prcJv_5_R_A_v_1', True)\n", "\n", "Figure_5.ax.set_ylim([-1,1])\n", "\n", "Figure_5.interact()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "####Visualising results for $\\phi_N$ " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#####Figure 6A" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "Figure_6_A = hoefnagel_gsda.R_N.plot()\n", "\n", "Figure_6_A.toggle_category('Supply', True)\n", "Figure_6_A.toggle_category('Demand', True)\n", "Figure_6_A.toggle_category('Total Supply', True)\n", "Figure_6_A.toggle_category('Total Demand', True)\n", "Figure_6_A.toggle_category('Fluxes', True)\n", "Figure_6_A.toggle_category('J_v_1', True)\n", "Figure_6_A.toggle_category('J_v_2', True)\n", "Figure_6_A.toggle_category('J_v_3', True)\n", "Figure_6_A.toggle_category('J_v_6', True)\n", "Figure_6_A.toggle_category('J_v_11', True)\n", "Figure_6_A.toggle_category('J_v_13', True)\n", "\n", "Figure_6_A.interact()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#####Figure 6B" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "Figure_6_B = hoefnagel_gsda.R_N.plot()\n", "\n", "Figure_6_B.toggle_category('Supply', True)\n", "Figure_6_B.toggle_category('Demand', True)\n", "Figure_6_B.toggle_category('Fluxes', True)\n", "Figure_6_B.toggle_category('Response Coefficients', True)\n", "Figure_6_B.toggle_category('Partial Response Coefficients', True)\n", "Figure_6_B.toggle_category('J_v_6', True)\n", "\n", "Figure_6_B.toggle_line('prcJv_6_R_N_v_11', False)\n", "Figure_6_B.toggle_line('prcJv_6_R_N_v_13', False)\n", "\n", "Figure_6_B.ax.set_xlim([0.01,0.04])\n", "Figure_6_B.ax.set_ylim([0.9,2.1])\n", "\n", "Figure_6_B.interact()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#####Figure 7" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "R_N_prc_scan, R_N_ec_cc_scan = hoefnagel_gsda.R_N.do_mca_scan()" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "Figure_7 = R_N_prc_scan.plot()\n", "\n", "Figure_7.toggle_category('Response Coefficients', True)\n", "Figure_7.toggle_category('Partial Response Coefficients', True)\n", "Figure_7.toggle_category('rcJv_6_R_N', True)\n", "Figure_7.toggle_category('prcJv_6_R_N_v_2', True)\n", "Figure_7.toggle_category('prcJv_6_R_N_v_6', True)\n", "Figure_7.toggle_category('prcJv_6_R_N_v_7', True)\n", "Figure_7.toggle_category('prcJv_6_R_N_v_3', True)\n", "Figure_7.toggle_category('prcJv_6_R_N_v_1', True)\n", "\n", "Figure_7.ax.set_ylim([-2,2])\n", "\n", "Figure_7.interact()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#####Figure 8" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "Figure_8 = R_N_ec_cc_scan.plot()\n", "\n", "Figure_8.toggle_category('Elasticity Coefficients', True)\n", "Figure_8.toggle_category('Control Coefficients', True)\n", "Figure_8.toggle_category('ccJv_6_v_7', True)\n", "Figure_8.toggle_category('ccJv_6_v_6', True)\n", "Figure_8.toggle_category('ccJv_6_v_3', True)\n", "Figure_8.toggle_category('ecv_7_R_N', True)\n", "Figure_8.toggle_category('ecv_6_R_N', True)\n", "Figure_8.toggle_category('ecv_3_R_N', True)\n", "\n", "Figure_8.ax.set_ylim([-2,3])\n", "\n", "Figure_8.interact()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##Aspartate derived amino acid synthesis model\n", "\n", "####Loading the model" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "curien_model = pysces.model('Curien')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "####Creating GSDA analysis object with RateChar" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "curien_gsda = psctb.RateChar(curien_model)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "####Performing parameter scans of ASA, Thr and Lys" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "curien_gsda.do_ratechar(fixed='ASA', #variable to fix and scan\n", " scan_min=0.024, #minimum scan point value\n", " scan_max=32.97, #maximum scan point value\n", " scan_points=256) #number of scan points (samples)\n", "\n", "curien_gsda.do_ratechar(fixed='Thr', #variable to fix and scan\n", " scan_min=19.80, #minimum scan point value\n", " scan_max=4453.93, #maximum scan point value\n", " scan_points=256) #number of scan points (samples)\n", "\n", "curien_gsda.do_ratechar(fixed='Lys', #variable to fix and scan\n", " scan_min=4.61, #minimum scan point value\n", " scan_max=1037.38, #maximum scan point value\n", " scan_points=256) #number of scan points (samples) " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "####Visualising results for ASA " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#####Figure 9A" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "Figure_9_A = curien_gsda.ASA.plot()\n", "\n", "Figure_9_A.toggle_category('Supply', True)\n", "Figure_9_A.toggle_category('Demand', True)\n", "Figure_9_A.toggle_category('Fluxes', True)\n", "Figure_9_A.toggle_category('Total Demand', True)\n", "Figure_9_A.toggle_category('J_v_5', True)\n", "Figure_9_A.toggle_category('J_v_6', True)\n", "Figure_9_A.toggle_category('J_v_7', True)\n", "Figure_9_A.toggle_category('J_v_14', True)\n", "Figure_9_A.toggle_category('J_v_15', True)\n", "\n", "Figure_9_A.interact()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#####Figure 9B" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "Figure_9_B = curien_gsda.ASA.plot()\n", "\n", "Figure_9_B.toggle_category('Supply', True)\n", "Figure_9_B.toggle_category('Demand', True)\n", "Figure_9_B.toggle_category('Fluxes', True)\n", "Figure_9_B.toggle_category('Total Demand', True)\n", "Figure_9_B.toggle_category('Response Coefficients', True)\n", "Figure_9_B.toggle_category('Partial Response Coefficients', True)\n", "Figure_9_B.toggle_category('J_v_5', True)\n", "\n", "Figure_9_B.ax.set_xlim([0.7,1.3])\n", "Figure_9_B.ax.set_ylim([0.9,1.2])\n", "\n", "Figure_9_B.interact()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "####Visualising results for Thr" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#####Figure 10A" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "Figure_10_A = curien_gsda.Thr.plot()\n", "\n", "Figure_10_A.toggle_category('Supply', True)\n", "Figure_10_A.toggle_category('Demand', True)\n", "Figure_10_A.toggle_category('Total Demand', True)\n", "Figure_10_A.toggle_category('Fluxes', True)\n", "Figure_10_A.toggle_category('J_v_9', True)\n", "Figure_10_A.toggle_category('J_v_10', True)\n", "Figure_10_A.toggle_category('J_v_11', True)\n", "\n", "Figure_10_A.interact()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#####Figure 10B" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "Figure_10_B = curien_gsda.Thr.plot()\n", "\n", "Figure_10_B.toggle_category('Supply', True)\n", "Figure_10_B.toggle_category('Demand', True)\n", "Figure_10_B.toggle_category('Fluxes', True)\n", "Figure_10_B.toggle_category('Response Coefficients', True)\n", "Figure_10_B.toggle_category('Partial Response Coefficients', True)\n", "Figure_10_B.toggle_category('J_v_9', True)\n", "\n", "Figure_10_B.toggle_line('prcJv_9_Thr_v_11', False)\n", "Figure_10_B.toggle_line('prcJv_9_Thr_v_10', False)\n", "Figure_10_B.toggle_line('prcJv_9_Thr_v_9', False)\n", "\n", "Figure_10_B.ax.set_xlim([235,365])\n", "Figure_10_B.ax.set_ylim([0.6,0.7])\n", "\n", "Figure_10_B.interact()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "####Visualising results for Lys " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#####Figure 11" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "Figure_11 = curien_gsda.Lys.plot()\n", "\n", "Figure_11.toggle_category('Supply', True)\n", "Figure_11.toggle_category('Total Supply', True)\n", "Figure_11.toggle_category('Demand', True)\n", "Figure_11.toggle_category('Fluxes', True)\n", "Figure_11.toggle_category('J_v_15', True)\n", "Figure_11.toggle_category('J_v_16', True)\n", "Figure_11.toggle_category('J_v_14', True)\n", "\n", "Figure_11.ax.set_ylim([0.01,5])\n", "\n", "Figure_11.interact()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#####Figure 12A" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "Figure_12_A = curien_gsda.Lys.plot()\n", "\n", "Figure_12_A.toggle_category('Supply', True)\n", "Figure_12_A.toggle_category('Demand', True)\n", "Figure_12_A.toggle_category('Fluxes', True)\n", "Figure_12_A.toggle_category('Response Coefficients', True)\n", "Figure_12_A.toggle_category('Partial Response Coefficients', True)\n", "Figure_12_A.toggle_category('J_v_14', True)\n", "\n", "Figure_12_A.toggle_line('prcJv_14_Lys_v_16', False)\n", "\n", "Figure_12_A.ax.set_xlim([55,85])\n", "Figure_12_A.ax.set_ylim([0.020,0.050])\n", "\n", "Figure_12_A.interact()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#####Figure 12B" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "Figure_12_B = curien_gsda.Lys.plot()\n", "Figure_12_B.toggle_category('Supply', True)\n", "Figure_12_B.toggle_category('Demand', True)\n", "Figure_12_B.toggle_category('Total Supply', True)\n", "Figure_12_B.toggle_category('Total Demand', True)\n", "Figure_12_B.toggle_category('Fluxes', True)\n", "Figure_12_B.toggle_category('Response Coefficients', True)\n", "Figure_12_B.toggle_category('Partial Response Coefficients', True)\n", "Figure_12_B.toggle_category('J_v_15', True)\n", "\n", "Figure_12_B.toggle_line('prcJv_15_Lys_v_16', False)\n", "\n", "Figure_12_B.ax.set_xlim([55,85])\n", "Figure_12_B.ax.set_ylim([0.18,0.45])\n", "\n", "Figure_12_B.interact()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "####Generation of data for figure 13\n", "#####Function to generate results" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "def draw_figure_13_table(curien_gsda):\n", " prop_5 = curien_gsda.ASA.mca_results.prcJv_5_ASA_v_5 / curien_gsda.ASA.mca_results.rcJv_5_ASA\n", " prop_6 = curien_gsda.ASA.mca_results.prcJv_5_ASA_v_6 / curien_gsda.ASA.mca_results.rcJv_5_ASA\n", " prop_7 = curien_gsda.ASA.mca_results.prcJv_5_ASA_v_7 / curien_gsda.ASA.mca_results.rcJv_5_ASA\n", " prop_14 = curien_gsda.ASA.mca_results.prcJv_5_ASA_v_14 / curien_gsda.ASA.mca_results.rcJv_5_ASA\n", " prop_15 = curien_gsda.ASA.mca_results.prcJv_5_ASA_v_15 / curien_gsda.ASA.mca_results.rcJv_5_ASA\n", "\n", " prop_1 = (curien_gsda.ASA.mca_results.prcJv_5_ASA_v_6 + \\\n", " curien_gsda.ASA.mca_results.prcJv_5_ASA_v_7) / \\\n", " curien_gsda.ASA.mca_results.rcJv_5_ASA * \\\n", " curien_gsda.Thr.mca_results.prcJv_9_Thr_v_1 / \\\n", " (curien_gsda.Thr.mca_results.prcJv_9_Thr_v_2 + \\\n", " curien_gsda.Thr.mca_results.prcJv_9_Thr_v_1)\n", "\n", " prop_2 = (curien_gsda.ASA.mca_results.prcJv_5_ASA_v_6 + \\\n", " curien_gsda.ASA.mca_results.prcJv_5_ASA_v_7) / \\\n", " curien_gsda.ASA.mca_results.rcJv_5_ASA * \\\n", " curien_gsda.Thr.mca_results.prcJv_9_Thr_v_2 / \\\n", " (curien_gsda.Thr.mca_results.prcJv_9_Thr_v_2 + \\\n", " curien_gsda.Thr.mca_results.prcJv_9_Thr_v_1)\n", "\n", " prop_4 = (curien_gsda.ASA.mca_results.prcJv_5_ASA_v_14 + \\\n", " curien_gsda.ASA.mca_results.prcJv_5_ASA_v_15) / \\\n", " curien_gsda.ASA.mca_results.rcJv_5_ASA * \\\n", " curien_gsda.Lys.mca_results.prcJv_14_Lys_v_4 / \\\n", " (curien_gsda.Lys.mca_results.prcJv_14_Lys_v_3 + \\\n", " curien_gsda.Lys.mca_results.prcJv_14_Lys_v_4)\n", "\n", " prop_3 = (curien_gsda.ASA.mca_results.prcJv_5_ASA_v_14 + \\\n", " curien_gsda.ASA.mca_results.prcJv_5_ASA_v_15) / \\\n", " curien_gsda.ASA.mca_results.rcJv_5_ASA * \\\n", " curien_gsda.Lys.mca_results.prcJv_14_Lys_v_3 / \\\n", " (curien_gsda.Lys.mca_results.prcJv_14_Lys_v_3 + \\\n", " curien_gsda.Lys.mca_results.prcJv_14_Lys_v_4)\n", "\n", " prop_1_6 = prop_1 * prop_6 / (prop_7 + prop_6)\n", " prop_1_7 = prop_1 * prop_7 / (prop_7 + prop_6)\n", " prop_2_6 = prop_2 * prop_6 / (prop_7 + prop_6)\n", " prop_2_7 = prop_2 * prop_7 / (prop_7 + prop_6)\n", " prop_4_14 = prop_4 * prop_14 / (prop_14 + prop_15)\n", " prop_4_15 = prop_4 * prop_15 / (prop_14 + prop_15)\n", " prop_3_14 = prop_3 * prop_14 / (prop_14 + prop_15)\n", " prop_3_15 = prop_3 * prop_15 / (prop_14 + prop_15)\n", "\n", " row_1 = ['v1',prop_1 ,'' ,'' ,'v4' ,prop_4]\n", " row_2 = ['' ,'6 via 1' ,'7 via 1' ,'15 via 4' ,'14 via 4','' ]\n", " row_3 = ['' ,prop_1_6 ,prop_1_7 ,prop_4_15 ,prop_4_14 ,'' ]\n", " row_4 = ['v2',prop_2 ,'' ,'' ,'v3' ,prop_3]\n", " row_5 = ['' ,'6 via 2' ,'7 via 2' ,'15 via 3' ,'14 via 3','' ]\n", " row_6 = ['' ,prop_2_6 ,prop_2_7 ,prop_3_15 ,prop_3_14 ,'' ]\n", " row_7 = ['' ,'' ,'v5' ,'' ,'' ,'' ]\n", " row_8 = ['' ,'' ,prop_5 ,'' ,'' ,'' ]\n", " row_9 = ['' ,'' ,'' ,'v14' ,prop_14 ,'' ]\n", " row_10 = ['' ,'v6' ,'v7' ,'v15' ,prop_15 ,'' ]\n", " row_11 = ['' ,prop_6 ,prop_7 ,'' ,'' ,'' ]\n", " rows = [row_1,row_2,row_3,row_4,row_5,row_6,row_7,row_8,row_9,row_10,row_11]\n", "\n", " for row in rows:\n", " for i,col in enumerate(row):\n", " if type(col) != str:\n", " row[i] = col*100\n", " return rows\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#####Results for Figure13A" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "fig_13_A = draw_figure_13_table(curien_gsda)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#####Results for Figure13B" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "curien_model_AKI_knock = pysces.model('Curien')\n", "curien_model_AKI_knock.AKI = 0.00000000000000000000000000001\n", "curien_gsda_AKI_knock = psctb.RateChar(curien_model_AKI_knock)\n", "curien_gsda_AKI_knock.do_ratechar(scan_points = 2)\n", "\n", "fig_13_B = draw_figure_13_table(curien_gsda_AKI_knock)\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#####Results for Figure13C" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "curien_model_AKII_knock = pysces.model('Curien')\n", "curien_model_AKII_knock.AKII = 0.00000000000000000000000000001\n", "curien_gsda_AKII_knock = psctb.RateChar(curien_model_AKII_knock)\n", "curien_gsda_AKII_knock.do_ratechar(scan_points = 2)\n", "\n", "fig_13_C = draw_figure_13_table(curien_gsda_AKII_knock)\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#####Results for double knockout " ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "curien_model_double_knock = pysces.model('Curien')\n", "curien_model_double_knock.AKI = 0.00000000000000000000000000001\n", "curien_model_double_knock.AKII = 0.00000000000000000000000000001\n", "curien_gsda_double_knock = psctb.RateChar(curien_model_double_knock)\n", "curien_gsda_double_knock.do_ratechar(scan_points = 2)\n", "\n", "fig_13_Add = draw_figure_13_table(curien_gsda_double_knock)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "####Visualising Figure 13\n", "\n", "These (rather crude) tables are meant to replicate the layout of the pathways in Figure 13 of the manuscript (which were partially drawn by hand). Values represent the percentage regulation of ASA supply by ASA via a specific reaction route. Labels in the table refer either to values to their right or to values below them (e.g. v1 refers to 11.61 and 6 via 1 refers to 5.37)." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "psctb.utils.misc.html_table(fig_13_A)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "psctb.utils.misc.html_table(fig_13_B)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "psctb.utils.misc.html_table(fig_13_C)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "psctb.utils.misc.html_table(fig_13_Add)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "####Table 3 " ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "def gen_col(gsda):\n", " r1 = gsda.ASA.mod.rc.v_5_ASA\n", " r2 = gsda.ASA.mod.rc.v_8_ASA\n", " r3 = gsda.ASA.mod.rc.v_16_ASA\n", " r4 = numpy.abs(r1 / r2)\n", " r5 = numpy.abs(r1 / r3)\n", " col = [r1,r2,r3,r4,r5]\n", " return col\n", "\n", "col1 = gen_col(curien_gsda)\n", "col2 = gen_col(curien_gsda_AKI_knock)\n", "col3 = gen_col(curien_gsda_AKII_knock)\n", "col4 = gen_col(curien_gsda_double_knock)\n", "tab = [col1,col2,col3,col4]\n", "\n", "rows =['$R^{Jv5}_{ASA}$',\n", " '$R^{Jv8}_{ASA}$',\n", " '$R^{Jv16}_{ASA}$',\n", " '$|R^{Jv5}_{ASA}/R^{Jv8}_{ASA}|$',\n", " '$|R^{Jv5}_{ASA}/R^{Jv16}_{ASA}|$']\n", "\n", "tab2 = [['','Reference','AKI Knockout','AKII Knockout', 'AKI, AKII Knockout']]\n", "\n", "for i,each in enumerate(list(numpy.array(tab).transpose())):\n", " tab2.append([rows[i]] + list(each))\n", " \n", "psctb.utils.misc.html_table(tab2,)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "####Table S1" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "ltxe = psctb.latextools.LatexExpr(curien_model)\n", "exl = ltxe.expression_to_latex\n", "mca = curien_gsda.ASA.mca_results\n", "mct = curien_gsda.Thr.mca_results\n", "mcl = curien_gsda.Lys.mca_results\n", "\n", "\n", "adtab1=[['ElasticityCoefficient','','Controlcoefficient','','Partialresponsecoefficient',''],\n", "['$%s$'%exl('ecv_5_ASA'),mca['ecv_5_ASA'],'$%s$'%exl('ccJv_5_v_5'),mca['ccJv_5_v_5'],'$%s$'%exl('prcJv_5_ASA_v_5'),mca['prcJv_5_ASA_v_5']],\n", "['$%s$'%exl('ecv_6_ASA'),mca['ecv_6_ASA'],'$%s$'%exl('ccJv_5_v_6'),mca['ccJv_5_v_6'],'$%s$'%exl('prcJv_5_ASA_v_6'),mca['prcJv_5_ASA_v_6']],\n", "['$%s$'%exl('ecv_7_ASA'),mca['ecv_7_ASA'],'$%s$'%exl('ccJv_5_v_7'),mca['ccJv_5_v_7'],'$%s$'%exl('prcJv_5_ASA_v_7'),mca['prcJv_5_ASA_v_7']],\n", "['$%s$'%exl('ecv_15_ASA'),mca['ecv_15_ASA'],'$%s$'%exl('ccJv_5_v_15'),mca['ccJv_5_v_15'],'$%s$'%exl('prcJv_5_ASA_v_15'),mca['prcJv_5_ASA_v_15']],\n", "['$%s$'%exl('ecv_14_ASA'),mca['ecv_14_ASA'],'$%s$'%exl('ccJv_5_v_14'),mca['ccJv_5_v_14'],'$%s$'%exl('prcJv_5_ASA_v_14'),mca['prcJv_5_ASA_v_14']],\n", "['$~$','','','','',''],\n", "['$%s$'%exl('ecv_1_Thr'),mct['ecv_1_Thr'],'$%s$'%exl('ccJv_9_v_1'),mct['ccJv_9_v_1'],'$%s$'%exl('prcJv_9_Thr_v_1'),mct['prcJv_9_Thr_v_1']],\n", "['$%s$'%exl('ecv_2_Thr'),mct['ecv_2_Thr'],'$%s$'%exl('ccJv_9_v_2'),mct['ccJv_9_v_2'],'$%s$'%exl('prcJv_9_Thr_v_2'),mct['prcJv_9_Thr_v_2']],\n", "['$%s$'%exl('ecv_6_Thr'),mct['ecv_6_Thr'],'$%s$'%exl('ccJv_9_v_6'),mct['ccJv_9_v_6'],'$%s$'%exl('prcJv_9_Thr_v_6'),mct['prcJv_9_Thr_v_6']],\n", "['$%s$'%exl('ecv_7_Thr'),mct['ecv_7_Thr'],'$%s$'%exl('ccJv_9_v_7'),mct['ccJv_9_v_7'],'$%s$'%exl('prcJv_9_Thr_v_7'),mct['prcJv_9_Thr_v_7']],\n", "['$~$','','','','',''],\n", "['$%s$'%exl('ecv_3_Lys'),mcl['ecv_3_Lys'],'$%s$'%exl('ccJv_14_v_3'),mcl['ccJv_14_v_3'],'$%s$'%exl('prcJv_14_Lys_v_3'),mcl['prcJv_14_Lys_v_3']],\n", "['$%s$'%exl('ecv_4_Lys'),mcl['ecv_4_Lys'],'$%s$'%exl('ccJv_14_v_4'),mcl['ccJv_14_v_4'],'$%s$'%exl('prcJv_14_Lys_v_4'),mcl['prcJv_14_Lys_v_4']],\n", "['$%s$'%exl('ecv_15_Lys'),mcl['ecv_15_Lys'],'$%s$'%exl('ccJv_14_v_15'),mcl['ccJv_14_v_15'],'$%s$'%exl('prcJv_14_Lys_v_15'),mcl['prcJv_14_Lys_v_15']],\n", "['$%s$'%exl('ecv_14_Lys'),mcl['ecv_14_Lys'],'$%s$'%exl('ccJv_14_v_14'),mcl['ccJv_14_v_14'],'$%s$'%exl('prcJv_14_Lys_v_14'),mcl['prcJv_14_Lys_v_14']],\n", "['$~$','','','','',''],\n", "['$%s$'%exl('ecv_3_Lys'),mcl['ecv_3_Lys'],'$%s$'%exl('ccJv_15_v_3'),mcl['ccJv_15_v_3'],'$%s$'%exl('prcJv_15_Lys_v_3'),mcl['prcJv_15_Lys_v_3']],\n", "['$%s$'%exl('ecv_4_Lys'),mcl['ecv_4_Lys'],'$%s$'%exl('ccJv_15_v_4'),mcl['ccJv_15_v_4'],'$%s$'%exl('prcJv_15_Lys_v_4'),mcl['prcJv_15_Lys_v_4']],\n", "['$%s$'%exl('ecv_15_Lys'),mcl['ecv_15_Lys'],'$%s$'%exl('ccJv_15_v_15'),mcl['ccJv_15_v_15'],'$%s$'%exl('prcJv_15_Lys_v_15'),mcl['prcJv_15_Lys_v_15']],\n", "['$%s$'%exl('ecv_14_Lys'),mcl['ecv_14_Lys'],'$%s$'%exl('ccJv_15_v_14'),mcl['ccJv_15_v_14'],'$%s$'%exl('prcJv_15_Lys_v_14'),mcl['prcJv_15_Lys_v_14']]]\n", " " ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "psctb.utils.misc.html_table(adtab1,float_fmt='%.3f')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "####Table S2" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "def gen_col(gsda):\n", " r1 = gsda.ASA.mod.ASA\n", " r2 = gsda.ASA.mod.Lys\n", " r3 = gsda.ASA.mod.Thr\n", " r4 = gsda.ASA.mod.J_v_1\n", " r5 = gsda.ASA.mod.J_v_2\n", " r6 = gsda.ASA.mod.J_v_3\n", " r7 = gsda.ASA.mod.J_v_4\n", " r8 = gsda.ASA.mod.J_v_5\n", " r9 = gsda.ASA.mod.J_v_6\n", " r10 = gsda.ASA.mod.J_v_7\n", " r11 = gsda.ASA.mod.J_v_14\n", " r12 = gsda.ASA.mod.J_v_15\n", "\n", " col = [r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,]\n", " return col\n", "\n", "col1 = gen_col(curien_gsda)\n", "col2 = gen_col(curien_gsda_AKI_knock)\n", "col3 = gen_col(curien_gsda_AKII_knock)\n", "col4 = gen_col(curien_gsda_double_knock)\n", "tab = [col1,col2,col3,col4]\n", "\n", "rows =['ASA',\n", "'Lys',\n", "'Thr',\n", "'$J_{1}$',\n", "'$J_{2}$',\n", "'$J_{3}$',\n", "'$J_{4}$',\n", "'$J_{5}$',\n", "'$J_{6}$',\n", "'$J_{7}$',\n", "'$J_{14}$',\n", "'$J_{15}$',]\n", "tab2 = [['','Reference','AKI Knockout','AKII Knockout', 'AKI, AKII Knockout']]\n", "\n", "for i,each in enumerate(list(numpy.array(tab).transpose())):\n", " tab2.append([rows[i]] + list(each))\n", " \n", "psctb.utils.misc.html_table(tab2,float_fmt='%.3f')" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.6" } }, "nbformat": 4, "nbformat_minor": 0 }