{ "cells": [ { "cell_type": "markdown", "id": "e91e65cc", "metadata": { "id": "e91e65cc" }, "source": [ "# Removing elements using COBRApy" ] }, { "cell_type": "markdown", "id": "9f3c76d0", "metadata": { "id": "9f3c76d0" }, "source": [ "## Removal of reactions/metabolites\n", "\n", "In the following example we show how individual reactions or metabolites can be removed from the model based on their ID. More information about the function `remove_reactions` can be found [here](https://cobrapy.readthedocs.io/en/latest/autoapi/cobra/core/index.html?highlight=remove%20pathway#cobra.core.Model.remove_reactions) and for function `remove_metabolites` [here](https://cobrapy.readthedocs.io/en/latest/autoapi/cobra/core/index.html?highlight=remove%20pathway#cobra.core.Model.remove_metabolites).\n", "\n", "For demonstration purposes we add a reaction. The metabolites in this reactions\n", "are also added to the model." ] }, { "cell_type": "code", "execution_count": 1, "id": "a67246c1", "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 265 }, "id": "a67246c1", "outputId": "5b0afb2e-e9fe-4acf-b13d-1c101ab18d8a" }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "\u001b[33mNothing was specified in argument \"genome\". Reaction \"R04382\" will not include genes. Please modify if necessary.\u001b[0m\n", "\u001b[33mReaction \"R04382_c\" is already present in the model. Skipping additions.\u001b[0m\n" ] }, { "data": { "text/html": [ "\n", "
| Reaction identifier | R04382_c | \n", "
| Name | 4-(4-deoxy-alpha-D-galact-4-enuronosyl)-D-galacturonate lyase | \n", "
| Memory address | \n", "0x750b10288470 | \n", "
| Stoichiometry | \n", "\n",
" C06118_c <=> 2.0 C04053_c \n", "Unsaturated digalacturonate <=> 2.0 (4S,5R)-4,5-Dihydroxy-2,6-dioxohexanoate \n", " | \n",
"
| GPR | \n", " |
| Lower bound | -1000 | \n", "
| Upper bound | 1000 | \n", "
| Metabolite identifier | C04053_c | \n", "
| Name | (4S,5R)-4,5-Dihydroxy-2,6-dioxohexanoate | \n", "
| Memory address | \n", "0x750b0bf5f8f0 | \n", "
| Formula | C6H8O6 | \n", "
| Compartment | c | \n", "
| In 1 reaction(s) | \n", " R04382_c\n", " | \n", "
| Reaction identifier | R04382_c | \n", "
| Name | 4-(4-deoxy-alpha-D-galact-4-enuronosyl)-D-galacturonate lyase | \n", "
| Memory address | \n", "0x750b10288470 | \n", "
| Stoichiometry | \n", "\n",
" C06118_c <=> \n", "Unsaturated digalacturonate <=> \n", " | \n",
"
| GPR | \n", " |
| Lower bound | -1000 | \n", "
| Upper bound | 1000 | \n", "
| Pathway identifier | \n", "curated_pathway |
| Name | \n", "|
| Memory address | \n", "0x0128690305761248 |
| Reactions involved | \n", " PEPDEPHOS_RXN_c, FHLMULTI_RXN_c, PYRUVFORMLY_RXN_c |
| Genes involved | EG10803, EG10804, EG10480, EG10478, EG10477, EG10476, EG10479, EG10475, EG10285, EG10701, G7627, EG11784 |
| Visualization attributes |
|
" ], "text/plain": [ "
| Pathway identifier | \n", "curated_pathway |
| Name | \n", "|
| Memory address | \n", "0x0128690305761248 |
| Reactions involved | \n", " PEPDEPHOS_RXN_c, FHLMULTI_RXN_c, PYRUVFORMLY_RXN_c |
| Genes involved | EG10803, EG10804, EG10480, EG10478, EG10477, EG10476, EG10479, EG10475, EG10285, EG10701, G7627, EG11784 |
| Visualization attributes |
|
" ], "text/plain": [ "
| Pathway identifier | \n", "curated_pathway |
| Name | \n", "|
| Memory address | \n", "0x0128690305761248 |
| Reactions involved | \n", "|
| Genes involved | |
| Visualization attributes |
|
" ], "text/plain": [ "