{ "cells": [ { "cell_type": "markdown", "id": "7f53fcb3-4b49-4d57-a2e5-afa555378ce0", "metadata": {}, "source": [ "# Reading ModelSEED Biochemistry from ModelSEED Database\n", "\n", "This notebook provides examples to read data from the biochemistry database" ] }, { "cell_type": "markdown", "id": "74246002-2a2e-405c-8aa0-2ed382c752cc", "metadata": {}, "source": [ "The biochemistry database is represented by the `modelseedpy.biochem.modelseed_biochem.ModelSEEDDatabase` class\n", "\n", "The database can be instantiated from either a local github copy of the database repository or loaded via web url from github.\n", "* `from_local` - from_local(*path to repository*)\n", " * Example:\n", " 1. first we obtain a copy of the repository: `git clone https://github.com/ModelSEED/ModelSEEDDatabase.git`\n", " 2. then we can load the repository with `from_local`: `from_local('/home/user/ModelSEEDDatabase')`\n", "* `from_github` - from_github(*commit version*)\n", " * Example:\n", " * load the dev branch from github (default: https://github.com/ModelSEED/ModelSEEDDatabase): `from_github('dev')`\n", " * load a specific commit version from github: `from_github('194ac8afe48f8a606c0dd07ba3c7af10c02ba2fd')`\n", " * load from another fork/repository: `from_github('master', 'https://raw.githubusercontent.com/Fxe/ModelSEEDDatabase')`" ] }, { "cell_type": "code", "execution_count": 1, "id": "ac3992a9-d5b3-48d7-b744-0dd08a32df27", "metadata": {}, "outputs": [], "source": [ "import logging\n", "import pandas as pd\n", "from modelseedpy.biochem.modelseed_biochem import get_structures_from_df, get_aliases_from_df, get_names_from_df, process_aliases, load_metabolites_from_df\n", "from modelseedpy.biochem.modelseed_biochem import ALIAS_RXN_IDENTIFIERS_ORG, ALIAS_MODELS\n", "from modelseedpy.biochem.modelseed_biochem import from_local2, from_local, from_github\n", "from modelseedpy.biochem.modelseed_reaction import ModelSEEDReaction, ModelSEEDReaction2\n", "logger = logging.getLogger(__name__)" ] }, { "cell_type": "code", "execution_count": 2, "id": "65ecaae2-d062-4221-b567-dddd4eec15bd", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "CPU times: user 16.8 s, sys: 668 ms, total: 17.5 s\n", "Wall time: 17.5 s\n" ] } ], "source": [ "%%time\n", "modelseed_local2 = from_local2('/home/fliu/workspace/python/ModelSEEDDatabase/')" ] }, { "cell_type": "code", "execution_count": 3, "id": "cc04b352-3890-4bad-8a16-c9a05e401be2", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "CPU times: user 42.2 s, sys: 503 ms, total: 42.7 s\n", "Wall time: 42.7 s\n" ] } ], "source": [ "%%time\n", "modelseed_local1 = from_local('/home/fliu/workspace/python/ModelSEEDDatabase/')" ] }, { "cell_type": "code", "execution_count": 4, "id": "43934d69-bbd0-4cab-ab7f-a6e4296a7b56", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "CPU times: user 18.8 s, sys: 1.12 s, total: 19.9 s\n", "Wall time: 24.3 s\n" ] } ], "source": [ "%%time\n", "modelseed_git = from_github('dev')" ] }, { "cell_type": "code", "execution_count": 5, "id": "7e4ce949-7c34-408e-976b-77d7eaf0993f", "metadata": {}, "outputs": [], "source": [ "inchi_key_lookup = {}\n", "for cpd in modelseed_git.compounds:\n", " inchi_key = cpd.inchi_key\n", " inchi_key = None if pd.isna(inchi_key) or len(inchi_key) == 0 else inchi_key\n", " cpd.inchi_key = inchi_key\n", " if cpd.inchi_key:\n", " a, b, p = cpd.inchi_key.split('-')\n", " if a not in inchi_key_lookup:\n", " inchi_key_lookup[a] = {}\n", " if b not in inchi_key_lookup[a]:\n", " inchi_key_lookup[a][b] = set()\n", " inchi_key_lookup[a][b].add((cpd.id, p))" ] }, { "cell_type": "code", "execution_count": 6, "id": "27d973b2-67af-43a0-b418-737843aeb038", "metadata": {}, "outputs": [], "source": [ "metabolite_reactions = {}\n", "for rxn in modelseed_git.reactions:\n", " if not rxn.is_obsolete:\n", " for m in rxn.metabolites:\n", " if m.seed_id not in metabolite_reactions:\n", " metabolite_reactions[m.seed_id] = set()\n", " metabolite_reactions[m.seed_id].add(rxn.id)" ] }, { "cell_type": "code", "execution_count": 14, "id": "28c90f2a-3f21-4616-8c69-2c746be512ec", "metadata": {}, "outputs": [], "source": [ "import cobrakbase\n", "kbase = cobrakbase.KBaseAPI()\n", "genome = kbase.get_from_ws('87388/3/1')" ] }, { "cell_type": "code", "execution_count": 38, "id": "87e117e3-762c-4840-a40b-66714ef675f5", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'aliases': [['protein_id', 'WP_066378293.1'], ['locus_tag', 'A3776_RS08395']],\n", " 'cdss': ['A3776_RS08395_CDS_1'],\n", " 'dna_sequence': 'ATGATTGTACCCTTGCTATATCTGGCTTTAGCCGGAGCCTATCTATTAGTTGTCCCGGTGGCTTTAATGCTTTACCTCAACCTACGCTGGTATACGGCTGGCTCGATTGAGCGCACCGTCATGTATTTTTTTGTATTTTTGTTCTTTCCCGGACTGTTGGTTTTGTCGCCGTTTGTGAATCTGCGACCCAAACCCCGCAAAATTGAAGTTTAA',\n", " 'dna_sequence_length': 213,\n", " 'functions': ['NADH dehydrogenase subunit', 'NdhL'],\n", " 'id': 'A3776_RS08395',\n", " 'location': [['NZ_LUHI01000036.1', 21434, '-', 213]],\n", " 'md5': '1ae8b7b3d705b63184c99a9711785d23',\n", " 'protein_md5': '1ae8b7b3d705b63184c99a9711785d23',\n", " 'protein_translation': 'MIVPLLYLALAGAYLLVVPVALMLYLNLRWYTAGSIERTVMYFFVFLFFPGLLVLSPFVNLRPKPRKIEV',\n", " 'protein_translation_length': 70,\n", " 'quality': {'hit_count': 5, 'weighted_hit_count': 5.5205}}" ] }, "execution_count": 38, "metadata": {}, "output_type": "execute_result" } ], "source": [ "genome.features.get_by_id('A3776_RS08395').data" ] }, { "cell_type": "code", "execution_count": 221, "id": "d950807e-d2b1-423e-be71-7f54a5a35930", "metadata": {}, "outputs": [], "source": [ "import json\n", "data = None\n", "with open('/home/fliu/workspace/data/sbml/iAnC892/iAnC892_single.json', 'r') as fh:\n", " data = json.load(fh)" ] }, { "cell_type": "code", "execution_count": 222, "id": "80409e3f-e672-47bc-b275-715f79276bfb", "metadata": {}, "outputs": [], "source": [ "%run /home/fliu/workspace/data/sbml/iAnC892/tools.py\n", "integrate_to_seed(data)" ] }, { "cell_type": "code", "execution_count": 161, "id": "d644b65e-3955-4da4-b346-3a3e4d0cd9ae", "metadata": {}, "outputs": [], "source": [ "with open('/home/fliu/workspace/data/sbml/iAnC892/iAnC892_single_mapped.json', 'w') as fh:\n", " fh.write(json.dumps(data, indent=4, sort_keys=True))" ] }, { "cell_type": "code", "execution_count": 162, "id": "df7e8efe-df5c-48a5-b240-48b7f51996ec", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 163, "id": "b9906460-1807-45ce-9b8b-65f4a910fce2", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 223, "id": "e64a4938-9fa5-496d-9658-633b88c0ae56", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 224, "id": "93c0dcbd-fdb0-41f7-8e70-f02668fe4108", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Metabolite identifiercpd00011_p
NameCO2
Memory address0x07fcba66f68e0
FormulaCO2
Compartmentp
In 2 reaction(s)\n", " cpd00011exccc_p, cpd00011excpp_e
" ], "text/plain": [ "" ] }, "execution_count": 224, "metadata": {}, "output_type": "execute_result" } ], "source": [ "model_mapped.metabolites.cpd00011_p" ] }, { "cell_type": "code", "execution_count": 225, "id": "3a7c8dc8-2a5c-46e5-b850-432f622b9e9f", "metadata": {}, "outputs": [ { "data": { "text/html": [ "

Objective

1.0 obj_ATP = 0.8035714285714285

Uptake

\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
MetaboliteReactionFluxC-NumberC-Flux
cpd11632_eEX_cpd11632_e0.500.00%
hvphoton1_eEX_hvphoton1_e0.500.00%

Secretion

\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
MetaboliteReactionFluxC-NumberC-Flux
" ], "text/plain": [ "" ] }, "execution_count": 225, "metadata": {}, "output_type": "execute_result" } ], "source": [ "model_mapped = cobra.io.load_json_model('/home/fliu/workspace/data/sbml/iAnC892/iAnC892_single_mapped.json')\n", "from modelseedpy import MSBuilder\n", "from cobra.core import Reaction\n", "MSBuilder.build_exchanges(model_mapped, 'e')\n", "atp_obj = Reaction('obj_ATP', 'ATP objective function', 'objetive function', 0, 1000)\n", "atp_obj.add_metabolites({\n", " model_mapped.metabolites.cpd00001_c: -1,\n", " model_mapped.metabolites.cpd00002_c: -1,\n", " model_mapped.metabolites.cpd00008_c: 1,\n", " model_mapped.metabolites.cpd00009_c: 1,\n", " model_mapped.metabolites.cpd00067_c: 1,\n", "})\n", "model_mapped.add_reactions([atp_obj])\n", "model_mapped.objective = 'obj_ATP'\n", "model_mapped.medium = {\n", " #'EX_cpd00067_e': 1,\n", " 'EX_cpd11632_e': 0.5,\n", " #'EX_hvphoton2_e': 0.5,\n", " 'EX_hvphoton1_e': 0.5\n", "}\n", "#1.0 obj_ATP = 0.8035714285714285\n", "model_mapped.summary()" ] }, { "cell_type": "code", "execution_count": 197, "id": "ae9ff50c-d433-46b6-91c1-efb2ceaa8594", "metadata": {}, "outputs": [], "source": [ "model_mapped.medium = {\n", " 'EX_cpd00067_e': 1\n", " }\n", "sol = cobra.flux_analysis.pfba(model_mapped)" ] }, { "cell_type": "code", "execution_count": null, "id": "ef5ccc4d-ef83-455d-8602-1c37bca79558", "metadata": {}, "outputs": [], "source": [ "for a in [{'EX_cpd11632_e': 1}, {'EX_hvphoton1_e': 1}]:\n", " model_mapped.medium = {\n", " k.id: 1,\n", " }\n", " sol = cobra.flux_analysis.pfba(model_mapped)\n", "\n", " print(model_mapped.medium)\n", " ss = f\"{cpd.id}\\t{cpd.name}\\t{sol.fluxes['obj_ATP']}\\t{sol.status}\"\n", " print(ss)" ] }, { "cell_type": "code", "execution_count": null, "id": "7a57bcf3-1dbc-4e2d-899a-5b3fdaef9c63", "metadata": {}, "outputs": [], "source": [ "#glc/O2 22.857142857142854\n", "#glc 0" ] }, { "cell_type": "code", "execution_count": 218, "id": "24fe768b-c842-4eb6-ba83-5d3013f1ddb1", "metadata": {}, "outputs": [ { "data": { "text/html": [ "

Objective

1.0 obj_ATP = 0.0

Uptake

\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
MetaboliteReactionFluxC-NumberC-Flux

Secretion

\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
MetaboliteReactionFluxC-NumberC-Flux
" ], "text/plain": [ "" ] }, "execution_count": 218, "metadata": {}, "output_type": "execute_result" } ], "source": [ "model_mapped.medium = {\n", " 'EX_cpd00067_e': 1000,\n", " 'EX_cpd00001_e': 1000,\n", " 'EX_cpd00242_e': 1, #H2CO3\n", " 'EX_cpd00528_e': 1000, #N2\n", " 'EX_cpd00011_e': 1000, #co2\n", " 'EX_cpd00007_e': 0, #O2\n", " 'EX_cpd11632_e': 0,\n", " 'EX_hvphoton1_e': 0,\n", " 'EX_cpd00027_e': 1,\n", " 'EX_cpd00048_e': 1,\n", " 'EX_cpd00209_e': 1,\n", " 'EX_cpd11640_e': 1, #H2\n", " 'EX_cpd00268_e': 10\n", " }\n", "model_mapped.summary()" ] }, { "cell_type": "code", "execution_count": 203, "id": "511cbac2-307e-4834-b301-41d0b3596451", "metadata": { "collapsed": true, "jupyter": { "outputs_hidden": true }, "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "cpd11632_e\tPhotosystem 2 photon\t0.8571428571428571\toptimal\n", "hvphoton1_e\tPhotosystem 1 photon\t0.75\toptimal\n", "cpd00067_e\tH+\t0.0\toptimal\n", "cpd00001_e\tH2O\t0.0\toptimal\n", "cpd00007_e\tO2\t0.0\toptimal\n", "cpd00009_e\tPhosphate\t0.0\toptimal\n", "cpd00048_e\tSulfate\t0.0\toptimal\n", "cpd00209_e\tNitrate\t0.0\toptimal\n", "cpd00254_e\tMg\t0.0\toptimal\n", "cpd10515_e\tFe+2\t0.0\toptimal\n", "cpd00149_e\tCo2+\t0.0\toptimal\n", "cpd00034_e\tZn2+\t0.0\toptimal\n", "cpd00058_e\tCu2+\t0.0\toptimal\n", "cpd20863_e\tMn2+\t0.0\toptimal\n", "cpd00063_e\tCa2+\t0.0\toptimal\n", "cpd00205_e\tK+\t0.0\toptimal\n", "cpd00971_e\tNa+\t0.0\toptimal\n", "cpd11574_e\tMolybdate\t0.0\toptimal\n", "cpd00011_e\tCO2\t0.0\toptimal\n", "cpd00528_e\tN2\t0.0\toptimal\n", "cpd00027_e\tD-Glucose\t0.0\toptimal\n", "cpd00053_e\tL-Glutamine\t0.0\toptimal\n", "cpd00107_e\tL-Leucine\t0.0\toptimal\n", "cpd00118_e\tPutrescine\t0.0\toptimal\n", "cpd00129_e\tL-Proline\t0.0\toptimal\n", "cpd00156_e\tL-Valine\t0.0\toptimal\n", "cpd00179_e\tMaltose\t0.0\toptimal\n", "cpd00264_e\tSpermidine\t0.0\toptimal\n", "cpd00268_e\tH2S2O3\t0.0\toptimal\n", "cpd00322_e\tL-Isoleucine\t0.0\toptimal\n", "cpd03725_e\tFe(III)dicitrate\t0.0\toptimal\n", "cpd00060_e\tL-Methionine\t0.0\toptimal\n", "cpd00104_e\tBIOT\t0.0\toptimal\n", "cpd01012_e\tCd2+\t0.0\toptimal\n", "cpd11593_e\tala-L-asp-L\t0.0\toptimal\n", "cpd00159_e\tL-Lactate\t0.0\toptimal\n", "cpd01262_e\tAmylotriose\t0.0\toptimal\n", "cpd01329_e\tMaltohexaose\t0.0\toptimal\n", "cpd00242_e\tH2CO3\t0.0\toptimal\n", "cpd00013_e\tcpd00013[e]\t0.0\toptimal\n", "cpd11640_e\tH2\t0.0\toptimal\n" ] } ], "source": [ "for k in model_mapped.exchanges:\n", " cpd = list(k.metabolites)[0]\n", " model_mapped.medium = {\n", " k.id: 1,\n", " }\n", " sol = cobra.flux_analysis.pfba(model_mapped)\n", " ss = f\"{cpd.id}\\t{cpd.name}\\t{sol.fluxes['obj_ATP']}\\t{sol.status}\"\n", " print(ss)" ] }, { "cell_type": "code", "execution_count": 43, "id": "1c6bc2f8-d523-440b-904c-5acd4db54860", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Dihydroorotate dehydrogenase (quinone) (EC 1.3.5.2)\n", "Putative dihydropyrimidine dehydrogenase [NADP+], similar to dihydroorotate dehydrogenase\n" ] } ], "source": [ "for k in ['A3776_RS12690', 'A3776_RS16110']:\n", " for o in genome.features.get_by_id(k).functions:\n", " print(o)\n" ] }, { "cell_type": "code", "execution_count": 19, "id": "15430fde-162c-4476-9319-35ebcf0541c1", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "NDH1_1u_k A3776_RS06230 and A3776_RS16180 and A3776_RS20905 and A3776_RS06215 and A3776_RS06220 and A3776_RS19180 and ( A3776_RS06225 or A3776_RS21975 ) and A3776_RS20895 and A3776_RS20900 and A3776_RS08395 and A3776_RS11390 and A3776_RS03245 and A3776_RS09810 and A3776_RS09805 and A3776_RS09800 and ( A3776_RS08060 or A3776_RS10415 or A3776_RS22280 ) and ( A3776_RS03760 or A3776_RS08065 or A3776_RS18720 )\n", "NDH1_1p_p A3776_RS06230 and A3776_RS16180 and A3776_RS20905 and A3776_RS06215 and A3776_RS06220 and A3776_RS19180 and ( A3776_RS06225 or A3776_RS21975 ) and A3776_RS20895 and A3776_RS20900 and A3776_RS08395 and A3776_RS11390 and A3776_RS03245 and A3776_RS09810 and A3776_RS09805 and A3776_RS09800 and ( A3776_RS08060 or A3776_RS10415 or A3776_RS22280 ) and ( A3776_RS03760 or A3776_RS08065 or A3776_RS18720 )\n", "NDH1_4pp_p A3776_RS06230 and A3776_RS16180 and A3776_RS20905 and A3776_RS06215 and A3776_RS06220 and A3776_RS19180 and ( A3776_RS06225 or A3776_RS21975 ) and A3776_RS20895 and A3776_RS20900 and A3776_RS08395 and A3776_RS11390 and A3776_RS03245 and A3776_RS09810 and A3776_RS09805 and A3776_RS09800 and ( A3776_RS03765 or A3776_RS18715 ) and ( A3776_RS03760 or A3776_RS08065 or A3776_RS18720 ) and A3776_RS03770\n", "NDH1_3u_k A3776_RS06230 and A3776_RS16180 and A3776_RS20905 and A3776_RS06215 and A3776_RS06220 and A3776_RS19180 and ( A3776_RS06225 or A3776_RS21975 ) and A3776_RS20895 and A3776_RS20900 and A3776_RS08395 and A3776_RS11390 and A3776_RS03245 and A3776_RS09810 and A3776_RS09805 and A3776_RS09800 and ( A3776_RS08060 or A3776_RS10415 or A3776_RS22280 ) and ( A3776_RS03760 or A3776_RS08065 or A3776_RS18720 ) and A3776_RS18710 and A3776_RS04105\n", "NDH1_2p_p A3776_RS06230 and A3776_RS16180 and A3776_RS20905 and A3776_RS06215 and A3776_RS06220 and A3776_RS19180 and ( A3776_RS06225 or A3776_RS21975 ) and A3776_RS20895 and A3776_RS20900 and A3776_RS08395 and A3776_RS11390 and A3776_RS03245 and A3776_RS09810 and A3776_RS09805 and A3776_RS09800 and ( A3776_RS08060 or A3776_RS10415 or A3776_RS22280 ) and ( A3776_RS03760 or A3776_RS08065 or A3776_RS18720 )\n", "NDH1_2u_k A3776_RS06230 and A3776_RS16180 and A3776_RS20905 and A3776_RS06215 and A3776_RS06220 and A3776_RS19180 and ( A3776_RS06225 or A3776_RS21975 ) and A3776_RS20895 and A3776_RS20900 and A3776_RS08395 and A3776_RS11390 and A3776_RS03245 and A3776_RS09810 and A3776_RS09805 and A3776_RS09800 and ( A3776_RS08060 or A3776_RS10415 or A3776_RS22280 ) and ( A3776_RS03760 or A3776_RS08065 or A3776_RS18720 )\n", "rxn08335_p_p A3776_RS12690\n", "DHORD_PQ9_k A3776_RS12690 or A3776_RS16110\n" ] } ], "source": [ "for rxn_id in super_c:\n", " if rxn_id in model.reactions:\n", " stoich_key, compartment_setup = super_c[rxn_id]\n", " rxn_model = model.reactions.get_by_id(rxn_id)\n", " print(rxn_model.id, rxn_model.gene_reaction_rule)" ] }, { "cell_type": "code", "execution_count": 7, "id": "d91f26d4-f2d1-4231-9408-7a451a304399", "metadata": {}, "outputs": [], "source": [ "import cobra\n", "model = cobra.io.load_json_model('/home/fliu/workspace/data/sbml/iAnC892/iAnC892_single.json')" ] }, { "cell_type": "code", "execution_count": 64, "id": "43f03e38-ea9b-462d-b69c-aea595fdd8bd", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Reaction identifierCBFCu_k
Namecytochrome b6/f complex
Memory address0x07fcbbf9f9f70
Stoichiometry\n", "

2.0 cpd00067_c + 2.0 cpd12265_k + cpd16503_k --> 4.0 cpd00067_k + cpd07274_k + 2.0 cpd12239_k

\n", "

2.0 H+ + 2.0 Oxidized plastocyanin + Plastoquinol-9 --> 4.0 H+ + Plastoquinone A + 2.0 Reduced plastocyanin

\n", "
GPRA3776_RS13955 or A3776_RS22750
Lower bound0.0
Upper bound1000.0
\n", " " ], "text/plain": [ "" ] }, "execution_count": 64, "metadata": {}, "output_type": "execute_result" } ], "source": [ "model.reactions.CBFCu_k" ] }, { "cell_type": "code", "execution_count": 62, "id": "7c892248-657d-40aa-b73f-57331a0e7948", "metadata": { "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "cpd00007_0 0 cpd00007_k\n", "-1.0\n", "cpd00067_0 0 cpd00067_k\n", "-4.0\n", "cpd16503_0 0 cpd16503_k\n", "-2.0\n", "cpd00001_0 0 cpd00001_k\n", "2.0\n", "cpd00067_1 1 cpd00067_c\n", "4.0\n", "cpd07274_0 0 cpd07274_k\n", "2.0\n", "cpd11632_0 0 cpd11632_k\n", "1.0\n" ] }, { "data": { "text/html": [ "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Reaction identifierrxn46370_k
Namenan
Memory address0x07fcbbc01f790
Stoichiometry\n", "

cpd00007_k + 4.0 cpd00067_k + 2.0 cpd16503_k <=> 2.0 cpd00001_k + 4.0 cpd00067_c + 2.0 cpd07274_k + cpd11632_k

\n", "

O2 + 4.0 H+ + 2.0 Plastoquinol-9 <=> 2.0 H2O + 4.0 H+ + 2.0 Plastoquinone A + hn

\n", "
GPR
Lower bound-1000
Upper bound1000
\n", " " ], "text/plain": [ "" ] }, "execution_count": 62, "metadata": {}, "output_type": "execute_result" } ], "source": [ "seed_build = {\n", " 'PSII_k': ('rxn46370', {'0': 'k', '1': 'c'}),\n", "}\n", "modelseed_git.reactions.rxn46370.to_template_reaction({'0': 'k', '1': 'c'})" ] }, { "cell_type": "code", "execution_count": null, "id": "4556b85c-5d82-45e0-b9bb-e9860adf35a4", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 170, "id": "4436bbf2-885f-41a4-ab76-87f688447cb1", "metadata": {}, "outputs": [], "source": [ "#rxn37623: cpd00005_0 + 3.0 cpd00067_0 + cpd07274_0 <=> cpd00006_0 + cpd29046_0\n", "#rxn37623 NADPH + 3.0 H+ + Plastoquinone A <=> NADP + plastoquinol A\n", "#rxn36824 NADPH + H+ + Plastoquinone A <=> NADP + Plastoquinol-9\n", "#rxn36824: cpd00005_0 + cpd00067_0 + cpd07274_0 <=> cpd00006_0 + cpd16503_0\n", "super_c = {\n", " 'NDH1_1u_k': ('NDH1_1u_k', {'0': 'c', '1': 'k'}),\n", " 'NDH1_1p_p': ('NDH1_1u_k', {'0': 'c', '1': 'p'}),\n", " 'NDH1_4pp_p': ('NDH1_3u_k', {'0': 'c', '1': 'p'}),\n", " 'NDH1_3u_k': ('NDH1_3u_k', {'0': 'c', '1': 'k'}),\n", " 'NDH1_2p_p': ('NDH1_2u_k', {'0': 'c', '1': 'p'}),\n", " 'NDH1_2u_k': ('NDH1_2u_k', {'0': 'c', '1': 'k'}),\n", " \n", " 'rxn08335_p_p': ('DHORD_PQ9_k', {'0': 'c', '1': 'p'}),\n", " 'DHORD_PQ9_k': ('DHORD_PQ9_k', {'0': 'c', '1': 'k'}),\n", " 'FQR_k': ('FQR_k', {'0': 'c', '1': 'k'}),\n", " 'CBFCu_k': ('CBFCu_k', {'0': 'c', '1': 'k'}),\n", "}\n", "# cpd00005_c + 4.0 cpd00067_c + cpd07274_k --> cpd00006_c + 3.0 cpd00067_k + cpd16503_k\n", "#NDH1_1p_p: cpd00005_c + 4.0 cpd00067_c + cpd07274_p --> cpd00006_c + 3.0 cpd00067_p + cpd16503_p\n", "#NDH1_1u_k: cpd00005_c + 4.0 cpd00067_c + cpd07274_k --> cpd00006_c + 3.0 cpd00067_k + cpd16503_k\n", "super_s = {\n", " 'NDH1_1u_k': {\n", " ('cpd00005', '0'): -1, \n", " ('cpd00067', '0'): -4, \n", " ('cpd07274', '1'): -1,\n", " ('cpd00006', '0'): 1, \n", " ('cpd00067', '1'): 3, \n", " ('cpd16503', '1'): 1\n", " },\n", "\n", "#NDH1_4pp_p: cpd00001_c + cpd00005_c + cpd00011_p + 3.0 cpd00067_c + cpd07274_p --> cpd00006_c + 3.0 cpd00067_p + cpd00242_c + cpd16503_p\n", "#NDH1_3u_k : cpd00001_c + cpd00005_c + cpd00011_p + 3.0 cpd00067_c + cpd07274_k --> cpd00006_c + 3.0 cpd00067_k + cpd00242_c + cpd16503_k\n", " 'NDH1_3u_k': {\n", " ('cpd00001', '0'): -1, \n", " ('cpd00005', '0'): -1, \n", " ('cpd00011', '0'): -1,\n", " ('cpd00067', '0'): -3,\n", " ('cpd07274', '1'): -1,\n", " ('cpd00006', '0'): 1, \n", " ('cpd00067', '1'): 3, \n", " ('cpd00242', '0'): 1,\n", " ('cpd16503', '1'): 1\n", " },\n", "#NDH1_2p_p: cpd00004_c + 4.0 cpd00067_c + cpd07274_p --> cpd00003_c + 3.0 cpd00067_p + cpd16503_p\n", "#NDH1_2u_k: cpd00004_c + 4.0 cpd00067_c + cpd07274_k --> cpd00003_c + 3.0 cpd00067_k + cpd16503_k\n", " 'NDH1_2u_k': {\n", " ('cpd00004', '0'): -1, \n", " ('cpd00067', '0'): -4, \n", " ('cpd07274', '1'): -1,\n", " ('cpd00003', '0'): 1,\n", " ('cpd00067', '1'): 3, \n", " ('cpd16503', '1'): 1\n", " },\n", "#NDH2_syn_k: cpd00004_c + cpd00067_c + cpd07274_k --> cpd00003_c + cpd16503_k\n", " 'NDH2_syn_k': {\n", " ('cpd00004', 'c'): -1, \n", " ('cpd00067', 'c'): -1, \n", " ('cpd07274', 'k'): -1,\n", " ('cpd00003', 'c'): 1,\n", " ('cpd16503', 'k'): 1\n", " },\n", "#rxn08335_p_p: cpd00282_c + cpd07274_p --> cpd00247_c + cpd16503_p\n", "#DHORD_PQ9_k : cpd00282_c + cpd07274_k --> cpd00247_c + cpd16503_k\n", " 'DHORD_PQ9_k': {\n", " ('cpd00282', '0'): -1, \n", " ('cpd07274', '1'): -1, \n", " ('cpd00247', '0'): 1,\n", " ('cpd16503', '1'): 1\n", " },\n", "#FQR_k: 2.0 cpd00067_c + cpd07274_k + 2.0 cpd11620_c --> 2.0 cpd11621_c + cpd16503_k\n", " 'FQR_k': {\n", " ('cpd00067', '0'): -2, \n", " ('cpd07274', '1'): -1, \n", " ('cpd11620', '0'): -2,\n", " ('cpd11621', '0'): 2,\n", " ('cpd16503', '1'): 1\n", " },\n", "#CBFCu_k: 2.0 cpd00067_c + 2.0 cpd12265_k + cpd16503_k --> 4.0 cpd00067_k + cpd07274_k + 2.0 cpd12239_k\n", " 'CBFCu_k': {\n", " ('cpd00067', '0'): -2, \n", " ('cpd12265', '1'): -2, \n", " ('cpd16503', '1'): -1,\n", " ('cpd00067', '1'): 4,\n", " ('cpd07274', '1'): 1,\n", " ('cpd12239', '1'): 2\n", " },\n", "}" ] }, { "cell_type": "code", "execution_count": 150, "id": "aecd7819-ac3f-4ec7-90f1-d262a6a5fb3e", "metadata": {}, "outputs": [], "source": [ "# CYTBDu_k -> DB with pq9" ] }, { "cell_type": "code", "execution_count": null, "id": "e5d103f6-1cef-4851-a845-68eeb80298ef", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 174, "id": "3ce735a9-be63-4144-a466-d36b4c5b09f1", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "NDH1_1u_k True\n", "NDH1_1p_p True\n", "NDH1_4pp_p True\n", "NDH1_3u_k True\n", "NDH1_2p_p True\n", "NDH1_2u_k True\n", "rxn08335_p_p True\n", "DHORD_PQ9_k True\n", "FQR_k True\n", "CBFCu_k True\n" ] } ], "source": [ "def test(model_mapped):\n", " for rxn_id in super_c:\n", " if rxn_id in model_mapped.reactions:\n", " stoich_key, compartment_setup = super_c[rxn_id]\n", " rxn_model = model_mapped.reactions.get_by_id(rxn_id)\n", " #print(rxn_id, rxn_model)\n", " #\n", " rxn_s_model = dict(map(lambda x: (x[0].id, x[1]), rxn_model.metabolites.items()))\n", " rxn_s_match = {}\n", " for (cpd_id, cmp_token), v in super_s[stoich_key].items():\n", " _cpd_id = f'{cpd_id}_{compartment_setup[cmp_token]}'\n", " rxn_s_match[_cpd_id] = v\n", "\n", " valid = rxn_s_model == rxn_s_match\n", " print(rxn_id, valid)\n", " if not valid:\n", " print(rxn_id, compartment_setup)\n", " print('rxn_s_match', rxn_s_match)\n", " print('rxn_s_model', rxn_s_model)\n", "test(model_mapped)" ] }, { "cell_type": "code", "execution_count": null, "id": "e5540a3d-cfe9-4f79-8a12-d3b1ee55747e", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "85ac7e99-1a38-436d-b006-a10021d7b26a", "metadata": {}, "outputs": [], "source": [ "rxn14159: cpd00006_0 + cpd00067_0 + 2.0 cpd11620_0 <=> cpd00005_0 + 2.0 cpd11621_0\n", "rxn14159 NADP + H+ + 2.0 Reducedferredoxin <=> NADPH + 2.0 Oxidizedferredoxin\n", "\n", "rxn05937: cpd00006_0 + cpd00067_0 + cpd11620_0 <=> cpd00005_0 + cpd11621_0\n", "rxn05937 NADP + H+ + Reducedferredoxin <=> NADPH + Oxidizedferredoxin" ] }, { "cell_type": "code", "execution_count": 228, "id": "5247a251-46de-4338-bb3d-ae336dae5bfa", "metadata": { "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "rxn34892: 4.0 cpd00005_0 + cpd00007_0 + cpd11621_0 + cpd30237_0 <=> 2.0 cpd00001_0 + 4.0 cpd00006_0 + cpd11620_0 + cpd30238_0 {'0'}\n", "rxn34892 4.0 NADPH + O2 + Oxidizedferredoxin + Digalactosyldiacylglycerol (1-(9Z)-octadecenoyl,2-(7Z,10Z)-hexadecadienoyl, 18:1(9Z)/16:2(7Z,10Z)) <=> 2.0 H2O + 4.0 NADP + Reducedferredoxin + Digalactosyldiacylglycerol (1-(9Z)-octadecenoyl,2-(4Z,7Z,10Z)-hexadecatrienoyl, 18:1(9Z)/16:3(4Z,7Z,10Z))\n", "\n" ] } ], "source": [ "def finddd(a, b):\n", " c = set(a) | set(b)\n", " super_match = None\n", " for i in c:\n", " if i in metabolite_reactions:\n", " if super_match is None:\n", " super_match = set(metabolite_reactions[i])\n", " super_match &= set(metabolite_reactions[i])\n", " return super_match\n", "\n", "#finddd(['cpd00003'], ['cpd00004'])\n", "#cpd00001_k + 2.0 cpd00067_c + cpd07274_k + 2.0 hvphoton2_c --> 0.5 cpd00007_k + 2.0 cpd00067_k + cpd16503_k\n", "#2 cpd00001_k + 4.0 cpd00067_c + 2 cpd07274_k + 4.0 hvphoton2_c --> 1 cpd00007_k + 4.0 cpd00067_k + 2 cpd16503_k\n", "for r in finddd(['cpd00006', 'cpd11620'], ['cpd00005', 'cpd11621']):\n", " rxn = modelseed_git.reactions.get_by_id(r)\n", " print(rxn, rxn.compartments)\n", " print(rxn.id, rxn.build_reaction_string(True))\n", " print()\n", " break" ] }, { "cell_type": "code", "execution_count": null, "id": "cb26ddf6-393f-44b8-8bfc-c3844e02dc82", "metadata": {}, "outputs": [], "source": [ "#2 cpd00001_0 + 4.0 cpd00067_1 + 2 cpd07274_0 + cpd11632_0 --> 1 cpd00007_0 + 4.0 cpd00067_0 + 2 cpd16503_0\n", "#2 cpd00001_k + 4.0 cpd00067_c + 2 cpd07274_k + 4.0 hvphoton2_c --> 1 cpd00007_k + 4.0 cpd00067_k + 2 cpd16503_k" ] }, { "cell_type": "code", "execution_count": 48, "id": "2e451f61-3ce3-4f18-b68c-d989ff5cb49e", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Reaction identifierrxn05937
NameFerredoxin:NADP+ oxidoreductase
Memory address0x07fcbbd112c70
Stoichiometry\n", "

cpd00006_0 + cpd00067_0 + cpd11620_0 <=> cpd00005_0 + cpd11621_0

\n", "

NADP + H+ + Reducedferredoxin <=> NADPH + Oxidizedferredoxin

\n", "
GPR
Lower bound-1000
Upper bound1000
\n", " " ], "text/plain": [ "" ] }, "execution_count": 48, "metadata": {}, "output_type": "execute_result" } ], "source": [ "modelseed_git.reactions.rxn05937" ] }, { "cell_type": "code", "execution_count": 283, "id": "fa1682e1-ecdf-4656-b174-94c5e57b2d2d", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Reaction identifierATP_syn_l__hc
NameATP synthetase(u)
Memory address0x07fcb9a4b07f0
Stoichiometry\n", "

3.0 cpd00008[hc] + 3.0 cpd00009[hc] + 14.0 cpd00067[hl] --> 3.0 cpd00001[hc] + 3.0 cpd00002[hc] + 11.0 cpd00067[hc]

\n", "

3.0 ADP + 3.0 Phosphate + 14.0 H+ --> 3.0 H2O + 3.0 ATP + 11.0 H+

\n", "
GPR( A3776_RS10860 or A3776_RS13440 ) and ( A3776_RS10820 or A3776_RS10980 ) and ( A3776_RS10975 or...
Lower bound0.0
Upper bound1000.0
\n", " " ], "text/plain": [ "" ] }, "execution_count": 283, "metadata": {}, "output_type": "execute_result" } ], "source": [ "model_full.reactions.EX_cpd00027[e]" ] }, { "cell_type": "code", "execution_count": 759, "id": "1fddab8f-078e-4905-814a-d46dd718d971", "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", "
NameM_iAnC892
Memory address0x07fcb9861eee0
Number of metabolites1811
Number of reactions1848
Number of groups0
Objective expression1.0*biomass_eq_33047_c0 - 1.0*biomass_eq_33047_c0_reverse_4b9c5
CompartmentsVegetative cytoplasm, Vegetative lumen, Vegetative periplasm, Extracellular space, Vegetative carboxysome, Heterocyst cytoplasm, Heterocyst lumen, Heterocyst periplasm, Pseudo compartment
" ], "text/plain": [ "" ] }, "execution_count": 759, "metadata": {}, "output_type": "execute_result" } ], "source": [ "model_full_mapped = cobra.io.load_json_model('/home/fliu/workspace/data/sbml/iAnC892/iAnC892_mapped.json')\n", "from cobra.core import Reaction\n", "ex_hn = Reaction('EX_cpd11632_e0', 'Exchange for photon', '', -1000, 1000)\n", "ex_hn.add_metabolites({\n", " model_full_mapped.metabolites.cpd11632_e0: -1\n", "})\n", "model_full_mapped.add_reactions([ex_hn])\n", "model_full_mapped" ] }, { "cell_type": "code", "execution_count": null, "id": "ec7eb8e0-b592-4d4f-ae94-a792ac73a124", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 769, "id": "c83aba5d-4fb6-4933-863b-12f384d73c64", "metadata": { "collapsed": true, "jupyter": { "outputs_hidden": true }, "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "cpd00001[vp] H2O\n", "\t CYO1b2pp_syn__vc: 0.5 cpd00007[vp] + 4.0 cpd00067[vc] + 2.0 cpd12239[vp] --> cpd00001[vp] + 2.0 cpd00067[vp] + 2.0 cpd12265[vp]\n", "\t CYTBDpp__vc: 0.5 cpd00007[vp] + cpd16503[vp] --> cpd00001[vp] + cpd07274[vp]\n", "\t rxn08687__vc: cpd00001[vp] <=> cpd00001[vc]\n", "\t CYO1bpp_syn__vc: 0.5 cpd00007[vp] + 4.0 cpd00067[vc] + 2.0 focytc_6[vp] --> cpd00001[vp] + 2.0 cpd00067[vp] + 2.0 ficytc_6[vp]\n", "\t rxn08686__vc: cpd00001[e] <=> cpd00001[vp]\n", "\n", "\n", "cpd00007[vp] O2\n", "\t CYO1b2pp_syn__vc: 0.5 cpd00007[vp] + 4.0 cpd00067[vc] + 2.0 cpd12239[vp] --> cpd00001[vp] + 2.0 cpd00067[vp] + 2.0 cpd12265[vp]\n", "\t CYTBDpp__vc: 0.5 cpd00007[vp] + cpd16503[vp] --> cpd00001[vp] + cpd07274[vp]\n", "\t rxn09031__vc: cpd00007[e] <=> cpd00007[vp]\n", "\t CYO1bpp_syn__vc: 0.5 cpd00007[vp] + 4.0 cpd00067[vc] + 2.0 focytc_6[vp] --> cpd00001[vp] + 2.0 cpd00067[vp] + 2.0 ficytc_6[vp]\n", "\t O2tpp__vc: cpd00007[vp] <=> cpd00007[vc]\n", "\n", "\n", "cpd00067[vp] H+\n", "\t CBFC2pp__vc: 2.0 cpd00067[vc] + cpd16503[vp] + 2.0 ficytc_6[vp] --> 4.0 cpd00067[vp] + cpd07274[vp] + 2.0 focytc_6[vp]\n", "\t CBFCpp__vc: 2.0 cpd00067[vc] + 2.0 cpd12265[vp] + cpd16503[vp] --> 4.0 cpd00067[vp] + cpd07274[vp] + 2.0 cpd12239[vp]\n", "\t rxn05312__vc: cpd00009[vp] + cpd00067[vp] <=> cpd00009[vc] + cpd00067[vc]\n", "\t rxn05602__vc: cpd00067[vp] + cpd00159[vp] <=> cpd00067[vc] + cpd00159[vc]\n", "\t H+tex__vc: cpd00067[e] <=> cpd00067[vp]\n", "\t NDH1_2p__vc: cpd00004[vc] + 4.0 cpd00067[vc] + cpd07274[vp] --> cpd00003[vc] + 3.0 cpd00067[vp] + cpd16503[vp]\n", "\t rxn05209__vc: cpd00067[vc] + cpd00971[vp] <=> cpd00067[vp] + cpd00971[vc]\n", "\t CYO1b2pp_syn__vc: 0.5 cpd00007[vp] + 4.0 cpd00067[vc] + 2.0 cpd12239[vp] --> cpd00001[vp] + 2.0 cpd00067[vp] + 2.0 cpd12265[vp]\n", "\t NDH1_4pp__vc: cpd00001[vc] + cpd00005[vc] + cpd00011[vp] + 3.0 cpd00067[vc] + cpd07274[vp] --> cpd00006[vc] + 3.0 cpd00067[vp] + cpd00242[vc] + cpd16503[vp]\n", "\t NDH1_1p__vc: cpd00005[vc] + 4.0 cpd00067[vc] + cpd07274[vp] --> cpd00006[vc] + 3.0 cpd00067[vp] + cpd16503[vp]\n", "\t THD2__vc: cpd00004[vc] + cpd00006[vc] + 2.0 cpd00067[vp] --> cpd00003[vc] + cpd00005[vc] + 2.0 cpd00067[vc]\n", "\t CYO1bpp_syn__vc: 0.5 cpd00007[vp] + 4.0 cpd00067[vc] + 2.0 focytc_6[vp] --> cpd00001[vp] + 2.0 cpd00067[vp] + 2.0 ficytc_6[vp]\n", "\t ATP_syn_p__vc: 3.0 cpd00008[vc] + 3.0 cpd00009[vc] + 14.0 cpd00067[vp] --> 3.0 cpd00001[vc] + 3.0 cpd00002[vc] + 11.0 cpd00067[vc]\n", "\n", "\n", "cpd07274[vp] Plastoquinone A\n", "\t CBFC2pp__vc: 2.0 cpd00067[vc] + cpd16503[vp] + 2.0 ficytc_6[vp] --> 4.0 cpd00067[vp] + cpd07274[vp] + 2.0 focytc_6[vp]\n", "\t CBFCpp__vc: 2.0 cpd00067[vc] + 2.0 cpd12265[vp] + cpd16503[vp] --> 4.0 cpd00067[vp] + cpd07274[vp] + 2.0 cpd12239[vp]\n", "\t CYTBDpp__vc: 0.5 cpd00007[vp] + cpd16503[vp] --> cpd00001[vp] + cpd07274[vp]\n", "\t NDH1_2p__vc: cpd00004[vc] + 4.0 cpd00067[vc] + cpd07274[vp] --> cpd00003[vc] + 3.0 cpd00067[vp] + cpd16503[vp]\n", "\t rxn09272_p__vc: cpd00036[vc] + cpd07274[vp] --> cpd00106[vc] + cpd16503[vp]\n", "\t NDH1_4pp__vc: cpd00001[vc] + cpd00005[vc] + cpd00011[vp] + 3.0 cpd00067[vc] + cpd07274[vp] --> cpd00006[vc] + 3.0 cpd00067[vp] + cpd00242[vc] + cpd16503[vp]\n", "\t rxn08335_p__vc: cpd00282[vc] + cpd07274[vp] --> cpd00247[vc] + cpd16503[vp]\n", "\t NDH1_1p__vc: cpd00005[vc] + 4.0 cpd00067[vc] + cpd07274[vp] --> cpd00006[vc] + 3.0 cpd00067[vp] + cpd16503[vp]\n", "\n", "\n", "cpd12239[vp] Reduced plastocyanin\n", "\t CYO1b2pp_syn__vc: 0.5 cpd00007[vp] + 4.0 cpd00067[vc] + 2.0 cpd12239[vp] --> cpd00001[vp] + 2.0 cpd00067[vp] + 2.0 cpd12265[vp]\n", "\t CBFCpp__vc: 2.0 cpd00067[vc] + 2.0 cpd12265[vp] + cpd16503[vp] --> 4.0 cpd00067[vp] + cpd07274[vp] + 2.0 cpd12239[vp]\n", "\n", "\n", "cpd12265[vp] Oxidized plastocyanin\n", "\t CYO1b2pp_syn__vc: 0.5 cpd00007[vp] + 4.0 cpd00067[vc] + 2.0 cpd12239[vp] --> cpd00001[vp] + 2.0 cpd00067[vp] + 2.0 cpd12265[vp]\n", "\t CBFCpp__vc: 2.0 cpd00067[vc] + 2.0 cpd12265[vp] + cpd16503[vp] --> 4.0 cpd00067[vp] + cpd07274[vp] + 2.0 cpd12239[vp]\n", "\n", "\n", "cpd16503[vp] Plastoquinol-9\n", "\t CBFC2pp__vc: 2.0 cpd00067[vc] + cpd16503[vp] + 2.0 ficytc_6[vp] --> 4.0 cpd00067[vp] + cpd07274[vp] + 2.0 focytc_6[vp]\n", "\t CBFCpp__vc: 2.0 cpd00067[vc] + 2.0 cpd12265[vp] + cpd16503[vp] --> 4.0 cpd00067[vp] + cpd07274[vp] + 2.0 cpd12239[vp]\n", "\t CYTBDpp__vc: 0.5 cpd00007[vp] + cpd16503[vp] --> cpd00001[vp] + cpd07274[vp]\n", "\t NDH1_2p__vc: cpd00004[vc] + 4.0 cpd00067[vc] + cpd07274[vp] --> cpd00003[vc] + 3.0 cpd00067[vp] + cpd16503[vp]\n", "\t rxn09272_p__vc: cpd00036[vc] + cpd07274[vp] --> cpd00106[vc] + cpd16503[vp]\n", "\t NDH1_4pp__vc: cpd00001[vc] + cpd00005[vc] + cpd00011[vp] + 3.0 cpd00067[vc] + cpd07274[vp] --> cpd00006[vc] + 3.0 cpd00067[vp] + cpd00242[vc] + cpd16503[vp]\n", "\t rxn08335_p__vc: cpd00282[vc] + cpd07274[vp] --> cpd00247[vc] + cpd16503[vp]\n", "\t NDH1_1p__vc: cpd00005[vc] + 4.0 cpd00067[vc] + cpd07274[vp] --> cpd00006[vc] + 3.0 cpd00067[vp] + cpd16503[vp]\n", "\n", "\n", "ficytc_6[vp] Ferricytochrome c6\n", "\t CBFC2pp__vc: 2.0 cpd00067[vc] + cpd16503[vp] + 2.0 ficytc_6[vp] --> 4.0 cpd00067[vp] + cpd07274[vp] + 2.0 focytc_6[vp]\n", "\t CYO1bpp_syn__vc: 0.5 cpd00007[vp] + 4.0 cpd00067[vc] + 2.0 focytc_6[vp] --> cpd00001[vp] + 2.0 cpd00067[vp] + 2.0 ficytc_6[vp]\n", "\n", "\n", "focytc_6[vp] Ferrocytochrome c6\n", "\t CBFC2pp__vc: 2.0 cpd00067[vc] + cpd16503[vp] + 2.0 ficytc_6[vp] --> 4.0 cpd00067[vp] + cpd07274[vp] + 2.0 focytc_6[vp]\n", "\t CYO1bpp_syn__vc: 0.5 cpd00007[vp] + 4.0 cpd00067[vc] + 2.0 focytc_6[vp] --> cpd00001[vp] + 2.0 cpd00067[vp] + 2.0 ficytc_6[vp]\n", "\n", "\n", "hvphoton2[vp] Photosystem 2 photon\n", "\t PHOtpp2__vc: hvphoton2[vp] <=> hvphoton2[vc]\n", "\t PHOtex2__vc: hvphoton2[e] <=> hvphoton2[vp]\n", "\n", "\n", "hvphoton1[vp] Photosystem 1 photon\n", "\t PHOtpp1__vc: hvphoton1[vp] <=> hvphoton1[vc]\n", "\t PHOtex1__vc: hvphoton1[e] <=> hvphoton1[vp]\n", "\n", "\n", "cpd00011[vp] CO2\n", "\t NDH1_3u__vc: cpd00001[vc] + cpd00005[vc] + cpd00011[vp] + 3.0 cpd00067[vc] + cpd07274[vl] --> cpd00006[vc] + 3.0 cpd00067[vl] + cpd00242[vc] + cpd16503[vl]\n", "\t NDH1_4pp__vc: cpd00001[vc] + cpd00005[vc] + cpd00011[vp] + 3.0 cpd00067[vc] + cpd07274[vp] --> cpd00006[vc] + 3.0 cpd00067[vp] + cpd00242[vc] + cpd16503[vp]\n", "\t cpd00011excpp__vc: cpd00011[vp] <=> cpd00011[e]\n", "\t cpd00011exccc__vc: cpd00011[vc] <=> cpd00011[vp]\n", "\n", "\n", "cpd00009[vp] Phosphate\n", "\t cpd00009excpp__vc: cpd00009[vp] <=> cpd00009[e]\n", "\t rxn05312__vc: cpd00009[vp] + cpd00067[vp] <=> cpd00009[vc] + cpd00067[vc]\n", "\t rxn05145__vc: cpd00001[vc] + cpd00002[vc] + cpd00009[vp] --> cpd00008[vc] + 2.0 cpd00009[vc] + cpd00067[vc]\n", "\n", "\n", "cpd00048[vp] Sulfate\n", "\t cpd00048excpp__vc: cpd00048[vp] <=> cpd00048[e]\n", "\t rxn05153__vc: cpd00001[vc] + cpd00002[vc] + cpd00048[vp] --> cpd00008[vc] + cpd00009[vc] + cpd00048[vc] + cpd00067[vc]\n", "\n", "\n", "cpd00209[vp] Nitrate\n", "\t cpd00209excpp__vc: cpd00209[vp] <=> cpd00209[e]\n", "\t NO3abcpp__vc: cpd00001[vc] + cpd00002[vc] + cpd00209[vp] --> cpd00008[vc] + cpd00009[vc] + cpd00067[vc] + cpd00209[vc]\n", "\n", "\n", "cpd00254[vp] Mg\n", "\t rxn05616__vc: cpd00254[vc] <=> cpd00254[vp]\n", "\t cpd00254excpp__vc: cpd00254[vp] <=> cpd00254[e]\n", "\n", "\n", "cpd10515[vp] Fe+2\n", "\t Fe+2abc__vc: cpd00001[vc] + cpd00002[vc] + cpd10515[vp] --> cpd00008[vc] + cpd00009[vc] + cpd00067[vc] + cpd10515[vc]\n", "\t cpd10515excpp__vc: cpd10515[vp] <=> cpd10515[e]\n", "\n", "\n", "cpd00149[vp] Co2+\n", "\t cpd00149excpp__vc: cpd00149[vp] <=> cpd00149[e]\n", "\t rxn10474__vc: cpd00149[vc] <=> cpd00149[vp]\n", "\n", "\n", "cpd00034[vp] Zn2+\n", "\t cpd00034excpp__vc: cpd00034[vp] <=> cpd00034[e]\n", "\t Znabc__vc: cpd00001[vc] + cpd00002[vc] + cpd00034[vp] --> cpd00008[vc] + cpd00009[vc] + cpd00034[vc] + cpd00067[vc]\n", "\n", "\n", "cpd00058[vp] Cu2+\n", "\t rxn05528__vc: cpd00001[vc] + cpd00002[vc] + cpd00058[vc] --> cpd00008[vc] + cpd00009[vc] + cpd00058[vp] + cpd00067[vc]\n", "\t cpd00058excpp__vc: cpd00058[vp] <=> cpd00058[e]\n", "\t rxn10481__vc: cpd00001[vc] + cpd00002[vc] + cpd00058[vp] --> cpd00008[vc] + cpd00009[vc] + cpd00058[vc] + cpd00067[vc]\n", "\n", "\n", "cpd20863[vp] Mn2+\n", "\t cpd20863excpp__vc: cpd20863[vp] <=> cpd20863[e]\n", "\t Mn+2abc__vc: cpd00001[vc] + cpd00002[vc] + cpd20863[vp] --> cpd00008[vc] + cpd00009[vc] + cpd00067[vc] + cpd20863[vc]\n", "\n", "\n", "cpd00063[vp] Ca2+\n", "\t rxn05513__vc: cpd00001[vc] + cpd00002[vc] + cpd00063[vp] --> cpd00008[vc] + cpd00009[vc] + cpd00063[vc] + cpd00067[vc]\n", "\t cpd00063excpp__vc: cpd00063[vp] <=> cpd00063[e]\n", "\n", "\n", "cpd00205[vp] K+\n", "\t cpd00205excpp__vc: cpd00205[vp] <=> cpd00205[e]\n", "\t Kabc__vc: cpd00001[vc] + cpd00002[vc] + cpd00205[vp] --> cpd00008[vc] + cpd00009[vc] + cpd00067[vc] + cpd00205[vc]\n", "\t rxn05206__vc: cpd00205[vp] <=> cpd00205[vc]\n", "\n", "\n", "cpd00971[vp] Na+\n", "\t H2CO3_NAt_syn__vc: cpd00242[vp] + cpd00971[vp] --> cpd00242[vc] + cpd00971[vc]\n", "\t rxn05209__vc: cpd00067[vc] + cpd00971[vp] <=> cpd00067[vp] + cpd00971[vc]\n", "\t cpd00971excpp__vc: cpd00971[vp] <=> cpd00971[e]\n", "\n", "\n", "cpd11574[vp] Molybdate\n", "\t cpd11574excpp__vc: cpd11574[vp] <=> cpd11574[e]\n", "\t rxn05619__vc: cpd00001[vc] + cpd00002[vc] + cpd11574[vp] --> cpd00008[vc] + cpd00009[vc] + cpd00067[vc] + cpd11574[vc]\n", "\n", "\n", "cpd00027[vp] D-Glucose\n", "\t cpd00027excpp__vc: cpd00027[vp] <=> cpd00027[e]\n", "\t rxn05147__vc: cpd00001[vc] + cpd00002[vc] + cpd00027[vp] --> cpd00008[vc] + cpd00009[vc] + cpd00027[vc] + cpd00067[vc]\n", "\n", "\n", "cpd00053[vp] L-Glutamine\n", "\t rxn05155__vc: cpd00001[vc] + cpd00002[vc] + cpd00053[vp] --> cpd00008[vc] + cpd00009[vc] + cpd00053[vc] + cpd00067[vc]\n", "\t cpd00053excpp__vc: cpd00053[vp] <=> cpd00053[e]\n", "\n", "\n", "cpd00107[vp] L-Leucine\n", "\t cpd00107excpp__vc: cpd00107[vp] <=> cpd00107[e]\n", "\t rxn05161__vc: cpd00001[vc] + cpd00002[vc] + cpd00107[vp] --> cpd00008[vc] + cpd00009[vc] + cpd00067[vc] + cpd00107[vc]\n", "\n", "\n", "cpd00118[vp] Putrescine\n", "\t rxn05163__vc: cpd00001[vc] + cpd00002[vc] + cpd00118[vp] --> cpd00008[vc] + cpd00009[vc] + cpd00067[vc] + cpd00118[vc]\n", "\t cpd00118excpp__vc: cpd00118[vp] <=> cpd00118[e]\n", "\n", "\n", "cpd00129[vp] L-Proline\n", "\t rxn05165__vc: cpd00001[vc] + cpd00002[vc] + cpd00129[vp] --> cpd00008[vc] + cpd00009[vc] + cpd00067[vc] + cpd00129[vc]\n", "\t cpd00129excpp__vc: cpd00129[vp] <=> cpd00129[e]\n", "\n", "\n", "cpd00156[vp] L-Valine\n", "\t rxn05168__vc: cpd00001[vc] + cpd00002[vc] + cpd00156[vp] --> cpd00008[vc] + cpd00009[vc] + cpd00067[vc] + cpd00156[vc]\n", "\t cpd00156excpp__vc: cpd00156[vp] <=> cpd00156[e]\n", "\n", "\n", "cpd00179[vp] Maltose\n", "\t cpd00179excpp__vc: cpd00179[vp] <=> cpd00179[e]\n", "\t rxn05170__vc: cpd00001[vc] + cpd00002[vc] + cpd00179[vp] --> cpd00008[vc] + cpd00009[vc] + cpd00067[vc] + cpd00179[vc]\n", "\n", "\n", "cpd00264[vp] Spermidine\n", "\t cpd00264excpp__vc: cpd00264[vp] <=> cpd00264[e]\n", "\t rxn05175__vc: cpd00001[vc] + cpd00002[vc] + cpd00264[vp] --> cpd00008[vc] + cpd00009[vc] + cpd00067[vc] + cpd00264[vc]\n", "\n", "\n", "cpd00268[vp] H2S2O3\n", "\t cpd00268excpp__vc: cpd00268[vp] <=> cpd00268[e]\n", "\t rxn05176__vc: cpd00001[vc] + cpd00002[vc] + cpd00268[vp] --> cpd00008[vc] + cpd00009[vc] + cpd00067[vc] + cpd00268[vc]\n", "\n", "\n", "cpd00322[vp] L-Isoleucine\n", "\t cpd00322excpp__vc: cpd00322[vp] <=> cpd00322[e]\n", "\t rxn05179__vc: cpd00001[vc] + cpd00002[vc] + cpd00322[vp] --> cpd00008[vc] + cpd00009[vc] + cpd00067[vc] + cpd00322[vc]\n", "\n", "\n", "cpd03725[vp] Fe(III)dicitrate\n", "\t rxn05189__vc: cpd00001[vc] + cpd00002[vc] + cpd03725[vp] --> cpd00008[vc] + cpd00009[vc] + cpd00067[vc] + cpd03725[vc]\n", "\t cpd03725excpp__vc: cpd03725[vp] <=> cpd03725[e]\n", "\n", "\n", "cpd00060[vp] L-Methionine\n", "\t rxn05219__vc: cpd00001[vc] + cpd00002[vc] + cpd00060[vp] --> cpd00008[vc] + cpd00009[vc] + cpd00060[vc] + cpd00067[vc]\n", "\t cpd00060excpp__vc: cpd00060[vp] <=> cpd00060[e]\n", "\n", "\n", "cpd00104[vp] BIOT\n", "\t rxn05223__vc: cpd00001[vc] + cpd00002[vc] + cpd00104[vp] --> cpd00008[vc] + cpd00009[vc] + cpd00067[vc] + cpd00104[vc]\n", "\t cpd00104excpp__vc: cpd00104[vp] <=> cpd00104[e]\n", "\n", "\n", "cpd01012[vp] Cd2+\n", "\t rxn05516__vc: cpd00001[vc] + cpd00002[vc] + cpd01012[vc] --> cpd00008[vc] + cpd00009[vc] + cpd00067[vc] + cpd01012[vp]\n", "\t cpd01012excpp__vc: cpd01012[vp] <=> cpd01012[e]\n", "\n", "\n", "cpd11593[vp] ala-L-asp-L\n", "\t cpd11593excpp__vc: cpd11593[vp] <=> cpd11593[e]\n", "\t rxn05533__vc: cpd00001[vc] + cpd00002[vc] + cpd11593[vp] --> cpd00008[vc] + cpd00009[vc] + cpd00067[vc] + cpd11593[vc]\n", "\n", "\n", "cpd00159[vp] L-Lactate\n", "\t cpd00159excpp__vc: cpd00159[vp] <=> cpd00159[e]\n", "\t rxn05602__vc: cpd00067[vp] + cpd00159[vp] <=> cpd00067[vc] + cpd00159[vc]\n", "\n", "\n", "cpd01262[vp] Amylotriose\n", "\t cpd01262excpp__vc: cpd01262[vp] <=> cpd01262[e]\n", "\t rxn05608__vc: cpd00001[vc] + cpd00002[vc] + cpd01262[vp] --> cpd00008[vc] + cpd00009[vc] + cpd00067[vc] + cpd01262[vc]\n", "\n", "\n", "cpd01329[vp] Maltohexaose\n", "\t rxn10174__vc: cpd00001[vc] + cpd00002[vc] + cpd01329[vp] --> cpd00008[vc] + cpd00009[vc] + cpd00067[vc] + cpd01329[vc]\n", "\t cpd01329excpp__vc: cpd01329[vp] <=> cpd01329[e]\n", "\n", "\n", "cpd00099[vp] Cl-\n", "\t rxn10473__vc: cpd00099[vp] <=> cpd00099[vc]\n", "\n", "\n", "cpd00242[vp] H2CO3\n", "\t H2CO3_abc__vc: cpd00001[vc] + cpd00002[vc] + cpd00242[vp] --> cpd00008[vc] + cpd00009[vc] + cpd00067[vc] + cpd00242[vc]\n", "\t H2CO3_NAt_syn__vc: cpd00242[vp] + cpd00971[vp] --> cpd00242[vc] + cpd00971[vc]\n", "\t cpd00242excpp__vc: cpd00242[vp] <=> cpd00242[e]\n", "\n", "\n", "cpd00013[vp] cpd00013[p]\n", "\t cpd00013excpp__vc: cpd00013[vp] --> cpd00013[e]\n", "\t cpd00013exccc__vc: cpd00013[vc] <=> cpd00013[vp]\n", "\n", "\n", "cpd11640[vp] H2\n", "\t cpd11640excpp_vc: cpd11640[vp] <=> cpd11640[e]\n", "\t cpd11640exccc_vc: cpd11640[vc] <=> cpd11640[vp]\n", "\n", "\n" ] } ], "source": [ "for m in model_full.metabolites:\n", " if m.compartment == 'vp':\n", " print(m, m.name)\n", " for r in m.reactions:\n", " print('\\t', r)\n", " print()\n", " print()" ] }, { "cell_type": "code", "execution_count": null, "id": "0c285e04-fc3d-462f-abce-c6435ca56cba", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "812e5a16-c3a7-4577-98bf-8346c9e811c5", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 633, "id": "98bd0d4f-9585-4541-9503-4fcbf244c235", "metadata": { "tags": [] }, "outputs": [], "source": [ "#model_full_mapped.summary()\n", "#0.18240098144906972\n", "#cpd00242_e0\tEX_cpd00242[e]\t8.486\n", "#hvphoton1_e0\tEX_PHO1\t61.35\n", "#hvphoton2_e0\tEX_PHO2\t51.03\n", "sol = cobra.flux_analysis.pfba(model_full_mapped)" ] }, { "cell_type": "code", "execution_count": 629, "id": "9a25e79f-d12d-4042-aa58-3a2170b3484f", "metadata": {}, "outputs": [], "source": [ "sol.fluxes.to_csv('/home/fliu/workspace/data/sbml/iAnC892/solution_wt.csv')" ] }, { "cell_type": "code", "execution_count": 733, "id": "2ab58b78-9847-4444-9f61-c940ebce039a", "metadata": {}, "outputs": [], "source": [ "model_full_json = None\n", "with open('/home/fliu/workspace/data/sbml/iAnC892/iAnC892.json', 'r') as fh:\n", " model_full_json = json.load(fh)" ] }, { "cell_type": "code", "execution_count": 734, "id": "b8f2c41f-426b-4bdd-b080-7ef741199964", "metadata": {}, "outputs": [], "source": [ "%run /home/fliu/workspace/data/sbml/iAnC892/tools.py" ] }, { "cell_type": "code", "execution_count": 735, "id": "60d7252c-cbac-41f0-a07c-f234e55922a7", "metadata": {}, "outputs": [], "source": [ "model_full_json_copy = copy.deepcopy(model_full_json)" ] }, { "cell_type": "code", "execution_count": 736, "id": "fb7d5dec-aa93-4a27-b6c3-2c45f48419e9", "metadata": {}, "outputs": [], "source": [ "MyIntegrator.rename_compound('hvphoton1[vp]', 'cpd11632[e]', model_full_json_copy)\n", "MyIntegrator.rename_compound('hvphoton1[hp]', 'cpd11632[e]', model_full_json_copy)\n", "MyIntegrator.rename_compound('hvphoton2[vp]', 'cpd11632[e]', model_full_json_copy)\n", "MyIntegrator.rename_compound('hvphoton1[vc]', 'cpd11632[vc]', model_full_json_copy)\n", "MyIntegrator.rename_compound('hvphoton1[hc]', 'cpd11632[hc]', model_full_json_copy)\n", "MyIntegrator.rename_compound('hvphoton2[vc]', 'cpd11632[vc]', model_full_json_copy)\n", "MyIntegrator.delete_reaction('PHOtex1__vc', model_full_json_copy)\n", "MyIntegrator.delete_reaction('PHOtex1__hc', model_full_json_copy)\n", "MyIntegrator.delete_reaction('PHOtex2__vc', model_full_json_copy)\n", "MyIntegrator.delete_reaction('EX_PHO2', model_full_json_copy)\n", "MyIntegrator.delete_reaction('EX_PHO1', model_full_json_copy)\n", "MyIntegrator.rename_compound('cpd00011[hp]', 'cpd00011[e]', model_full_json_copy)\n", "MyIntegrator.rename_compound('cpd00011[vp]', 'cpd00011[e]', model_full_json_copy)\n", "MyIntegrator.delete_reaction('cpd00011excpp__vc', model_full_json_copy)\n", "MyIntegrator.delete_reaction('cpd00011excpp__hc', model_full_json_copy)\n", "MyIntegrator.delete_reaction('EX_cpd00011[e]', model_full_json_copy)" ] }, { "cell_type": "code", "execution_count": 771, "id": "24e91372-5a3b-4b4e-8166-ffa7485489dc", "metadata": {}, "outputs": [], "source": [ "remove_periplasm_rename = {\n", " 'cpd07274[hp]': 'cpd07274[hc]',\n", " 'cpd16503[hp]': 'cpd16503[hc]',\n", " 'ficytc_6[hp]': 'ficytc_6[hc]',\n", " 'focytc_6[hp]': 'focytc_6[hc]',\n", " 'cpd12239[hp]': 'cpd12239[hc]',\n", " 'cpd12265[hp]': 'cpd12265[hc]',\n", " 'cpd07274[vp]': 'cpd07274[vc]',\n", " 'cpd16503[vp]': 'cpd16503[vc]',\n", " 'cpd12239[vp]': 'cpd12239[vc]',\n", " 'cpd12265[vp]': 'cpd12265[vc]',\n", " 'ficytc_6[vp]': 'ficytc_6[vc]',\n", " 'focytc_6[vp]': 'focytc_6[vc]'\n", "}\n", "for i in remove_periplasm_rename:\n", " MyIntegrator.rename_compound(i, remove_periplasm_rename[i], model_full_json_copy)" ] }, { "cell_type": "code", "execution_count": null, "id": "c89462da-a3a7-45fe-919f-e565fb705dff", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 737, "id": "88d7d41f-cd06-45ee-8731-0c9e9ba85104", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "dict_keys(['cpd11632[vc]', 'cpd11632[e]'])\n", "3\n", "dict_keys([])\n" ] } ], "source": [ "dups = MyIntegrator.dups(model_full_json_copy)\n", "print(dups.keys())\n", "deleted = MyIntegrator.filter_dups(model_full_json_copy)\n", "print(len(deleted))\n", "dups = MyIntegrator.dups(model_full_json_copy)\n", "print(dups.keys())" ] }, { "cell_type": "code", "execution_count": 738, "id": "1929e025-214b-446b-8d1f-490663d5f10a", "metadata": {}, "outputs": [], "source": [ "integrate = MyIntegrator(model_full_json_copy)" ] }, { "cell_type": "code", "execution_count": 739, "id": "baa64ef9-8558-403c-8299-4cd9d1336261", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "EX_PHO2\n", "EX_PHO1\n", "suc_vc_hc_exch\n", "glu_vc_hc_exch\n", "akg_vc_hc_exch\n", "gln_vc_hc_exch\n", "cpd11640exccc_hc\n", "cpd11640excpp_hc\n", "cpd11640exccc_vc\n", "cpd11640excpp_vc\n" ] } ], "source": [ "model_full_json_mapped = integrate.integrate_full_model_to_seed()" ] }, { "cell_type": "code", "execution_count": null, "id": "cba75c10-00b5-4e6a-ab88-84e8ad260bb7", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "4293a86d-4b70-4c1a-bb29-f49cdee9b103", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "5a8cf903-9d58-407f-928f-4f48484100b9", "metadata": { "tags": [] }, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 709, "id": "324774c0-5326-4b84-a425-12ee893de575", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[('hvphoton1[e]', 'hvphoton1_e0')]" ] }, "execution_count": 709, "metadata": {}, "output_type": "execute_result" } ], "source": [ "list(filter(lambda x: x[1] == 'hvphoton1_e0', integrate.compound_rename.items()))" ] }, { "cell_type": "code", "execution_count": 740, "id": "aaf84997-655d-470a-99ea-259f4ad66886", "metadata": {}, "outputs": [], "source": [ "from modelseedpy.core.msmodel import get_cmp_token\n", "ids = set()\n", "for rxn_from in integrate.reaction_rename:\n", " rxn_to = integrate.reaction_rename[rxn_from]\n", " if rxn_to in ids:\n", " print('!')\n", " ids.add(rxn_to)\n", " integrate.data_reactions[rxn_from]['id'] = rxn_to" ] }, { "cell_type": "code", "execution_count": null, "id": "2060ff4e-5c96-41f1-8e39-89faca94f47b", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 744, "id": "0dcbbccd-74b0-4412-852e-4d8a7f53259b", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "PHOtpp1_c1 {'c', 'e'} {'1', '0'} 16.433701168825166\n", "H+tex_c1 {'e', 'p'} {'0', '1'} 1.8604672397566566\n", "rxn08686_c1 {'e', 'p'} {'0', '1'} -0.6301653188076215\n", "rxn09031_c1 {'e', 'p'} {'0', '1'} 0.007060133469360138\n", "cpd00011excpp_c1 {'e', 'p'} {'0', '1'} 0.9082375363436314\n", "cpd00528excpp_c1 {'e', 'p'} {'1', '0'} -0.6772462674375839\n", "cpd00009excpp_c1 {'e', 'p'} {'0', '1'} -0.007102530301648417\n", "cpd00048excpp_c1 {'e', 'p'} {'0', '1'} -0.006401000613388471\n", "cpd00254excpp_c1 {'e', 'p'} {'0', '1'} -0.0005122802570501466\n", "cpd10515excpp_c1 {'e', 'p'} {'1', '0'} -0.0002548326163591996\n", "cpd00149excpp_c1 {'e', 'p'} {'0', '1'} -5.7935855860126646e-05\n", "cpd00034excpp_c1 {'e', 'p'} {'0', '1'} -5.395734017578539e-05\n", "cpd00058excpp_c1 {'e', 'p'} {'0', '1'} -5.395734017578539e-05\n", "cpd20863excpp_c1 {'e', 'p'} {'0', '1'} -5.395734017578539e-05\n", "cpd00063excpp_c1 {'e', 'p'} {'0', '1'} -8.084697174853654e-05\n", "cpd00205excpp_c1 {'e', 'p'} {'0', '1'} -0.0030344325960243667\n", "cpd00971excpp_c1 {'e', 'p'} {'0', '1'} -6.749119447730253e-05\n", "cpd11574excpp_c1 {'e', 'p'} {'0', '1'} -5.395734017578539e-05\n", "suc_vc_hc_exch {'c'} {'1', '0'} -0.21715810373903982\n", "glu_vc_hc_exch {'c', 'z'} {'1', '0'} -1.2313574522131312\n", "akg_vc_hc_exch {'c'} {'1', '0'} 0.18524178733858515\n", "gln_vc_hc_exch {'c', 'z'} {'1', '0'} 1.2313574522131312\n" ] } ], "source": [ "import math\n", "data_metabolites = dict(map(lambda x: (x['id'], x), model_full_json_mapped['metabolites']))\n", "for r in model_full_json_mapped['reactions']:\n", " #print(r['id'])\n", " metabolites = list(map(lambda x: data_metabolites[x], r['metabolites']))\n", " indexes = set(map(lambda x: x['index'], metabolites))\n", " cmps = set(map(lambda x: x['compartment'][:-1], metabolites))\n", " rxn_cmp = get_cmp_token(cmps)\n", " if cmps == {'e', 'p'}:\n", " rxn_cmp = 'p'\n", " if cmps == {'c', 'k', 'p'}:\n", " rxn_cmp = 'k'\n", " if rxn_cmp is None:\n", " print(r['id'], cmps, rxn_cmp)\n", " elif len(indexes) == 1:\n", " suffix = rxn_cmp + list(indexes)[0]\n", " if not r['id'].endswith(suffix):\n", " #print(r['id'], suffix)\n", " pass\n", " flux = sol.fluxes[r['id']]\n", " if len(indexes) > 1 and math.fabs(flux) > 0:\n", " print(r['id'], cmps, indexes, flux)" ] }, { "cell_type": "code", "execution_count": null, "id": "473bc9a7-3e78-44b6-b87e-1ab3fff2ea4a", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 745, "id": "505556a3-4fcc-40fd-a37f-1fab7e8b463a", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[]" ] }, "execution_count": 745, "metadata": {}, "output_type": "execute_result" } ], "source": [ "list(filter(lambda x: x[1] == 'EX_cpd0000_e0', integrate.reaction_rename.items()))" ] }, { "cell_type": "code", "execution_count": 746, "id": "08c92fed-8be6-4468-a60d-e0bd9ab48f93", "metadata": { "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "ATP_syn_l__vc ATP_syn_l_c0\n" ] } ], "source": [ "for k in integrate.reaction_rename:\n", " print(k, integrate.reaction_rename[k])\n", " break" ] }, { "cell_type": "code", "execution_count": 760, "id": "69973892-14d1-445e-a506-7272c3047383", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Reaction identifiercpd00011excpp_c1
Namecpd00011excpp
Memory address0x07fcb94191fd0
Stoichiometry\n", "

cpd00011_p1 <=> cpd00011_e0

\n", "

CO2 <=> CO2

\n", "
GPR
Lower bound-1000.0
Upper bound1000.0
\n", " " ], "text/plain": [ "" ] }, "execution_count": 760, "metadata": {}, "output_type": "execute_result" } ], "source": [ "model_full_mapped.reactions.cpd00011excpp_c1 " ] }, { "cell_type": "code", "execution_count": null, "id": "4cf13aff-6bcd-4a99-a478-0212d026b9a0", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "c5c45e5a-1ba8-43d9-afc6-39048a2ade64", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "8ce93e61-3ba0-4603-bbcc-e84d354dae7c", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "11c59915-3a0d-4f03-b714-16f24815e512", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "9244e73d-78d5-4911-9863-3a59c20fb427", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "5c41e259-e868-4246-abd9-f1205eb16c06", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 747, "id": "2d542962-b016-4b4b-9c0b-9ec7eba7edcc", "metadata": {}, "outputs": [], "source": [ "with open('/home/fliu/workspace/data/sbml/iAnC892/iAnC892_mapped.json', 'w') as fh:\n", " fh.write(json.dumps(model_full_json_mapped))" ] }, { "cell_type": "code", "execution_count": 343, "id": "3370b6d6-2946-4bc1-bb00-ca6ef02d959c", "metadata": {}, "outputs": [], "source": [ "model_full = cobra.io.load_json_model('/home/fliu/workspace/data/sbml/iAnC892/iAnC892.json')" ] }, { "cell_type": "code", "execution_count": 324, "id": "909b54c1-9229-465a-a166-39f409bdd419", "metadata": {}, "outputs": [ { "data": { "text/html": [ "

Objective

1.0 biomass_eq_33047__vc = 19.82460353465784

Uptake

\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
MetaboliteReactionFluxC-NumberC-Flux
hvphoton1[e]EX_PHO110000.00%
cpd00007[e]EX_cpd00007[e]32500.00%
cpd00009[e]EX_cpd00009[e]7.60100.00%
cpd00013[e]EX_cpd00013[e]74.5200.00%
cpd00027[e]EX_cpd00027[e]164.6681.61%
cpd00034[e]EX_cpd00034[e]0.058700.00%
cpd00048[e]EX_cpd00048[e]1.31500.00%
cpd00053[e]EX_cpd00053[e]16.0656.63%
cpd00058[e]EX_cpd00058[e]0.058700.00%
cpd00060[e]EX_cpd00060[e]5.52352.28%
cpd00063[e]EX_cpd00063[e]0.0879500.00%
cpd00067[e]EX_cpd00067[e]100000.00%
cpd00107[e]EX_cpd00107[e]3.37561.67%
cpd00118[e]EX_cpd00118[e]0.6240.20%
cpd00129[e]EX_cpd00129[e]5.88652.43%
cpd00149[e]EX_cpd00149[e]0.0630300.00%
cpd00156[e]EX_cpd00156[e]3.851.57%
cpd00205[e]EX_cpd00205[e]3.30100.00%
cpd00254[e]EX_cpd00254[e]0.557300.00%
cpd00264[e]EX_cpd00264[e]0.126170.07%
cpd00322[e]EX_cpd00322[e]7.11463.53%
cpd00971[e]EX_cpd00971[e]0.0734200.00%
cpd10515[e]EX_cpd10515[e]0.277200.00%
cpd11574[e]EX_cpd11574[e]0.058700.00%
cpd20863[e]EX_cpd20863[e]0.058700.00%

Secretion

\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
MetaboliteReactionFluxC-NumberC-Flux
cpd15380[hc]DM_cpd15380__hc-0.000782850.00%
cpd15380[vc]DM_cpd15380__vc-0.00432450.01%
dialurate[hc]DM_dialurate__hc-3.979E-0640.00%
dialurate[vc]DM_dialurate__vc-0.00432440.00%
cpd00001[e]EX_cpd00001[e]-68700.00%
cpd00011[e]EX_cpd00011[e]-372199.99%
" ], "text/plain": [ "" ] }, "execution_count": 324, "metadata": {}, "output_type": "execute_result" } ], "source": [ "model_full.medium = {\n", " 'EX_PHO2': 0, #Photosystem 2 photon\n", "'EX_PHO1': 100, #Photosystem 1 photon\n", "'EX_cpd00067[e]': 1000, #H+\n", "'EX_cpd00001[e]': 1000, #H2O\n", "'EX_cpd00007[e]': 1000, #O2\n", "'EX_cpd00009[e]': 1000, #Phosphate\n", "'EX_cpd00048[e]': 1000, #Sulfate\n", "'EX_cpd00209[e]': 1000, #Nitrate\n", "'EX_cpd00254[e]': 1000, #Mg\n", "'EX_cpd10515[e]': 1000, #Fe+2\n", "'EX_cpd00149[e]': 1000, #Co2+\n", "'EX_cpd00034[e]': 1000, #Zn2+\n", "'EX_cpd00058[e]': 1000, #Cu2+\n", "'EX_cpd20863[e]': 1000, #Mn2+\n", "'EX_cpd00063[e]': 1000, #Ca2+\n", "'EX_cpd00205[e]': 1000, #K+\n", "'EX_cpd00971[e]': 1000, #Na+\n", "'EX_cpd11574[e]': 1000, #Molybdate\n", "'EX_cpd00011[e]': 1000, #CO2\n", "'EX_cpd00528[e]': 0, #N2\n", "'EX_cpd00027[e]': 1000, #D-Glucose\n", "'EX_cpd00053[e]': 1000, #L-Glutamine\n", "'EX_cpd00107[e]': 1000, #L-Leucine\n", "'EX_cpd00118[e]': 1000, #Putrescine\n", "'EX_cpd00129[e]': 1000, #L-Proline\n", "'EX_cpd00156[e]': 1000, #L-Valine\n", "'EX_cpd00179[e]': 1000, #Maltose\n", "'EX_cpd00264[e]': 1000, #Spermidine\n", "'EX_cpd00268[e]': 1000, #H2S2O3\n", "'EX_cpd00322[e]': 1000, #L-Isoleucine\n", "'EX_cpd03725[e]': 1000, #Fe(III)dicitrate\n", "'EX_cpd00060[e]': 1000, #L-Methionine\n", "'EX_cpd00104[e]': 1000, #BIOT\n", "'EX_cpd01012[e]': 1000, #Cd2+\n", "'EX_cpd11593[e]': 1000, #ala-L-asp-L\n", "'EX_cpd00159[e]': 1000, #L-Lactate\n", "'EX_cpd01262[e]': 1000, #Amylotriose\n", "'EX_cpd01329[e]': 1000, #Maltohexaose\n", "'EX_cpd00242[e]': 1000, #H2CO3\n", "'EX_cpd00013[e]': 1000, #cpd00013[e]\n", "'EX_cpd11640[e]': 1000, #H2\n", "}\n", "model_full.summary()" ] }, { "cell_type": "code", "execution_count": 301, "id": "497cee18-a89d-48cc-9015-b0fd72d97cc5", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "hvphoton2[e] Photosystem 2 photon\n", "hvphoton1[e] Photosystem 1 photon\n", "cpd00067[e] H+\n", "cpd00001[e] H2O\n", "cpd00009[e] Phosphate\n", "cpd00048[e] Sulfate\n", "cpd00254[e] Mg\n", "cpd10515[e] Fe+2\n", "cpd00149[e] Co2+\n", "cpd00034[e] Zn2+\n", "cpd00058[e] Cu2+\n", "cpd20863[e] Mn2+\n", "cpd00063[e] Ca2+\n", "cpd00205[e] K+\n", "cpd00971[e] Na+\n", "cpd11574[e] Molybdate\n", "cpd00528[e] N2\n", "cpd00242[e] H2CO3\n" ] } ], "source": [ "base_n2_light1_2 = {\n", " 'EX_PHO2': 100.0,\n", " 'EX_PHO1': 100.0,\n", " 'EX_cpd00528[e]': 10.0,\n", " 'EX_cpd00067[e]': 1000.0,\n", " 'EX_cpd00001[e]': 1000.0,\n", " 'EX_cpd00009[e]': 1000.0,\n", " 'EX_cpd00048[e]': 1000.0,\n", " 'EX_cpd00254[e]': 1000.0,\n", " 'EX_cpd10515[e]': 1000.0,\n", " 'EX_cpd00149[e]': 1000.0,\n", " 'EX_cpd00034[e]': 1000.0,\n", " 'EX_cpd00058[e]': 1000.0,\n", " 'EX_cpd20863[e]': 1000.0,\n", " 'EX_cpd00063[e]': 1000.0,\n", " 'EX_cpd00205[e]': 1000.0,\n", " 'EX_cpd00971[e]': 1000.0,\n", " 'EX_cpd11574[e]': 1000.0,\n", "}\n", "default_medium = {\n", " 'EX_PHO2': 100.0,\n", " 'EX_PHO1': 100.0,\n", " 'EX_cpd00067[e]': 1000.0,\n", " 'EX_cpd00001[e]': 1000.0,\n", " 'EX_cpd00009[e]': 1000.0,\n", " 'EX_cpd00048[e]': 1000.0,\n", " 'EX_cpd00254[e]': 1000.0,\n", " 'EX_cpd10515[e]': 1000.0,\n", " 'EX_cpd00149[e]': 1000.0,\n", " 'EX_cpd00034[e]': 1000.0,\n", " 'EX_cpd00058[e]': 1000.0,\n", " 'EX_cpd20863[e]': 1000.0,\n", " 'EX_cpd00063[e]': 1000.0,\n", " 'EX_cpd00205[e]': 1000.0,\n", " 'EX_cpd00971[e]': 1000.0,\n", " 'EX_cpd11574[e]': 1000.0,\n", " 'EX_cpd00528[e]': 10.0,\n", " 'EX_cpd00242[e]': 8.486\n", "}\n", "for k in default_medium:\n", " cpd = list(model_full.reactions.get_by_id(k).metabolites)[0]\n", " print(cpd.id, cpd.name)" ] }, { "cell_type": "code", "execution_count": 323, "id": "fba8d8b9-30e4-49fa-9482-9366d2fa3bcb", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "'EX_PHO2': 1000, #Photosystem 2 photon\n", "'EX_PHO1': 1000, #Photosystem 1 photon\n", "'EX_cpd00067[e]': 1000, #H+\n", "'EX_cpd00001[e]': 1000, #H2O\n", "'EX_cpd00007[e]': 1000, #O2\n", "'EX_cpd00009[e]': 1000, #Phosphate\n", "'EX_cpd00048[e]': 1000, #Sulfate\n", "'EX_cpd00209[e]': 1000, #Nitrate\n", "'EX_cpd00254[e]': 1000, #Mg\n", "'EX_cpd10515[e]': 1000, #Fe+2\n", "'EX_cpd00149[e]': 1000, #Co2+\n", "'EX_cpd00034[e]': 1000, #Zn2+\n", "'EX_cpd00058[e]': 1000, #Cu2+\n", "'EX_cpd20863[e]': 1000, #Mn2+\n", "'EX_cpd00063[e]': 1000, #Ca2+\n", "'EX_cpd00205[e]': 1000, #K+\n", "'EX_cpd00971[e]': 1000, #Na+\n", "'EX_cpd11574[e]': 1000, #Molybdate\n", "'EX_cpd00011[e]': 1000, #CO2\n", "'EX_cpd00528[e]': 1000, #N2\n", "'EX_cpd00027[e]': 1000, #D-Glucose\n", "'EX_cpd00053[e]': 1000, #L-Glutamine\n", "'EX_cpd00107[e]': 1000, #L-Leucine\n", "'EX_cpd00118[e]': 1000, #Putrescine\n", "'EX_cpd00129[e]': 1000, #L-Proline\n", "'EX_cpd00156[e]': 1000, #L-Valine\n", "'EX_cpd00179[e]': 1000, #Maltose\n", "'EX_cpd00264[e]': 1000, #Spermidine\n", "'EX_cpd00268[e]': 1000, #H2S2O3\n", "'EX_cpd00322[e]': 1000, #L-Isoleucine\n", "'EX_cpd03725[e]': 1000, #Fe(III)dicitrate\n", "'EX_cpd00060[e]': 1000, #L-Methionine\n", "'EX_cpd00104[e]': 1000, #BIOT\n", "'EX_cpd01012[e]': 1000, #Cd2+\n", "'EX_cpd11593[e]': 1000, #ala-L-asp-L\n", "'EX_cpd00159[e]': 1000, #L-Lactate\n", "'EX_cpd01262[e]': 1000, #Amylotriose\n", "'EX_cpd01329[e]': 1000, #Maltohexaose\n", "'EX_cpd00242[e]': 1000, #H2CO3\n", "'EX_cpd00013[e]': 1000, #cpd00013[e]\n", "'EX_cpd11640[e]': 1000, #H2\n" ] } ], "source": [ "for e in model_full.exchanges:\n", " cpd = list(e.metabolites)[0]\n", " print(f\"'{e.id}': 1000, #{cpd.name}\")" ] }, { "cell_type": "code", "execution_count": 312, "id": "cff260a5-9a7c-4b67-9535-ad2638b8a903", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "EX_cpd00007[e] O2 nan\n", "EX_cpd00209[e] Nitrate nan\n", "EX_cpd00011[e] CO2 0.005403764017101146\n", "EX_cpd00027[e] D-Glucose 0.12362258410257106\n", "EX_cpd00053[e] L-Glutamine 0.09997882008547625\n", "EX_cpd00107[e] L-Leucine nan\n", "EX_cpd00118[e] Putrescine nan\n", "EX_cpd00129[e] L-Proline nan\n", "EX_cpd00156[e] L-Valine nan\n", "EX_cpd00179[e] Maltose nan\n", "EX_cpd00264[e] Spermidine nan\n", "EX_cpd00268[e] H2S2O3 nan\n", "EX_cpd00322[e] L-Isoleucine nan\n", "EX_cpd03725[e] Fe(III)dicitrate nan\n", "EX_cpd00060[e] L-Methionine nan\n", "EX_cpd00104[e] BIOT nan\n", "EX_cpd01012[e] Cd2+ nan\n", "EX_cpd11593[e] ala-L-asp-L nan\n", "EX_cpd00159[e] L-Lactate nan\n", "EX_cpd01262[e] Amylotriose nan\n", "EX_cpd01329[e] Maltohexaose nan\n", "EX_cpd00242[e] H2CO3 0.005403764017096219\n", "EX_cpd00013[e] cpd00013[e] nan\n", "EX_cpd11640[e] H2 nan\n" ] } ], "source": [ "import copy\n", "for e in model_full.exchanges:\n", " if e.id not in base_n2_light1_2:\n", " cpd = list(e.metabolites)[0]\n", " m = copy.deepcopy(base_n2_light1_2)\n", " m.update({'EX_cpd00007[e]': 1000})\n", " m.update({e.id: 1})\n", " model_full.medium = m\n", " v = model_full.slim_optimize()\n", " print(e.id, cpd.name, v)" ] }, { "cell_type": "code", "execution_count": 304, "id": "38dfa2e6-ed22-4dd6-b031-3c9d058d51ea", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "EX_cpd00007[e] O2 nan\n", "EX_cpd00209[e] Nitrate nan\n", "EX_cpd00011[e] CO2 0.005403764017095576\n", "EX_cpd00027[e] D-Glucose 0.12362258410257534\n", "EX_cpd00053[e] L-Glutamine 0.09997882008547528\n", "EX_cpd00107[e] L-Leucine nan\n", "EX_cpd00118[e] Putrescine nan\n", "EX_cpd00129[e] L-Proline nan\n", "EX_cpd00156[e] L-Valine nan\n", "EX_cpd00179[e] Maltose nan\n", "EX_cpd00264[e] Spermidine nan\n", "EX_cpd00268[e] H2S2O3 nan\n", "EX_cpd00322[e] L-Isoleucine nan\n", "EX_cpd03725[e] Fe(III)dicitrate nan\n", "EX_cpd00060[e] L-Methionine nan\n", "EX_cpd00104[e] BIOT nan\n", "EX_cpd01012[e] Cd2+ nan\n", "EX_cpd11593[e] ala-L-asp-L nan\n", "EX_cpd00159[e] L-Lactate nan\n", "EX_cpd01262[e] Amylotriose nan\n", "EX_cpd01329[e] Maltohexaose nan\n", "EX_cpd00242[e] H2CO3 0.005403764017095296\n", "EX_cpd00013[e] cpd00013[e] nan\n", "EX_cpd11640[e] H2 nan\n" ] } ], "source": [ "import copy\n", "for e in model_full.exchanges:\n", " if e.id not in base_n2_light1_2:\n", " cpd = list(e.metabolites)[0]\n", " m = copy.deepcopy(base_n2_light1_2)\n", " m.update({e.id: 1})\n", " model_full.medium = m\n", " v = model_full.slim_optimize()\n", " print(e.id, cpd.name, v)" ] }, { "cell_type": "code", "execution_count": 300, "id": "b9465612-d90f-49e4-a897-90bdf444c7a7", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "ATP_syn_l__hc 4.075736423833654\n", "ATP_syn_p__hc 0.13238801433210912\n", "ATP_syn_l__vc 11.591623093233354\n", "ATP_syn_p__vc 1.5455133470271156\n" ] }, { "data": { "text/html": [ "

Objective

1.0 biomass_eq_33047__vc = 0.18240098144907063

Uptake

\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
MetaboliteReactionFluxC-NumberC-Flux
hvphoton1[e]EX_PHO161.3500.00%
hvphoton2[e]EX_PHO251.0300.00%
cpd00009[e]EX_cpd00009[e]0.0781300.00%
cpd00034[e]EX_cpd00034[e]0.000593500.00%
cpd00048[e]EX_cpd00048[e]0.0704100.00%
cpd00058[e]EX_cpd00058[e]0.000593500.00%
cpd00063[e]EX_cpd00063[e]0.000889300.00%
cpd00067[e]EX_cpd00067[e]19.4800.00%
cpd00149[e]EX_cpd00149[e]0.000637300.00%
cpd00205[e]EX_cpd00205[e]0.0333800.00%
cpd00242[e]EX_cpd00242[e]8.4861100.00%
cpd00254[e]EX_cpd00254[e]0.00563500.00%
cpd00528[e]EX_cpd00528[e]0.677200.00%
cpd00971[e]EX_cpd00971[e]0.000742400.00%
cpd10515[e]EX_cpd10515[e]0.00280300.00%
cpd11574[e]EX_cpd11574[e]0.000593500.00%
cpd20863[e]EX_cpd20863[e]0.000593500.00%

Secretion

\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
MetaboliteReactionFluxC-NumberC-Flux
cpd02791[hc]DM_cpd02791__hc-0.000115968.65%
cpd02791[vc]DM_cpd02791__vc-0.001159686.46%
cpd15380[hc]DM_cpd15380__hc-3.979E-0650.25%
cpd15380[vc]DM_cpd15380__vc-3.979E-0552.47%
dialurate[hc]DM_dialurate__hc-3.979E-0640.20%
dialurate[vc]DM_dialurate__vc-3.979E-0541.98%
cpd00001[e]EX_cpd00001[e]-2.02700.00%
cpd00007[e]EX_cpd00007[e]-10.2800.00%
" ], "text/plain": [ "" ] }, "execution_count": 300, "metadata": {}, "output_type": "execute_result" } ], "source": [ "model_full.medium = default_medium\n", "# 61.35 51.03 0.18240098144906766\n", "sol = cobra.flux_analysis.pfba(model_full)\n", "for r in ['ATP_syn_l__hc', 'ATP_syn_p__hc', 'ATP_syn_l__vc', 'ATP_syn_p__vc']:\n", " print(r, sol.fluxes[r])\n", " \n", "model_full.summary(sol)" ] }, { "cell_type": "code", "execution_count": 231, "id": "0d7d8a12-514f-48e1-9fff-f213a7ffb8b5", "metadata": {}, "outputs": [], "source": [ "ws = 87388 # Anabaena sp. ATCC 33047\n", "genome = kbase.get_from_ws('GCF_001597855.1.RAST', ws)" ] }, { "cell_type": "code", "execution_count": 233, "id": "d926794b-c22a-4430-a9d9-233d86f6282b", "metadata": { "collapsed": true, "jupyter": { "outputs_hidden": true }, "tags": [] }, "outputs": [ { "data": { "text/plain": [ "[{'parameters': ['-a',\n", " '-g',\n", " 200,\n", " '-m',\n", " 5,\n", " '-d',\n", " '/opt/patric-common/data/kmer_metadata_v2',\n", " '-u',\n", " 'http://pear.mcs.anl.gov:6100/query'],\n", " 'id': '2D3A7502-0132-11EC-BA47-A5E5BBF382BD',\n", " 'hostname': 'pear',\n", " 'tool_name': 'kmer_search',\n", " 'execution_time': 1629407556.04401},\n", " {'tool_name': 'KmerAnnotationByFigfam',\n", " 'execution_time': 1629407556.23076,\n", " 'hostname': 'pear',\n", " 'parameters': ['annotate_hypothetical_only=1',\n", " 'dataset_name=Release70',\n", " 'kmer_size=8'],\n", " 'id': '2D56F4FC-0132-11EC-BA47-A5E5BBF382BD'},\n", " {'id': '2F2423F4-0132-11EC-BBE9-4688BCF382BD',\n", " 'parameters': [],\n", " 'tool_name': 'annotate_proteins_similarity',\n", " 'hostname': 'pear',\n", " 'execute_time': 1629407559.25314}]" ] }, "execution_count": 233, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from modelseedpy import RastClient, MSBuilder\n", "rast = RastClient()\n", "rast.annotate_genome(genome)" ] }, { "cell_type": "code", "execution_count": 234, "id": "ebf163e3-2c19-4a06-8117-e9488617dd80", "metadata": {}, "outputs": [], "source": [ "template_core = kbase.get_from_ws('CoreBacteriaTest_FIX', 82183)" ] }, { "cell_type": "code", "execution_count": 237, "id": "654d3bd5-da89-47c8-98de-5563d685953c", "metadata": {}, "outputs": [], "source": [ "builder = MSBuilder(genome, template_core)" ] }, { "cell_type": "code", "execution_count": 238, "id": "ca99ee5e-c3a5-41f7-ad40-4109f67f92b0", "metadata": {}, "outputs": [], "source": [ "model_test = builder.build('m', '0', False, False)" ] }, { "cell_type": "code", "execution_count": 277, "id": "66b97d8b-2f6e-4945-9b5d-846b8b189109", "metadata": {}, "outputs": [ { "ename": "AttributeError", "evalue": "DictList has no attribute or entry ATP_syn_p_p", "output_type": "error", "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mKeyError\u001b[0m Traceback (most recent call last)", "\u001b[0;32m/usr/local/lib/python3.8/site-packages/cobra/core/dictlist.py\u001b[0m in \u001b[0;36m__getattr__\u001b[0;34m(self, attr)\u001b[0m\n\u001b[1;32m 454\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 455\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mDictList\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget_by_id\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mattr\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 456\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mKeyError\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.8/site-packages/cobra/core/dictlist.py\u001b[0m in \u001b[0;36mget_by_id\u001b[0;34m(self, id)\u001b[0m\n\u001b[1;32m 57\u001b[0m \u001b[0;34m\"\"\"return the element with a matching id\"\"\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 58\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mlist\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__getitem__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_dict\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mid\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 59\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;31mKeyError\u001b[0m: 'ATP_syn_p_p'", "\nDuring handling of the above exception, another exception occurred:\n", "\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)", "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mmodel_full\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mreactions\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mATP_syn_p_p\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", "\u001b[0;32m/usr/local/lib/python3.8/site-packages/cobra/core/dictlist.py\u001b[0m in \u001b[0;36m__getattr__\u001b[0;34m(self, attr)\u001b[0m\n\u001b[1;32m 455\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mDictList\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget_by_id\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mattr\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 456\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mKeyError\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 457\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mAttributeError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"DictList has no attribute or entry %s\"\u001b[0m \u001b[0;34m%\u001b[0m \u001b[0mattr\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 458\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 459\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m__dir__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;31mAttributeError\u001b[0m: DictList has no attribute or entry ATP_syn_p_p" ] } ], "source": [ "model_full.reactions.ATP_syn_p_p" ] }, { "cell_type": "code", "execution_count": 262, "id": "bf4d9ddd-c547-42d2-b571-eb41758421bf", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'RAST': ['Pyruvate decarboxylase (EC 4.1.1.1)',\n", " 'Indole-3-pyruvate decarboxylase (EC 4.1.1.74)']}" ] }, "execution_count": 262, "metadata": {}, "output_type": "execute_result" } ], "source": [ "genome.features.A3776_RS09565.ontology_terms" ] }, { "cell_type": "code", "execution_count": 335, "id": "286f4135-480f-4fca-9faa-e2d1562a5b1c", "metadata": {}, "outputs": [], "source": [ "from cobra.core.gene import parse_gpr\n", "expr, variables = parse_gpr(\"a or (b and c)\")" ] }, { "cell_type": "code", "execution_count": null, "id": "0ba5cea6-5e88-42c3-a264-315e28127db0", "metadata": {}, "outputs": [], "source": [ "import pyea" ] }, { "cell_type": "code", "execution_count": 342, "id": "ef75eea1-77a0-4abd-8620-90dbc36e3236", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[<_ast.Name at 0x7fcbc4c76f40>, <_ast.BoolOp at 0x7fcbc4c768e0>]" ] }, "execution_count": 342, "metadata": {}, "output_type": "execute_result" } ], "source": [ "expr.body.values" ] }, { "cell_type": "code", "execution_count": 325, "id": "25d3389a-53c8-4a02-976d-08d20734c27a", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "rxn00549_c0: cpd00001_c0 + cpd00290_c0 --> cpd00009_c0 + cpd00072_c0 (A3776_RS07680) or (A3776_RS19020)\n", "rxn00549__vc: cpd00001[vc] + cpd00290[vc] --> cpd00009[vc] + cpd00072[vc] A3776_RS07680 or A3776_RS19020\n", "rxn00549__hc: cpd00001[hc] + cpd00290[hc] --> cpd00009[hc] + cpd00072[hc] A3776_RS07680 or A3776_RS19020\n", "\n", "rxn14427_c0: 4 cpd00067_c0 + cpd00209_c0 + cpd18074_c0 --> cpd00001_c0 + 2 cpd00067_e0 + cpd00075_c0 + cpd18072_c0 (A3776_RS11430) or (A3776_RS11430)\n", "\n", "rxn05040_c0: cpd00171_c0 --> cpd00047_c0 + cpd00067_c0 + cpd11225_c0 (A3776_RS22120)\n", "rxn05040__vc: cpd00171[vc] --> cpd00047[vc] + cpd00067[vc] + cpd11225[vc] A3776_RS22120\n", "rxn05040__hc: cpd00171[hc] --> cpd00047[hc] + cpd00067[hc] + cpd11225[hc] A3776_RS22120\n", "\n", "rxn00545_c0: cpd00002_c0 + cpd00072_c0 --> cpd00008_c0 + cpd00067_c0 + cpd00290_c0 (A3776_RS16105)\n", "\n", "rxn08977_c0: cpd00005_c0 + cpd00067_c0 + cpd15560_c0 --> cpd00006_c0 + cpd15561_c0 (A3776_RS00950)\n", "\n", "rxn01333_c0: cpd00102_c0 + cpd00238_c0 <=> cpd00072_c0 + cpd00236_c0 (A3776_RS22325) or (A3776_RS19015) or (A3776_RS04325)\n", "rxn01333__vc: cpd00102[vc] + cpd00238[vc] <=> cpd00072[vc] + cpd00236[vc] A3776_RS19015 or A3776_RS22325 or A3776_RS04325\n", "rxn01333__hc: cpd00102[hc] + cpd00238[hc] <=> cpd00072[hc] + cpd00236[hc] A3776_RS19015 or A3776_RS22325 or A3776_RS04325\n", "\n", "rxn00224_c0: cpd01476_c0 + cpd10515_c0 <=> cpd00028_c0 + 2 cpd00067_c0 (A3776_RS09410) or (A3776_RS07385)\n", "rxn00224__vc: cpd01476[vc] + cpd10515[vc] --> cpd00028[vc] + 2.0 cpd00067[vc] A3776_RS09410 or A3776_RS07385\n", "rxn00224__hc: cpd01476[hc] + cpd10515[hc] --> cpd00028[hc] + 2.0 cpd00067[hc] A3776_RS09410 or A3776_RS07385\n", "\n", "rxn00256_c0: cpd00010_c0 + cpd00067_c0 + cpd00137_c0 <-- cpd00001_c0 + cpd00022_c0 + cpd00032_c0 (A3776_RS06235)\n", "rxn00256__vc: cpd00001[vc] + cpd00022[vc] + cpd00032[vc] --> cpd00010[vc] + cpd00067[vc] + cpd00137[vc] A3776_RS06235\n", "rxn00256__hc: cpd00001[hc] + cpd00022[hc] + cpd00032[hc] --> cpd00010[hc] + cpd00067[hc] + cpd00137[hc] A3776_RS06235\n", "\n", "rxn00011_c0: cpd00011_c0 + cpd03049_c0 <-- cpd00020_c0 + cpd00056_c0 + cpd00067_c0 (A3776_RS09565) or (A3776_RS09185 and A3776_RS21415) or (A3776_RS15740 and A3776_RS20500)\n", "rxn00011__vc: cpd00020[vc] + cpd00056[vc] + cpd00067[vc] --> cpd00011[vc] + cpd03049[vc] A3776_RS09185 and ( A3776_RS21415 or A3776_RS06445 )\n", "rxn00011__hc: cpd00020[hc] + cpd00056[hc] + cpd00067[hc] --> cpd00011[hc] + cpd03049[hc] A3776_RS09185 and ( A3776_RS21415 or A3776_RS06445 )\n", "\n", "rxn09272_c0: cpd00036_c0 + cpd15560_c0 --> cpd00106_c0 + cpd15561_c0 (A3776_RS02410) or (A3776_RS03685) or (A3776_RS21955)\n", "rxn09272__vc: cpd00036[vc] + cpd07274[vl] --> cpd00106[vc] + cpd16503[vl] A3776_RS02410 and A3776_RS21955\n", "rxn09272__hc: cpd00036[hc] + cpd07274[hl] --> cpd00106[hc] + cpd16503[hl] A3776_RS02410 and A3776_RS21955\n", "\n", "rxn00747_c0: cpd00102_c0 <=> cpd00095_c0 (A3776_RS10895)\n", "rxn00747__vc: cpd00102[vc] <=> cpd00095[vc] A3776_RS10895\n", "rxn00747__hc: cpd00102[hc] <=> cpd00095[hc] A3776_RS10895\n", "\n", "rxn05602_c0: cpd00067_e0 + cpd00159_e0 <=> cpd00067_c0 + cpd00159_c0 (A3776_RS08485)\n", "rxn05602__vc: cpd00067[vp] + cpd00159[vp] <=> cpd00067[vc] + cpd00159[vc] A3776_RS08485\n", "rxn05602__hc: cpd00067[hp] + cpd00159[hp] <=> cpd00067[hc] + cpd00159[hc] A3776_RS08485\n", "\n", "rxn05937_c0: cpd00006_c0 + cpd00067_c0 + cpd11620_c0 --> cpd00005_c0 + cpd11621_c0 (A3776_RS06700)\n", "rxn05937__vc: cpd00006[vc] + cpd00067[vc] + 2.0 cpd11620[vc] <=> cpd00005[vc] + 2.0 cpd11621[vc] A3776_RS06700\n", "rxn05937__hc: cpd00006[hc] + cpd00067[hc] + 2.0 cpd11620[hc] <=> cpd00005[hc] + 2.0 cpd11621[hc] A3776_RS06700\n", "\n", "rxn00785_c0: cpd00072_c0 + cpd00102_c0 <=> cpd00198_c0 + cpd00236_c0 (A3776_RS03700) or (A3776_RS10870) or (A3776_RS08320)\n", "rxn00785__vc: cpd00072[vc] + cpd00102[vc] <=> cpd00198[vc] + cpd00236[vc] A3776_RS03700 or A3776_RS10870 or A3776_RS08320\n", "rxn00785__hc: cpd00072[hc] + cpd00102[hc] <=> cpd00198[hc] + cpd00236[hc] A3776_RS03700 or A3776_RS10870 or A3776_RS08320\n", "\n", "rxn00974_c0: cpd00137_c0 <=> cpd00001_c0 + cpd00331_c0 (A3776_RS00425)\n", "\n", "rxn05209_c0: cpd00067_c0 + cpd00971_e0 <=> cpd00067_e0 + cpd00971_c0 (A3776_RS10835) or (A3776_RS13785) or (A3776_RS10605) or (A3776_RS09210) or (A3776_RS05940) or (A3776_RS03490) or (A3776_RS03495) or (A3776_RS10835) or (A3776_RS13785) or (A3776_RS10605) or (A3776_RS09210) or (A3776_RS05940) or (A3776_RS03480) or (A3776_RS03470) or (A3776_RS14385) or (A3776_RS15950) or (A3776_RS03475) or (A3776_RS03465) or (A3776_RS03485)\n", "rxn05209__vc: cpd00067[vc] + cpd00971[vp] <=> cpd00067[vp] + cpd00971[vc] Unknown\n", "rxn05209__hc: cpd00067[hc] + cpd00971[hp] <=> cpd00067[hp] + cpd00971[hc] Unknown\n", "\n", "rxn01116_c0: cpd00171_c0 <=> cpd00198_c0 (A3776_RS21850)\n", "rxn01116__vc: cpd00171[vc] <=> cpd00198[vc] A3776_RS21850\n", "rxn01116__hc: cpd00171[hc] <=> cpd00198[hc] A3776_RS21850\n", "\n", "rxn00777_c0: cpd00101_c0 <=> cpd00171_c0 (A3776_RS09340)\n", "rxn00777__vc: cpd00101[vc] <=> cpd00171[vc] A3776_RS09340\n", "rxn00777__hc: cpd00101[hc] <=> cpd00171[hc] A3776_RS09340\n", "\n", "rxn00285_c0: cpd00002_c0 + cpd00010_c0 + cpd00036_c0 <=> cpd00008_c0 + cpd00009_c0 + cpd00078_c0 (A3776_RS12785 and A3776_RS12790)\n", "rxn00285__vc: cpd00002[vc] + cpd00010[vc] + cpd00036[vc] <=> cpd00008[vc] + cpd00009[vc] + cpd00078[vc] A3776_RS12785 and A3776_RS12790\n", "rxn00285__hc: cpd00002[hc] + cpd00010[hc] + cpd00036[hc] <=> cpd00008[hc] + cpd00009[hc] + cpd00078[hc] A3776_RS12785 and A3776_RS12790\n", "\n", "rxn01115_c0: cpd00006_c0 + cpd00284_c0 --> cpd00005_c0 + cpd00011_c0 + cpd00171_c0 (A3776_RS16830)\n", "rxn01115__vc: cpd00006[vc] + cpd00284[vc] --> cpd00005[vc] + cpd00011[vc] + cpd00171[vc] A3776_RS16830\n", "rxn01115__hc: cpd00006[hc] + cpd00284[hc] --> cpd00005[hc] + cpd00011[hc] + cpd00171[hc] A3776_RS16830\n", "\n", "rxn00147_c0: cpd00001_c0 + cpd00002_c0 + cpd00020_c0 --> cpd00009_c0 + cpd00018_c0 + cpd00061_c0 + 3 cpd00067_c0 (A3776_RS16060) or (A3776_RS01500) or (A3776_RS18135)\n", "rxn00147__vc: cpd00001[vc] + cpd00002[vc] + cpd00020[vc] --> cpd00009[vc] + cpd00018[vc] + cpd00061[vc] + 3.0 cpd00067[vc] A3776_RS01500 or A3776_RS16060 or A3776_RS18135 or A3776_RS15970\n", "rxn00147__hc: cpd00001[hc] + cpd00002[hc] + cpd00020[hc] --> cpd00009[hc] + cpd00018[hc] + cpd00061[hc] + 3.0 cpd00067[hc] A3776_RS01500 or A3776_RS16060 or A3776_RS18135 or A3776_RS15970\n", "\n", "rxn01241_c0: cpd00003_c0 + cpd00449_c0 <=> cpd00004_c0 + cpd00067_c0 + cpd00213_c0 (A3776_RS19200) or (A3776_RS19200)\n", "rxn01241__vc: cpd00003[vc] + cpd00449[vc] <=> cpd00004[vc] + cpd00067[vc] + cpd00213[vc] A3776_RS19200\n", "rxn01241__hc: cpd00003[hc] + cpd00449[hc] <=> cpd00004[hc] + cpd00067[hc] + cpd00213[hc] A3776_RS19200\n", "\n", "rxn01187_c0: cpd00009_c0 + cpd00198_c0 --> cpd00001_c0 + cpd00102_c0 + cpd00196_c0 (A3776_RS22340)\n", "rxn01187__vc: cpd00009[vc] + cpd00198[vc] --> cpd00001[vc] + cpd00102[vc] + cpd00196[vc] A3776_RS22340\n", "rxn01187__hc: cpd00009[hc] + cpd00198[hc] --> cpd00001[hc] + cpd00102[hc] + cpd00196[hc] A3776_RS22340\n", "\n", "rxn00122_c0: cpd00002_c0 + cpd00050_c0 --> cpd00012_c0 + cpd00015_c0 (A3776_RS01880)\n", "rxn00122__vc: cpd00002[vc] + cpd00050[vc] --> cpd00012[vc] + cpd00015[vc] A3776_RS01880\n", "rxn00122__hc: cpd00002[hc] + cpd00050[hc] --> cpd00012[hc] + cpd00015[hc] A3776_RS01880\n", "\n", "rxn04794_c0: cpd00010_c0 + cpd00094_c0 <=> cpd00047_c0 + cpd00086_c0 (A3776_RS06860)\n", "\n", "rxn00543_c0: cpd00003_c0 + cpd00363_c0 <=> cpd00004_c0 + cpd00067_c0 + cpd00071_c0 (A3776_RS09485) or (A3776_RS06850)\n", "rxn00543__vc: cpd00004[vc] + cpd00067[vc] + cpd00071[vc] --> cpd00003[vc] + cpd00363[vc] A3776_RS06850 or A3776_RS09485\n", "rxn00543__hc: cpd00004[hc] + cpd00067[hc] + cpd00071[hc] --> cpd00003[hc] + cpd00363[hc] A3776_RS06850 or A3776_RS09485\n", "\n", "rxn00506_c0: cpd00001_c0 + cpd00003_c0 + cpd00071_c0 --> cpd00004_c0 + cpd00029_c0 + 2 cpd00067_c0 (A3776_RS19000) or (A3776_RS02000) or (A3776_RS06130)\n", "rxn00506__vc: cpd00004[vc] + cpd00029[vc] + 2.0 cpd00067[vc] --> cpd00001[vc] + cpd00003[vc] + cpd00071[vc] A3776_RS02000 or A3776_RS19000\n", "rxn00506__hc: cpd00004[hc] + cpd00029[hc] + 2.0 cpd00067[hc] --> cpd00001[hc] + cpd00003[hc] + cpd00071[hc] A3776_RS02000 or A3776_RS19000\n", "\n", "rxn00225_c0: cpd00002_c0 + cpd00029_c0 <=> cpd00008_c0 + cpd00196_c0 (A3776_RS22320)\n", "rxn00225__vc: cpd00002[vc] + cpd00029[vc] --> cpd00008[vc] + cpd00196[vc] A3776_RS22320\n", "rxn00225__hc: cpd00002[hc] + cpd00029[hc] --> cpd00008[hc] + cpd00196[hc] A3776_RS22320\n", "\n", "rxn05145_c0: cpd00001_c0 + cpd00002_c0 + cpd00009_e0 --> cpd00008_c0 + 2 cpd00009_c0 + cpd00067_c0 (A3776_RS18750) or (A3776_RS05535) or (A3776_RS21700) or (A3776_RS20835) or (A3776_RS00795) or (A3776_RS15490) or (A3776_RS15165) or (A3776_RS15495) or (A3776_RS15160) or (A3776_RS15500) or (A3776_RS15155) or (A3776_RS15505) or (A3776_RS15170) or (A3776_RS02990) or (A3776_RS15485)\n", "rxn05145__vc: cpd00001[vc] + cpd00002[vc] + cpd00009[vp] --> cpd00008[vc] + 2.0 cpd00009[vc] + cpd00067[vc] ( A3776_RS15160 or A3776_RS15495 ) and ( A3776_RS15155 or A3776_RS15500 or A3776_RS15505 ) and ( A3776_RS15165 or A3776_RS15490 ) and ( A3776_RS02990 or A3776_RS15170 or A3776_RS15485 )\n", "rxn05145__hc: cpd00001[hc] + cpd00002[hc] + cpd00009[hp] --> cpd00008[hc] + 2.0 cpd00009[hc] + cpd00067[hc] ( A3776_RS15160 or A3776_RS15495 ) and ( A3776_RS15155 or A3776_RS15500 or A3776_RS15505 ) and ( A3776_RS15165 or A3776_RS15490 ) and ( A3776_RS02990 or A3776_RS15170 or A3776_RS15485 )\n", "\n", "rxn01106_c0: cpd00482_c0 <=> cpd00169_c0 (A3776_RS15870) or (A3776_RS03430)\n", "rxn01106__vc: cpd00482[vc] <=> cpd00169[vc] A3776_RS03430 or A3776_RS15870\n", "rxn01106__hc: cpd00482[hc] <=> cpd00169[hc] A3776_RS03430 or A3776_RS15870\n", "\n", "rxn01334_c0: cpd00349_c0 <=> cpd00095_c0 + cpd00236_c0 (A3776_RS20005) or (A3776_RS20480)\n", "rxn01334__vc: cpd00349[vc] <=> cpd00095[vc] + cpd00236[vc] A3776_RS20005 or A3776_RS20480\n", "rxn01334__hc: cpd00349[hc] <=> cpd00095[hc] + cpd00236[hc] A3776_RS20005 or A3776_RS20480\n", "\n", "rxn00786_c0: cpd00290_c0 <=> cpd00095_c0 + cpd00102_c0 (A3776_RS20005) or (A3776_RS20480)\n", "rxn00786__vc: cpd00290[vc] <=> cpd00095[vc] + cpd00102[vc] A3776_RS20005 or A3776_RS20480\n", "rxn00786__hc: cpd00290[hc] <=> cpd00095[hc] + cpd00102[hc] A3776_RS20005 or A3776_RS20480\n", "\n", "rxn00869_c0: cpd00003_c0 + cpd00010_c0 + cpd01011_c0 <-- cpd00004_c0 + cpd00067_c0 + cpd00120_c0 (A3776_RS06850)\n", "rxn00869__vc: cpd00003[vc] + cpd00010[vc] + cpd01011[vc] <=> cpd00004[vc] + cpd00067[vc] + cpd00120[vc] A3776_RS06850\n", "rxn00869__hc: cpd00003[hc] + cpd00010[hc] + cpd01011[hc] <=> cpd00004[hc] + cpd00067[hc] + cpd00120[hc] A3776_RS06850\n", "\n", "rxn05627_c0: cpd00067_e0 + cpd00209_e0 --> cpd00067_c0 + cpd00209_c0 (A3776_RS11430) or (A3776_RS11430)\n", "\n", "rxn01343_c0: cpd00002_c0 + cpd00238_c0 --> cpd00008_c0 + cpd00067_c0 + cpd00349_c0 (A3776_RS16105)\n", "rxn01343__vc: cpd00002[vc] + cpd00238[vc] --> cpd00008[vc] + cpd00067[vc] + cpd00349[vc] A3776_RS16105\n", "rxn01343__hc: cpd00002[hc] + cpd00238[hc] --> cpd00008[hc] + cpd00067[hc] + cpd00349[hc] A3776_RS16105\n", "\n", "rxn05528_c0: cpd00001_c0 + cpd00002_c0 + cpd00058_c0 --> cpd00008_c0 + cpd00009_c0 + cpd00058_e0 + cpd00067_c0 (A3776_RS17745) or (A3776_RS18685) or (A3776_RS17740) or (A3776_RS12080) or (A3776_RS06845)\n", "rxn05528__vc: cpd00001[vc] + cpd00002[vc] + cpd00058[vc] --> cpd00008[vc] + cpd00009[vc] + cpd00058[vp] + cpd00067[vc] A3776_RS06845 or A3776_RS12890 or A3776_RS17740 or A3776_RS17745\n", "rxn05528__hc: cpd00001[hc] + cpd00002[hc] + cpd00058[hc] --> cpd00008[hc] + cpd00009[hc] + cpd00058[hp] + cpd00067[hc] A3776_RS06845 or A3776_RS12890 or A3776_RS17740 or A3776_RS17745\n", "\n", "rxn02342_c0: cpd00213_c0 + cpd03049_c0 --> cpd00056_c0 + cpd00836_c0 (A3776_RS15740 and A3776_RS20500)\n", "\n", "rxn00148_c0: cpd00002_c0 + cpd00020_c0 <-- cpd00008_c0 + cpd00061_c0 + cpd00067_c0 (A3776_RS05300) or (A3776_RS22330)\n", "rxn00148__vc: cpd00008[vc] + cpd00061[vc] + cpd00067[vc] --> cpd00002[vc] + cpd00020[vc] A3776_RS05300 or A3776_RS22330 or A3776_RS16050\n", "rxn00148__hc: cpd00008[hc] + cpd00061[hc] + cpd00067[hc] --> cpd00002[hc] + cpd00020[hc] A3776_RS05300 or A3776_RS22330 or A3776_RS16050\n", "\n", "rxn00199_c0: cpd00067_c0 + cpd03187_c0 --> cpd00011_c0 + cpd00024_c0 (A3776_RS20350)\n", "\n", "rxn00615_c0: cpd00002_c0 + cpd00100_c0 --> cpd00008_c0 + cpd00067_c0 + cpd00080_c0 (A3776_RS19965)\n", "rxn00615__vc: cpd00002[vc] + cpd00100[vc] --> cpd00008[vc] + cpd00067[vc] + cpd00080[vc] A3776_RS19965\n", "rxn00615__hc: cpd00002[hc] + cpd00100[hc] --> cpd00008[hc] + cpd00067[hc] + cpd00080[hc] A3776_RS19965\n", "\n", "rxn00392_c0: cpd00002_c0 + cpd00220_c0 <=> cpd00008_c0 + cpd00050_c0 + cpd00067_c0 (A3776_RS01880)\n", "rxn00392__vc: cpd00002[vc] + cpd00220[vc] --> cpd00008[vc] + cpd00050[vc] A3776_RS01880\n", "rxn00392__hc: cpd00002[hc] + cpd00220[hc] --> cpd00008[hc] + cpd00050[hc] A3776_RS01880\n", "\n", "rxn00083_c0: cpd00003_c0 + cpd00005_c0 --> cpd00004_c0 + cpd00006_c0 (A3776_RS04700) or (A3776_RS04690) or (A3776_RS04695)\n", "\n", "rxn00161_c0: cpd00006_c0 + cpd00130_c0 --> cpd00005_c0 + cpd00011_c0 + cpd00020_c0 (A3776_RS21625)\n", "rxn00161__vc: cpd00006[vc] + cpd00130[vc] --> cpd00005[vc] + cpd00011[vc] + cpd00020[vc] A3776_RS21625\n", "rxn00161__hc: cpd00006[hc] + cpd00130[hc] --> cpd00005[hc] + cpd00011[hc] + cpd00020[hc] A3776_RS21625\n", "\n", "rxn00985_c0: cpd00002_c0 + cpd00141_c0 <=> cpd00008_c0 + cpd01844_c0 (A3776_RS22320)\n", "\n", "rxn14418_c0: cpd15561_c0 + cpd18075_c0 --> 2 cpd00067_e0 + cpd15560_c0 + cpd18076_c0 (A3776_RS02530) or (A3776_RS02530) or (A3776_RS02530 and A3776_RS02525) or (A3776_RS02525)\n", "\n", "rxn00171_c0: cpd00003_c0 + cpd00010_c0 + cpd00071_c0 <=> cpd00004_c0 + cpd00022_c0 + cpd00067_c0 (A3776_RS06850) or (A3776_RS09485) or (A3776_RS06850)\n", "rxn00171__vc: cpd00004[vc] + cpd00022[vc] + cpd00067[vc] --> cpd00003[vc] + cpd00010[vc] + cpd00071[vc] A3776_RS06850\n", "rxn00171__hc: cpd00004[hc] + cpd00022[hc] + cpd00067[hc] --> cpd00003[hc] + cpd00010[hc] + cpd00071[hc] A3776_RS06850\n", "\n", "rxn14420_c0: cpd15499_c0 + cpd18075_c0 --> 2 cpd00067_e0 + cpd15500_c0 + cpd18076_c0 (A3776_RS02530) or (A3776_RS02530 and A3776_RS02525) or (A3776_RS08000)\n", "\n", "rxn00248_c0: cpd00003_c0 + cpd00130_c0 <=> cpd00004_c0 + cpd00032_c0 + cpd00067_c0 (A3776_RS07725)\n", "rxn00248__vc: cpd00003[vc] + cpd00130[vc] <=> cpd00004[vc] + cpd00032[vc] + cpd00067[vc] A3776_RS07725\n", "rxn00248__hc: cpd00003[hc] + cpd00130[hc] <=> cpd00004[hc] + cpd00032[hc] + cpd00067[hc] A3776_RS07725\n", "\n", "rxn00604_c0: cpd00006_c0 + cpd00079_c0 --> cpd00005_c0 + cpd00067_c0 + cpd00911_c0 (A3776_RS19010)\n", "rxn00604__vc: cpd00006[vc] + cpd00079[vc] --> cpd00005[vc] + cpd00067[vc] + cpd00911[vc] A3776_RS19010\n", "rxn00604__hc: cpd00006[hc] + cpd00079[hc] --> cpd00005[hc] + cpd00067[hc] + cpd00911[hc] A3776_RS19010\n", "\n", "rxn00371_c0: cpd00003_c0 + cpd00047_c0 --> cpd00004_c0 + cpd00011_c0 (A3776_RS10715)\n", "\n", "rxn01100_c0: cpd00002_c0 + cpd00169_c0 <=> cpd00008_c0 + cpd00203_c0 (A3776_RS01285)\n", "rxn01100__vc: cpd00002[vc] + cpd00169[vc] <=> cpd00008[vc] + cpd00203[vc] A3776_RS01285\n", "rxn01100__hc: cpd00002[hc] + cpd00169[hc] <=> cpd00008[hc] + cpd00203[hc] A3776_RS01285\n", "\n", "rxn00216_c0: cpd00002_c0 + cpd00027_c0 <=> cpd00008_c0 + cpd00067_c0 + cpd00079_c0 (A3776_RS11205)\n", "rxn00216__vc: cpd00002[vc] + cpd00027[vc] --> cpd00008[vc] + cpd00067[vc] + cpd00079[vc] A3776_RS02165 or A3776_RS03075 or A3776_RS11205\n", "rxn00216__hc: cpd00002[hc] + cpd00027[hc] --> cpd00008[hc] + cpd00067[hc] + cpd00079[hc] A3776_RS02165 or A3776_RS03075 or A3776_RS11205\n", "\n", "rxn08655_c0: cpd00139_c0 + cpd15560_c0 --> cpd00040_c0 + cpd15561_c0 (A3776_RS17185 and A3776_RS17180 and A3776_RS21160)\n", "\n", "rxn00175_c0: cpd00002_c0 + cpd00010_c0 + cpd00029_c0 --> cpd00012_c0 + cpd00018_c0 + cpd00022_c0 + cpd00067_c0 (A3776_RS18320)\n", "rxn00175__vc: cpd00002[vc] + cpd00010[vc] + cpd00029[vc] --> cpd00012[vc] + cpd00018[vc] + cpd00022[vc] + cpd00067[vc] A3776_RS18320\n", "rxn00175__hc: cpd00002[hc] + cpd00010[hc] + cpd00029[hc] --> cpd00012[hc] + cpd00018[hc] + cpd00022[hc] + cpd00067[hc] A3776_RS18320\n", "\n", "rxn00763_c0: cpd00003_c0 + cpd00100_c0 <=> cpd00004_c0 + cpd00067_c0 + cpd00448_c0 (A3776_RS09485) or (A3776_RS06850)\n", "rxn00763__vc: cpd00004[vc] + cpd00067[vc] + cpd00448[vc] --> cpd00003[vc] + cpd00100[vc] A3776_RS01770 or A3776_RS06850 or A3776_RS09485\n", "rxn00763__hc: cpd00004[hc] + cpd00067[hc] + cpd00448[hc] --> cpd00003[hc] + cpd00100[hc] A3776_RS01770 or A3776_RS06850 or A3776_RS09485\n", "\n", "rxn01476_c0: cpd00001_c0 + cpd00911_c0 --> cpd00067_c0 + cpd00284_c0 (A3776_RS11870)\n", "rxn01476__vc: cpd00001[vc] + cpd00911[vc] --> cpd00067[vc] + cpd00284[vc] A3776_RS11870\n", "rxn01476__hc: cpd00001[hc] + cpd00911[hc] --> cpd00067[hc] + cpd00284[hc] A3776_RS11870\n", "\n", "rxn05625_c0: cpd00067_e0 + cpd00075_e0 <=> cpd00067_c0 + cpd00075_c0 (A3776_RS11430) or (A3776_RS11430)\n", "\n", "rxn06493_c0: cpd00003_c0 + cpd12225_c0 <=> cpd00004_c0 + cpd00067_c0 + cpd12005_c0 (A3776_RS19200) or (A3776_RS14650 and A3776_RS14655) or (A3776_RS14655)\n", "rxn06493__vc: cpd00003[vc] + cpd12225[vc] <=> cpd00004[vc] + cpd00067[vc] + cpd12005[vc] A3776_RS19200\n", "rxn06493__hc: cpd00003[hc] + cpd12225[hc] <=> cpd00004[hc] + cpd00067[hc] + cpd12005[hc] A3776_RS19200\n", "\n", "rxn01388_c0: cpd00260_c0 <=> cpd00001_c0 + cpd00331_c0 (A3776_RS00425)\n", "\n", "rxn00459_c0: cpd00482_c0 <=> cpd00001_c0 + cpd00061_c0 (A3776_RS22110)\n", "rxn00459__vc: cpd00482[vc] <=> cpd00001[vc] + cpd00061[vc] A3776_RS22110\n", "rxn00459__hc: cpd00482[hc] <=> cpd00001[hc] + cpd00061[hc] A3776_RS22110\n", "\n", "rxn01275_c0: cpd00002_c0 + cpd00222_c0 --> cpd00008_c0 + cpd00067_c0 + cpd00284_c0 (A3776_RS23010)\n", "rxn01275__vc: cpd00002[vc] + cpd00222[vc] --> cpd00008[vc] + cpd00067[vc] + cpd00284[vc] A3776_RS23010\n", "rxn01275__hc: cpd00002[hc] + cpd00222[hc] --> cpd00008[hc] + cpd00067[hc] + cpd00284[hc] A3776_RS23010\n", "\n", "rxn01871_c0: cpd00022_c0 + cpd00449_c0 <-- cpd00010_c0 + cpd00836_c0 (A3776_RS19785)\n", "rxn01871__vc: cpd00022[vc] + cpd00449[vc] <=> cpd00010[vc] + cpd00836[vc] A3776_RS19785\n", "rxn01871__hc: cpd00022[hc] + cpd00449[hc] <=> cpd00010[hc] + cpd00836[hc] A3776_RS19785\n", "\n", "rxn01870_c0: cpd00802_c0 <=> cpd00095_c0 + cpd00448_c0 (A3776_RS20480)\n", "rxn01870__vc: cpd00802[vc] <=> cpd00095[vc] + cpd00448[vc] A3776_RS20005 or A3776_RS20480\n", "rxn01870__hc: cpd00802[hc] <=> cpd00095[hc] + cpd00448[hc] A3776_RS20005 or A3776_RS20480\n", "\n", "rxn01200_c0: cpd00102_c0 + cpd00238_c0 <=> cpd00101_c0 + cpd00198_c0 (A3776_RS03700) or (A3776_RS10870) or (A3776_RS08320)\n", "rxn01200__vc: cpd00102[vc] + cpd00238[vc] <=> cpd00101[vc] + cpd00198[vc] A3776_RS03700 or A3776_RS10870 or A3776_RS08320\n", "rxn01200__hc: cpd00102[hc] + cpd00238[hc] <=> cpd00101[hc] + cpd00198[hc] A3776_RS03700 or A3776_RS10870 or A3776_RS08320\n", "\n", "rxn14419_c0: 0.5 cpd00007_c0 + 4 cpd00067_c0 + cpd18076_c0 --> cpd00001_c0 + 2 cpd00067_e0 + cpd18075_c0 (A3776_RS02530) or (A3776_RS02530) or (A3776_RS02530 and A3776_RS02525) or (A3776_RS02525)\n", "\n", "rxn00548_c0: cpd00009_c0 + cpd00072_c0 <=> cpd00001_c0 + cpd00196_c0 + cpd00236_c0 (A3776_RS22340)\n", "rxn00548__vc: cpd00009[vc] + cpd00072[vc] --> cpd00001[vc] + cpd00196[vc] + cpd00236[vc] A3776_RS09675 or A3776_RS22340\n", "rxn00548__hc: cpd00009[hc] + cpd00072[hc] --> cpd00001[hc] + cpd00196[hc] + cpd00236[hc] A3776_RS09675 or A3776_RS22340\n", "\n", "rxn00558_c0: cpd00079_c0 <=> cpd00072_c0 (A3776_RS07090) or (A3776_RS07710)\n", "rxn00558__vc: cpd00079[vc] <=> cpd00072[vc] A3776_RS07710 or A3776_RS07090\n", "rxn00558__hc: cpd00079[hc] <=> cpd00072[hc] A3776_RS07710 or A3776_RS07090\n", "\n", "rxn00544_c0: cpd00056_c0 + cpd00071_c0 <-- cpd03049_c0 (A3776_RS09565)\n", "\n", "rxn00157_c0: cpd00022_c0 + cpd00047_c0 <-- cpd00010_c0 + cpd00020_c0 (A3776_RS06855) or (A3776_RS06860)\n", "rxn00157__vc: cpd00022[vc] + cpd00047[vc] <=> cpd00010[vc] + cpd00020[vc] A3776_RS06860\n", "rxn00157__hc: cpd00022[hc] + cpd00047[hc] <=> cpd00010[hc] + cpd00020[hc] A3776_RS06860\n", "\n", "rxn10122_c0: cpd00004_c0 + 4.5 cpd00067_c0 + cpd15560_c0 --> cpd00003_c0 + 3.5 cpd00067_e0 + cpd15561_c0 (A3776_RS00950)\n", "\n", "rxn00568_c0: 2 cpd00001_c0 + 3 cpd00003_c0 + cpd00013_c0 <-- 3 cpd00004_c0 + 5 cpd00067_c0 + cpd00075_c0 (A3776_RS11430)\n", "\n", "rxn02314_c0: cpd00002_c0 + cpd00805_c0 <=> cpd00008_c0 + cpd00067_c0 + cpd02371_c0 (A3776_RS16105)\n", "\n", "rxn03884_c0: cpd02711_c0 --> cpd00020_c0 + cpd00102_c0 (A3776_RS10780)\n", "rxn03884__vc: cpd02711[vc] <=> cpd00020[vc] + cpd00102[vc] A3776_RS10780\n", "rxn03884__hc: cpd02711[hc] <=> cpd00020[hc] + cpd00102[hc] A3776_RS10780\n", "\n", "rxn08971_c0: cpd00004_c0 + cpd00067_c0 + cpd15500_c0 --> cpd00003_c0 + cpd15499_c0 (A3776_RS10740) or (A3776_RS17150) or (A3776_RS16420) or (A3776_RS02065) or (A3776_RS17155)\n", "\n", "rxn00770_c0: cpd00002_c0 + cpd00101_c0 <=> cpd00018_c0 + cpd00067_c0 + cpd00103_c0 (A3776_RS04015)\n", "rxn00770__vc: cpd00002[vc] + cpd00101[vc] --> cpd00018[vc] + cpd00067[vc] + cpd00103[vc] A3776_RS04015\n", "rxn00770__hc: cpd00002[hc] + cpd00101[hc] --> cpd00018[hc] + cpd00067[hc] + cpd00103[hc] A3776_RS04015\n", "\n", "rxn00077_c0: cpd00002_c0 + cpd00003_c0 <=> cpd00006_c0 + cpd00008_c0 + cpd00067_c0 (A3776_RS19230) or (A3776_RS06210)\n", "rxn00077__vc: cpd00002[vc] + cpd00003[vc] --> cpd00006[vc] + cpd00008[vc] + cpd00067[vc] A3776_RS06210 or A3776_RS19230\n", "rxn00077__hc: cpd00002[hc] + cpd00003[hc] --> cpd00006[hc] + cpd00008[hc] + cpd00067[hc] A3776_RS06210 or A3776_RS19230\n", "\n", "rxn00251_c0: cpd00009_c0 + cpd00032_c0 + cpd00067_c0 <=> cpd00001_c0 + cpd00011_c0 + cpd00061_c0 (A3776_RS20435) or (A3776_RS07835) or (A3776_RS16425)\n", "rxn00251__vc: cpd00001[vc] + cpd00011[vc] + cpd00061[vc] --> cpd00009[vc] + cpd00032[vc] + cpd00067[vc] A3776_RS20435 or A3776_RS07835 or A3776_RS16425\n", "rxn00251__hc: cpd00001[hc] + cpd00011[hc] + cpd00061[hc] --> cpd00009[hc] + cpd00032[hc] + cpd00067[hc] A3776_RS20435 or A3776_RS07835 or A3776_RS16425\n", "\n", "rxn08975_c0: cpd00004_c0 + cpd00067_c0 + cpd15560_c0 --> cpd00003_c0 + cpd15561_c0 (A3776_RS10740) or (A3776_RS17150) or (A3776_RS16420) or (A3776_RS02065) or (A3776_RS17155)\n", "\n", "rxn00781_c0: cpd00003_c0 + cpd00009_c0 + cpd00102_c0 <=> cpd00004_c0 + cpd00067_c0 + cpd00203_c0 (A3776_RS22210) or (A3776_RS02985)\n", "rxn00781__vc: cpd00003[vc] + cpd00009[vc] + cpd00102[vc] --> cpd00004[vc] + cpd00067[vc] + cpd00203[vc] A3776_RS02985 or A3776_RS22335\n", "rxn00781__hc: cpd00003[hc] + cpd00009[hc] + cpd00102[hc] --> cpd00004[hc] + cpd00067[hc] + cpd00203[hc] A3776_RS02985 or A3776_RS22335\n", "\n", "rxn08656_c0: cpd00139_c0 + cpd15500_c0 --> cpd00040_c0 + cpd15499_c0 (A3776_RS17185 and A3776_RS17180 and A3776_RS21160)\n", "\n", "rxn00762_c0: cpd00003_c0 + cpd00100_c0 <=> cpd00004_c0 + cpd00067_c0 + cpd00157_c0 (A3776_RS03005)\n", "rxn00762__vc: cpd00003[vc] + cpd00100[vc] --> cpd00004[vc] + cpd00067[vc] + cpd00157[vc] A3776_RS03005\n", "rxn00762__hc: cpd00003[hc] + cpd00100[hc] --> cpd00004[hc] + cpd00067[hc] + cpd00157[hc] A3776_RS03005\n", "\n", "rxn01387_c0: cpd00006_c0 + cpd00260_c0 <=> cpd00005_c0 + cpd00067_c0 + cpd03187_c0 (A3776_RS20350)\n", "\n", "rxn00799_c0: cpd00130_c0 <=> cpd00001_c0 + cpd00106_c0 (A3776_RS00630)\n", "rxn00799__vc: cpd00130[vc] <=> cpd00001[vc] + cpd00106[vc] A3776_RS00630\n", "rxn00799__hc: cpd00130[hc] <=> cpd00001[hc] + cpd00106[hc] A3776_RS00630\n", "\n", "rxn08734_c0: 2 cpd00067_c0 + cpd11640_c0 + cpd15560_c0 --> 2 cpd00067_e0 + cpd15561_c0 (A3776_RS12315) or (A3776_RS02530) or (A3776_RS12320)\n", "\n", "rxn09001_c0: 2 cpd00067_c0 + cpd00209_c0 + cpd15561_c0 --> cpd00001_c0 + 2 cpd00067_e0 + cpd00075_c0 + cpd15560_c0 (A3776_RS11430)\n", "\n", "rxn09003_c0: 2 cpd00067_c0 + cpd00209_c0 + cpd15499_c0 --> cpd00001_c0 + 2 cpd00067_e0 + cpd00075_c0 + cpd15500_c0 (A3776_RS11430)\n", "\n", "rxn08173_c0: cpd00008_c0 + cpd00009_c0 + 4 cpd00067_e0 <=> cpd00001_c0 + cpd00002_c0 + 3 cpd00067_c0 (A3776_RS13435 and A3776_RS10975 and A3776_RS13440 and A3776_RS13445 and A3776_RS10980 and A3776_RS13470) or (A3776_RS10825 and A3776_RS13435 and A3776_RS13440 and A3776_RS13445 and A3776_RS10980 and A3776_RS13470) or (A3776_RS13465) or (A3776_RS13450) or (A3776_RS13455) or (A3776_RS13460)\n", "\n", "rxn09295_c0: cpd00004_c0 + cpd00006_c0 + 2 cpd00067_e0 --> cpd00003_c0 + cpd00005_c0 + 2 cpd00067_c0 (A3776_RS04690) or (A3776_RS04700) or (A3776_RS04695)\n", "\n", "rxn05312_c0: cpd00009_e0 + cpd00067_e0 <-- cpd00009_c0 + cpd00067_c0 (A3776_RS09530) or (A3776_RS11030)\n", "rxn05312__vc: cpd00009[vp] + cpd00067[vp] <=> cpd00009[vc] + cpd00067[vc] A3776_RS09530 or A3776_RS11030\n", "rxn05312__hc: cpd00009[hp] + cpd00067[hp] <=> cpd00009[hc] + cpd00067[hc] A3776_RS09530 or A3776_RS11030\n", "\n", "rxn08976_c0: cpd00004_c0 + cpd00067_c0 + cpd15352_c0 --> cpd00003_c0 + cpd15353_c0 (A3776_RS10740) or (A3776_RS17150) or (A3776_RS16420) or (A3776_RS02065) or (A3776_RS17155)\n", "\n", "rxn00507_c0: cpd00001_c0 + cpd00006_c0 + cpd00071_c0 --> cpd00005_c0 + cpd00029_c0 + 2.0 cpd00067_c0 (A3776_RS06600) or (A3776_RS04425)\n", "\n", "rxn00612_c0: cpd00006_c0 + cpd00080_c0 <=> cpd00005_c0 + cpd00067_c0 + cpd00095_c0 (A3776_RS22795)\n", "rxn00612__vc: cpd00005[vc] + cpd00067[vc] + cpd00095[vc] --> cpd00006[vc] + cpd00080[vc] A3776_RS22795\n", "rxn00612__hc: cpd00005[hc] + cpd00067[hc] + cpd00095[hc] --> cpd00006[hc] + cpd00080[hc] A3776_RS22795\n", "\n", "rxn00206_c0: 2.0 cpd00067_c0 + 2.0 cpd00532_c0 <-- cpd00007_c0 + cpd00025_c0 (A3776_RS09260) or (A3776_RS01410)\n", "rxn00206__vc: 2.0 cpd00067[vc] + 2.0 cpd00532[vc] --> cpd00007[vc] + cpd00025[vc] A3776_RS01410 or A3776_RS09260\n", "rxn00206__hc: 2.0 cpd00067[hc] + 2.0 cpd00532[hc] --> cpd00007[hc] + cpd00025[hc] A3776_RS01410 or A3776_RS09260\n", "\n", "rxn01834_c0: cpd02182_c0 <=> cpd00042_c0 + cpd00428_c0 (A3776_RS02965) or (A3776_RS22105)\n", "rxn01834__vc: cpd02182[vc] <=> cpd00042[vc] + cpd00428[vc] A3776_RS22105 or A3776_RS02965\n", "rxn01834__hc: cpd02182[hc] <=> cpd00042[hc] + cpd00428[hc] A3776_RS22105 or A3776_RS02965\n", "\n", "rxn05466_c0: cpd00013_e0 <=> cpd00013_c0 (A3776_RS13855) or (A3776_RS13890) or (A3776_RS13860)\n", "\n", "rxn01274_c0: cpd00001_c0 + cpd02182_c0 --> cpd00042_c0 + cpd00067_c0 + cpd00221_c0 (A3776_RS08720)\n", "rxn01274__vc: cpd00001[vc] + cpd02182[vc] --> cpd00042[vc] + cpd00067[vc] + cpd00221[vc] A3776_RS08720 or A3776_RS12840 or A3776_RS16165\n", "rxn01274__hc: cpd00001[hc] + cpd02182[hc] --> cpd00042[hc] + cpd00067[hc] + cpd00221[hc] A3776_RS08720 or A3776_RS12840 or A3776_RS16165\n", "\n", "rxn00611_c0: cpd00003_c0 + cpd00080_c0 <=> cpd00004_c0 + cpd00067_c0 + cpd00095_c0 (A3776_RS22795)\n", "rxn00611__vc: cpd00004[vc] + cpd00067[vc] + cpd00095[vc] --> cpd00003[vc] + cpd00080[vc] A3776_RS22795\n", "rxn00611__hc: cpd00004[hc] + cpd00067[hc] + cpd00095[hc] --> cpd00003[hc] + cpd00080[hc] A3776_RS22795\n", "\n", "rxn05467_c0: cpd00011_e0 <=> cpd00011_c0 \n", "\n", "rxn05488_c0: cpd00029_e0 + cpd00067_e0 <=> cpd00029_c0 + cpd00067_c0 \n", "\n", "rxn05468_c0: cpd00007_e0 --> cpd00007_c0 \n", "\n", "rxn05559_c0: cpd00047_e0 + cpd00067_e0 <=> cpd00047_c0 + cpd00067_c0 \n", "\n", "rxn05319_c0: cpd00001_e0 <=> cpd00001_c0 \n", "\n", "rxn05469_c0: cpd00020_e0 + cpd00067_e0 <=> cpd00020_c0 + cpd00067_c0 \n", "\n", "rxn08428_c0: cpd00363_c0 <=> cpd00363_e0 \n", "\n", "rxn08691_c0: cpd11640_c0 <=> cpd11640_e0 \n", "\n", "rxn08350_c0: cpd00067_e0 + cpd00221_e0 --> cpd00067_c0 + cpd00221_c0 \n", "\n", "EX_cpd00067_e0: cpd00067_e0 <=> \n", "\n", "EX_cpd00159_e0: cpd00159_e0 <=> \n", "\n", "EX_cpd00971_e0: cpd00971_e0 <=> \n", "\n", "EX_cpd00009_e0: cpd00009_e0 <=> \n", "\n", "EX_cpd00209_e0: cpd00209_e0 <=> \n", "\n", "EX_cpd00058_e0: cpd00058_e0 <=> \n", "\n", "EX_cpd00075_e0: cpd00075_e0 <=> \n", "\n", "EX_cpd00013_e0: cpd00013_e0 <=> \n", "\n", "EX_cpd00011_e0: cpd00011_e0 <=> \n", "\n", "EX_cpd00029_e0: cpd00029_e0 <=> \n", "\n", "EX_cpd00007_e0: cpd00007_e0 <=> \n", "\n", "EX_cpd00047_e0: cpd00047_e0 <=> \n", "\n", "EX_cpd00001_e0: cpd00001_e0 <=> \n", "\n", "EX_cpd00020_e0: cpd00020_e0 <=> \n", "\n", "EX_cpd00363_e0: cpd00363_e0 <=> \n", "\n", "EX_cpd11640_e0: cpd11640_e0 <=> \n", "\n", "EX_cpd00221_e0: cpd00221_e0 <=> \n", "\n", "bio1: 41.257 cpd00001_c0 + 41.257 cpd00002_c0 + 3.547 cpd00003_c0 + 1.8225 cpd00005_c0 + 2.8328 cpd00020_c0 + 3.7478 cpd00022_c0 + 1.0789 cpd00024_c0 + 1.7867 cpd00032_c0 + 0.5191 cpd00061_c0 + 0.0709 cpd00072_c0 + 0.205 cpd00079_c0 + 0.8977 cpd00101_c0 + 0.129 cpd00102_c0 + 1.496 cpd00169_c0 + 0.8977 cpd00236_c0 --> 3.547 cpd00004_c0 + 1.8225 cpd00006_c0 + 41.257 cpd00008_c0 + 41.257 cpd00009_c0 + 3.7478 cpd00010_c0 + 46.6265 cpd00067_c0 + cpd11416_c0 \n", "\n", "bio2: 41.257 cpd00001_c0 + 41.257 cpd00002_c0 --> 41.257 cpd00008_c0 + 41.257 cpd00009_c0 + 46.6265 cpd00067_c0 \n", "\n", "SK_cpd11416_c0: cpd11416_c0 --> \n", "\n" ] } ], "source": [ "for r in model_test.reactions:\n", " i = r.id\n", " seed_id = i[:-3]\n", " print(r, r.gene_reaction_rule)\n", " if f'{seed_id}__vc' in model_full.reactions:\n", " rxn_other = model_full.reactions.get_by_id(f'{seed_id}__vc')\n", " print(rxn_other, rxn_other.gene_reaction_rule)\n", " if f'{seed_id}__hc' in model_full.reactions:\n", " rxn_other = model_full.reactions.get_by_id(f'{seed_id}__hc')\n", " print(rxn_other, rxn_other.gene_reaction_rule)\n", " print()" ] }, { "cell_type": "code", "execution_count": null, "id": "27e6e6bd-18b8-4fff-8d38-a569d2098e89", "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.8.10" } }, "nbformat": 4, "nbformat_minor": 5 }