{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Elasticities\n", "\n", "In some cases we might be interested in testing certain intervention strategies on our models. In general we will be most intested in what is the consequence for the environment, meaning what happens with the exchange reactions in the model. Here, `micom` allows you to respond two kind of questions:\n", "\n", "1. What impact does changing a bacterial abundance have on the exchanges?\n", "2. What impact does changing the exchnage bounds (ergo diet) have on the exchanges?\n", "\n", "For that we use the concept of *elasticity coefficients* which are a dimensionless normalized measure of how much the parameter $p$ affects the flux $v$: \n", "\n", "$$\n", "\\varepsilon_p^v = \\frac{\\partial v}{\\partial p}\\frac{p}{v} = \\frac{\\partial\\ln v}{\\partial\\ln p}\n", "$$\n", "\n", "`micom` can calculate the elasticities for abundances and diet in one go.\n", "\n", "This again uses cooperative tradeoff to limit the solution space." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "100%|██████████| 5/5 [00:02<00:00, 2.39models/s]\n", "100%|██████████| 4/4 [00:00<00:00, 16.06optimizations/s]\n", "100%|██████████| 5/5 [00:00<00:00, 7.38optimizations/s]\n" ] }, { "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", "
reactiontaxoneffectordirectionelasticitytype
0EX_ac_mmediumEX_glc__D_mzero0.000014exchanges
1EX_acald_mmediumEX_glc__D_mzero0.000012exchanges
2EX_akg_mmediumEX_glc__D_mzero0.000017exchanges
3EX_co2_mmediumEX_glc__D_mforward0.923854exchanges
4EX_etoh_mmediumEX_glc__D_mzero0.000009exchanges
\n", "
" ], "text/plain": [ " reaction taxon effector direction elasticity type\n", "0 EX_ac_m medium EX_glc__D_m zero 0.000014 exchanges\n", "1 EX_acald_m medium EX_glc__D_m zero 0.000012 exchanges\n", "2 EX_akg_m medium EX_glc__D_m zero 0.000017 exchanges\n", "3 EX_co2_m medium EX_glc__D_m forward 0.923854 exchanges\n", "4 EX_etoh_m medium EX_glc__D_m zero 0.000009 exchanges" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from micom import Community, data\n", "from micom.elasticity import elasticities\n", "\n", "tax = data.test_taxonomy()\n", "com = Community(tax)\n", "\n", "eps = elasticities(com, fraction=1.0, reactions=com.exchanges)\n", "eps.head()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Here reaction refers to the target flux and effector to the changed parameter. The direction indicates the flux direction and the type whether we changed an exchange bound or a taxa abundance. So for instance the 4th row would tell us that raising glucose import by one unit (one unit of additional glucose in the diet) would increase the carbon dioxide production by 0.92 units. The other rows do not impose a significant change, are not sensitive to glucose availability." ] }, { "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.6.7" } }, "nbformat": 4, "nbformat_minor": 4 }