```python
from memote.support.helpers import find_met_in_model, find_compartment_id_in_model
import cobra
from cobra.exceptions import Infeasible
from os.path import join

data_dir = "/Users/lizrad/Dev/iVnat"
model=cobra.io.read_sbml_model(join(data_dir, "iVnat.xml"))
```

```python
with model:
    for rxn in model.boundary:
        rxn.bounds = 0, 0

    for rxn in model.boundary:
        print(rxn.name)
        rxn.bounds = -10, 10
        sol = model.optimize()
        print(sol)
```

    DNA_replication_c0
    <Solution 0.000 at 0x10d567ef0>
    RNA_transcription_c0
    <Solution 0.000 at 0x10d567cf8>
    Protein_biosynthesis_c0
    <Solution 0.000 at 0x10d567fd0>
    EX_H_plus__e0
    <Solution 0.000 at 0x10d567eb8>
    EX_Adenosine_e0
    <Solution 0.000 at 0x10d567ef0>
    EX_Fumarate_e0
    <Solution 0.000 at 0x10d567cf8>
    EX_Nitrite_e0
    <Solution 0.000 at 0x10d567fd0>
    EX_Ornithine_e0
    <Solution 0.000 at 0x10d567c50>
    EX_4_5_dihydroxy_2_3_pentanedione_c0
    <Solution 0.000 at 0x10d567ef0>
    EX_Succinate_e0
    <Solution 0.000 at 0x10d567e10>
    EX_L_methionine_R_oxide_e0
    <Solution 0.000 at 0x10d567fd0>
    EX_Pb_e0
    <Solution 0.000 at 0x10d567c50>
    EX_L_alanylglycine_e0
    <Solution 0.000 at 0x10d567ef0>
    EX_Deoxyuridine_e0
    <Solution 0.000 at 0x10d567e10>
    EX_ala_L_Thr_L_e0
    <Solution 0.000 at 0x10d567fd0>
    EX_PPi_e0
    <Solution 0.000 at 0x10d567c50>
    EX_ala_L_glu_L_e0
    <Solution 0.000 at 0x10d567ef0>
    EX_Salicin_e0
    <Solution 0.000 at 0x10d567e10>
    EX_L_Proline_e0
    <Solution 0.000 at 0x10d567fd0>
    EX_Na_plus__e0
    <Solution 0.000 at 0x10d567c50>
    EX_Cd2_plus__e0
    <Solution 0.000 at 0x10d567ef0>
    EX_Cbl_e0
    <Solution 0.000 at 0x10d567e10>
    EX_Inosine_e0
    <Solution 0.000 at 0x10d567fd0>
    EX_GLUM_e0
    <Solution 0.000 at 0x10d567c50>
    EX_D_Fructose_e0
    <Solution 0.000 at 0x10d567ef0>
    EX_H2O_e0
    <Solution 0.000 at 0x10d567f60>
    EX_L_Glutamate_e0
    <Solution 0.000 at 0x10d567fd0>
    EX_Cytidine_e0
    <Solution 0.000 at 0x10d5679b0>
    EX_Cu2_plus__e0
    <Solution 0.000 at 0x10d567ef0>
    EX_Glycerol_3_phosphate_e0
    <Solution 0.000 at 0x10d567f60>
    EX_L_Leucine_e0
    <Solution 0.000 at 0x10d567fd0>
    EX_Thymidine_e0
    <Solution 0.000 at 0x10d5679b0>
    EX_D_Mannitol_e0
    <Solution 0.000 at 0x10d567ef0>
    EX_Cys_Gly_e0
    <Solution 0.000 at 0x10d567f60>
    EX_R_3_Hydroxybutanoate_e0
    <Solution 0.000 at 0x10d567da0>
    EX_NH3_e0
    <Solution 0.000 at 0x10d5679b0>
    EX_L_Arginine_e0
    <Solution 0.000 at 0x10d567fd0>
    EX_Fe2_plus__e0
    <Solution 0.000 at 0x10d567eb8>
    EX_Malonate_e0
    <Solution 0.000 at 0x10d567ef0>
    EX_Maltose_e0
    <Solution 0.000 at 0x10d5679b0>
    EX_Glycerol_e0
    <Solution 0.000 at 0x10d567da0>
    EX_Gly_Met_e0
    <Solution 0.000 at 0x10d567d68>
    EX_Phosphate_e0
    <Solution 0.000 at 0x10d5679e8>
    EX_L_Methionine_e0
    <Solution 0.000 at 0x10d567cc0>
    EX_Deoxyadenosine_e0
    <Solution 0.000 at 0x10d567da0>
    EX_Zn2_plus__e0
    <Solution 0.000 at 0x10d567c50>
    EX_Uridine_e0
    <Solution 0.000 at 0x10d5679e8>
    EX_Palmitate_e0
    <Solution 0.000 at 0x10d567eb8>
    EX_L_Histidine_e0
    <Solution 0.000 at 0x10d567da0>
    EX_ala_L_asp_L_e0
    <Solution 0.000 at 0x10d5679b0>
    EX_Deoxycytidine_e0
    <Solution 0.000 at 0x10d5679e8>
    EX_Sucrose_e0
    <Solution 0.000 at 0x10d567d68>
    EX_L_Isoleucine_e0
    <Solution 0.000 at 0x10d567da0>
    EX_Dulcose_e0
    <Solution 0.000 at 0x10d567e10>
    EX_Taurine_e0
    <Solution 0.000 at 0x10d567ef0>
    EX_glycogenn_1_c0
    <Solution 0.000 at 0x10d567c50>
    EX_Gly_Phe_e0
    <Solution 0.000 at 0x10d5679b0>
    EX_Spermidine_e0
    <Solution 0.000 at 0x10d567eb8>
    EX_L_Serine_e0
    <Solution 0.000 at 0x10d567ef0>
    EX_PAN_e0
    <Solution 0.000 at 0x10d567c50>
    EX_D_Methionine_e0
    <Solution 0.000 at 0x10d5679b0>
    EX_L_Aspartate_e0
    <Solution 0.000 at 0x10d567dd8>
    EX_N_Acetyl_D_glucosamine_e0
    <Solution 0.000 at 0x10d567ef0>
    EX_L_Alanine_e0
    <Solution 0.000 at 0x10d567d68>
    EX_Gly_Cys_e0
    <Solution 0.000 at 0x10d5679b0>
    EX_L_Lysine_e0
    <Solution 0.000 at 0x10d567e10>
    EX_Ursin_e0
    <Solution 0.000 at 0x10d567ef0>
    EX_Deoxyguanosine_e0
    <Solution 0.000 at 0x10d567eb8>
    EX_Putrescine_e0
    <Solution 0.000 at 0x10d567cc0>
    EX_XAN_e0
    <Solution 0.000 at 0x10d567c50>
    EX_Gly_Gln_e0
    <Solution 0.000 at 0x10d567b00>
    EX_Allantoin_e0
    <Solution 0.000 at 0x10d567dd8>
    EX_Phenylpropanoate_e0
    <Solution 0.000 at 0x10d567cc0>
    EX_Deoxyinosine_e0
    <Solution 0.000 at 0x10d567d68>
    EX_L_Arabinose_e0
    <Solution 0.000 at 0x10d567b00>
    EX_Amylotriose_e0
    <Solution 0.000 at 0x10d567e10>
    EX_Citrate_e0
    <Solution 0.000 at 0x10d567cc0>
    EX_fe3_e0
    <Solution 0.000 at 0x10d567eb8>
    EX_Sorbitol_e0
    <Solution 0.000 at 0x10d567b00>
    EX_Vitamin_B12r_e0
    <Solution 0.000 at 0x10d567c50>
    EX_D_Alanine_e0
    <Solution 0.000 at 0x10d567cc0>
    EX_Mg_e0
    <Solution 0.000 at 0x10d567dd8>
    EX_D_Mannose_e0
    <Solution 0.000 at 0x10d567b00>
    EX_S_Adenosyl_4_methylthio_2_oxobutanoate_c0
    <Solution 0.000 at 0x10d567d68>
    EX_Thyminose_e0
    <Solution 0.000 at 0x10d567cc0>
    EX_L_Lactate_e0
    <Solution 0.000 at 0x10d567e10>
    EX_BET_e0
    <Solution 0.000 at 0x10d567b00>
    EX_L_Tryptophan_e0
    <Solution 0.000 at 0x10d567eb8>
    EX_Formate_e0
    <Solution 0.000 at 0x10d567cc0>
    EX_Gly_Tyr_e0
    <Solution 0.000 at 0x10d567c50>
    EX_Sulfate_e0
    <Solution 0.000 at 0x10d567b00>
    EX_Myristic_acid_e0
    <Solution 0.000 at 0x10d567dd8>
    EX_Co2_plus__e0
    <Solution 0.000 at 0x10d567cc0>
    EX_2_Demethylmenaquinol_8_e0
    <Solution 0.000 at 0x10d567d68>
    EX_2_Demethylmenaquinone_8_e0
    <Solution 0.000 at 0x10d567b00>
    EX_L_Methionine_S_oxide_e0
    <Solution 0.000 at 0x10d567e10>
    EX_Hg2_plus__e0
    <Solution 0.000 at 0x10d567ef0>
    EX_Ala_Leu_e0
    <Solution 0.000 at 0x10d567eb8>
    EX_Aminoethanol_e0
    <Solution 0.000 at 0x10d567be0>
    EX_gly_asp_L_e0
    <Solution 0.000 at 0x10d567c50>
    EX_D_Glucose_e0
    <Solution 0.000 at 0x10d567ef0>
    EX_FeIIIdicitrate_e0
    <Solution 0.000 at 0x10d567dd8>
    EX_Nitrate_e0
    <Solution 0.000 at 0x10d567be0>
    EX_TRHL_e0
    <Solution 0.000 at 0x10d567d68>
    EX_D_Ribose_e0
    <Solution 0.000 at 0x10d567b70>
    EX_HYXN_e0
    <Solution 0.000 at 0x10d567e10>
    EX_gly_pro_L_e0
    <Solution 0.000 at 0x10d567a58>
    EX_Maltohexaose_e0
    <Solution 0.000 at 0x10d567eb8>
    EX_Gly_Leu_e0
    <Solution 0.000 at 0x10d567b70>
    EX_Cyanate_e0
    <Solution 0.000 at 0x10d567c50>
    EX_L_Tyrosine_e0
    <Solution 0.000 at 0x10d567a58>
    EX_K_plus__e0
    <Solution 0.000 at 0x10d567dd8>
    EX_O2_e0
    <Solution 0.000 at 0x10d567b70>
    EX_Vitamin_B12_e0
    <Solution 0.000 at 0x10d567d68>
    EX_Choline_e0
    <Solution 0.000 at 0x10d567a58>
    EX_gly_glu_L_e0
    <Solution 0.000 at 0x10d567e10>
    EX_L_Valine_e0
    <Solution 0.000 at 0x10d567b70>
    EX_Ala_Gln_e0
    <Solution 0.000 at 0x10d567eb8>
    EX_Uracil_e0
    <Solution 0.000 at 0x10d567a58>
    EX_met_L_ala_L_e0
    <Solution 0.000 at 0x10d567c50>
    EX_gly_asn_L_e0
    <Solution 0.000 at 0x10d567b70>
    EX_Menaquinol_8_e0
    <Solution 0.000 at 0x10d567dd8>
    EX_Menaquinone_8_e0
    <Solution 0.000 at 0x10d567a58>
    EX_ocdca_e0
    <Solution 0.000 at 0x10d567e10>
    EX_Ala_His_e0
    <Solution 0.000 at 0x10d567b70>
    EX_Thiamin_e0
    <Solution 0.000 at 0x10d567d68>
    EX_L_Inositol_e0
    <Solution 0.000 at 0x10d567a58>
    EX_CO2_e0
    <Solution 0.000 at 0x10d567eb8>
    EX_Biomass_c0
    <Solution 0.000 at 0x10d567b70>
    EX_Cl__e0
    <Solution 0.000 at 0x10d567c50>
    EX_Ca2_plus__e0
    <Solution 0.000 at 0x10d567a58>
    EX_Mn2_plus__e0
    <Solution 10.000 at 0x10d567dd8>

```python
blocked_precursors = []
with model:
    for rxn in model.boundary:
        print(rxn.name)
        rxn.bounds = -10, 0
        sol = model.optimize()
        print(sol)

    for precursor in [model.metabolites.ACP_c0, model.metabolites.ADENOSYLCOBALAMIN_c0, model.metabolites.MNXM7630_c0]:
        dm_rxn = model.add_boundary(precursor, type="demand")
        model.objective = dm_rxn
        try:
            print("demand reaction", dm_rxn)
            solution = model.optimize()

            print(solution)
            LOGGER.debug(
                "%s: demand flux is '%g' and solver status is '%s'",
                str(precursor), solution.objective_value, solution.status)

            if solution.objective_value <= 0.0:
                blocked_precursors.append(precursor)
                print("obj value 0 or negative:", blocked_precursors)
        except Infeasible:
            blocked_precursors.append(precursor)

```

```python

```

```python
from pandas import read_csv, DataFrame
import pandas as pd
import os
import re #Both patterns and strings to be searched can be Unicode strings as well as 8-bit strings.
import math
import cobra
import cobra.test
from __future__ import print_function
from os.path import join
from cobra.io import write_sbml_model
from cobra.flux_analysis import flux_variability_analysis
#from cobra.medium import minimal_medium
#from cobra.medium import minimal_medium
from IPython.core.interactiveshell import InteractiveShell
import itertools
import re
import memote

InteractiveShell.ast_node_interactivity = "all"

data_dir = "/Users/lizrad/Dev/iVnat"
print("files found: ")
print(", ".join(i for i in os.listdir(data_dir) if i.startswith("iVnat")))
model=cobra.io.read_sbml_model(join(data_dir, "iVnat.xml"))
#model=cobra.io.read_legacy_sbml("/Users/lizrad/Documents/Vibrio_folder/iVnat_gapfill_glu.xml")
model
```

    files found:
    iVnat.json, iVnat.xml

        Name
        GCF_001456255_1_rast_metabolic_model

        Memory address
        0x010d016e48

        Number of metabolites
        1842

        Number of reactions
        1906

        Objective expression
        -1.0*bio1_reverse_b18f7 + 1.0*bio1

        Compartments
        Cytosol_0, Extracellular_0

## Memote biomass and consistency functions

```python
from memote.support.biomass import find_blocked_biomass_precursors, sum_biomass_weight, find_biomass_precursors, find_direct_metabolites, gam_in_biomass, detect_false_positive_direct_metabolites, bundle_biomass_components, essential_precursors_not_in_biomass
```

```python
from memote.support.consistency import check_stoichiometric_consistency
from memote.support.helpers import find_compartment_id_in_model
```

### Finding biomass precursors

```python
bio_precursor=find_biomass_precursors(model, model.reactions.bio1)

print("Number of found biomass precursors:" , len(bio_precursor))
bio_precursor
```

    Number of found biomass precursors: 76

    [<Metabolite DEMETHYLMENAQUINONE_c0 at 0x10edb4048>,
     <Metabolite MNXM81014_c0 at 0x10eea7048>,
     <Metabolite K+_c0 at 0x10f0cd160>,
     <Metabolite LEU_c0 at 0x10edf1198>,
     <Metabolite GLY_c0 at 0x10ec51208>,
     <Metabolite LYS_c0 at 0x10ecdb208>,
     <Metabolite CPD0-2271_c0 at 0x10f126240>,
     <Metabolite SER_c0 at 0x10eca8240>,
     <Metabolite GLN_c0 at 0x10ed42278>,
     <Metabolite HIS_c0 at 0x10ed702b0>,
     <Metabolite MNXM78334_c0 at 0x10ef352b0>,
     <Metabolite NAD_c0 at 0x10ec6f2e8>,
     <Metabolite CPD-15815_c0 at 0x10ec75320>,
     <Metabolite DGTP_c0 at 0x10ee14320>,
     <Metabolite ACP_c0 at 0x10ecdb390>,
     <Metabolite VAL_c0 at 0x10ef093c8>,
     <Metabolite DATP_c0 at 0x10ecc3400>,
     <Metabolite TTP_c0 at 0x10edf4400>,
     <Metabolite CA+2_c0 at 0x10f126438>,
     <Metabolite THIAMINE-PYROPHOSPHATE_c0 at 0x10ec62438>,
     <Metabolite RIBOFLAVIN_c0 at 0x10edce470>,
     <Metabolite CPD-12818_c0 at 0x10edc14a8>,
     <Metabolite GLUTATHIONE_c0 at 0x10ec594a8>,
     <Metabolite TYR_c0 at 0x10ee614a8>,
     <Metabolite ASN_c0 at 0x10ed42518>,
     <Metabolite UNDECAPRENYL-DIPHOSPHATE_c0 at 0x10f07e550>,
     <Metabolite CTP_c0 at 0x10ec54588>,
     <Metabolite CO-A_c0 at 0x10eca85c0>,
     <Metabolite PRO_c0 at 0x10ed6f5f8>,
     <Metabolite L-ALPHA-ALANINE_c0 at 0x10ed896d8>,
     <Metabolite MNXM7305_c0 at 0x10f0a0748>,
     <Metabolite 10-FORMYL-THF_c0 at 0x10ec54780>,
     <Metabolite DCTP_c0 at 0x10ec637b8>,
     <Metabolite GLT_c0 at 0x10ec74828>,
     <Metabolite THF_c0 at 0x10ed908d0>,
     <Metabolite MNXM51417_c0 at 0x10ec5a940>,
     <Metabolite GTP_c0 at 0x10ecea9b0>,
     <Metabolite MNXM5124_c0 at 0x10eda09e8>,
     <Metabolite CYS_c0 at 0x10ec749e8>,
     <Metabolite ADENOSYLCOBALAMIN_c0 at 0x10f01b9e8>,
     <Metabolite PUTRESCINE_c0 at 0x10ed199e8>,
     <Metabolite ILE_c0 at 0x10ee8ea20>,
     <Metabolite MG+2_c0 at 0x10efc2a20>,
     <Metabolite MNXM7630_c0 at 0x10f0d5a20>,
     <Metabolite CL-_c0 at 0x10edc1a58>,
     <Metabolite FE+2_c0 at 0x10ed89a58>,
     <Metabolite S-ADENOSYLMETHIONINE_c0 at 0x10ec7da20>,
     <Metabolite MNXM7294_c0 at 0x10f08da90>,
     <Metabolite THR_c0 at 0x10edcea90>,
     <Metabolite 5-METHYL-THF_c0 at 0x10ed4cac8>,
     <Metabolite HSO4_c0 at 0x10eceab38>,
     <Metabolite SPERMIDINE_c0 at 0x10ed19ba8>,
     <Metabolite CPD-12822_c0 at 0x10ed0abe0>,
     <Metabolite NADP_c0 at 0x10ec7ebe0>,
     <Metabolite PHE_c0 at 0x10ed62be0>,
     <Metabolite ARG_c0 at 0x10ed90c18>,
     <Metabolite CPD-9728_c0 at 0x10ed89c18>,
     <Metabolite MET_c0 at 0x10ec83c18>,
     <Metabolite MNXM6175_c0 at 0x10eda0c18>,
     <Metabolite FE+3_c0 at 0x10ed89c50>,
     <Metabolite UBIQUINONE-8_c0 at 0x10ec5ac50>,
     <Metabolite ATP_c0 at 0x10ec4dc88>,
     <Metabolite SIROHEME_c0 at 0x10f09fc88>,
     <Metabolite UTP_c0 at 0x10ee9ecf8>,
     <Metabolite MNXM5129_c0 at 0x10eda9d30>,
     <Metabolite FAD_c0 at 0x10ec74d68>,
     <Metabolite MN+2_c0 at 0x10f11dda0>,
     <Metabolite MNXM6440_c0 at 0x10ed0ada0>,
     <Metabolite PYRIDOXAL_PHOSPHATE_c0 at 0x10ed6fda0>,
     <Metabolite TRP_c0 at 0x10eef2e10>,
     <Metabolite CU+2_c0 at 0x10ede0e48>,
     <Metabolite CO+2_c0 at 0x10efd3eb8>,
     <Metabolite L-ASPARTATE_c0 at 0x10ec75ef0>,
     <Metabolite ZN+2_c0 at 0x10ee8ef28>,
     <Metabolite MNXM6297_c0 at 0x10eda9f60>,
     <Metabolite MNXM78362_c0 at 0x10ef2df98>]

```python
len(model.reactions.bio1.metabolites)
for not_precursor in model.reactions.bio1.metabolites:
    if not_precursor not in bio_precursor:
        print("not precursors, products in the biomass right side:", not_precursor)
model.reactions.bio1.reaction

```

    not precursors, products in the biomass right side: ADP_c0
    not precursors, products in the biomass right side: BIOMASS_c0
    not precursors, products in the biomass right side: CPD-16459_c0
    not precursors, products in the biomass right side: DIMETHYLBENZIMIDAZOLE_c0
    not precursors, products in the biomass right side: MNXM2214_c0
    not precursors, products in the biomass right side: MNXM5258_c0
    not precursors, products in the biomass right side: MNXM90619_c0
    not precursors, products in the biomass right side: PPI_c0
    not precursors, products in the biomass right side: PROTON_c0

    '0.00309646685192537 10-FORMYL-THF_c0 + 0.00309646685192537 5-METHYL-THF_c0 + 0.00309646685192537 ACP_c0 + 0.00309646685192537 ADENOSYLCOBALAMIN_c0 + 0.246696822701341 ARG_c0 + 0.200830806928348 ASN_c0 + 40.1101757365074 ATP_c0 + 0.00309646685192537 CA+2_c0 + 0.00309646685192537 CL-_c0 + 0.00309646685192537 CO+2_c0 + 0.00309646685192537 CO-A_c0 + 0.0106480421341882 CPD-12818_c0 + 0.0106480421341882 CPD-12822_c0 + 35.5403092430435 CPD-15815_c0 + 0.00309646685192537 CPD-9728_c0 + 0.0250105977108944 CPD0-2271_c0 + 0.0841036156544863 CTP_c0 + 0.00309646685192537 CU+2_c0 + 0.0761464922056484 CYS_c0 + 0.0175915886179248 DATP_c0 + 0.0144513778992424 DCTP_c0 + 0.00309646685192537 DEMETHYLMENAQUINONE_c0 + 0.0144513778992424 DGTP_c0 + 0.00309646685192537 FAD_c0 + 0.00309646685192537 FE+2_c0 + 0.00309646685192537 FE+3_c0 + 0.219088153012743 GLN_c0 + 0.219088153012743 GLT_c0 + 0.00309646685192537 GLUTATHIONE_c0 + 0.509869786991038 GLY_c0 + 0.135406821203723 GTP_c0 + 0.0792636000737159 HIS_c0 + 0.00309646685192537 HSO4_c0 + 0.241798510337235 ILE_c0 + 0.00309646685192537 K+_c0 + 0.427934380173264 L-ALPHA-ALANINE_c0 + 0.200830806928348 L-ASPARTATE_c0 + 0.375388847540127 LEU_c0 + 0.285438020490179 LYS_c0 + 0.127801422590767 MET_c0 + 0.00309646685192537 MG+2_c0 + 0.00309646685192537 MN+2_c0 + 0.0106480421341882 MNXM5124_c0 + 0.0106480421341882 MNXM5129_c0 + MNXM51417_c0 + 0.0106480421341882 MNXM6175_c0 + 0.0106480421341882 MNXM6297_c0 + 0.0106480421341882 MNXM6440_c0 + 0.0106480421341882 MNXM7294_c0 + 0.0106480421341882 MNXM7305_c0 + 0.0250105977108944 MNXM7630_c0 + MNXM78334_c0 + 0.00309646685192537 MNXM78362_c0 + MNXM81014_c0 + 0.00309646685192537 NADP_c0 + 0.00309646685192537 NAD_c0 + 0.154519490031345 PHE_c0 + 0.184354665339991 PRO_c0 + 0.00309646685192537 PUTRESCINE_c0 + 0.00309646685192537 PYRIDOXAL_PHOSPHATE_c0 + 0.00309646685192537 RIBOFLAVIN_c0 + 0.00309646685192537 S-ADENOSYLMETHIONINE_c0 + 0.179456352975885 SER_c0 + 0.00309646685192537 SIROHEME_c0 + 0.00309646685192537 SPERMIDINE_c0 + 0.00309646685192537 THF_c0 + 0.00309646685192537 THIAMINE-PYROPHOSPHATE_c0 + 0.211072732780569 THR_c0 + 0.0472019191450218 TRP_c0 + 0.0175915886179248 TTP_c0 + 0.120676604606612 TYR_c0 + 0.00309646685192537 UBIQUINONE-8_c0 + 0.0250105977108944 UNDECAPRENYL-DIPHOSPHATE_c0 + 0.0908319049068452 UTP_c0 + 0.352233189091625 VAL_c0 + 0.00309646685192537 ZN+2_c0 --> 40.0 ADP_c0 + BIOMASS_c0 + 39.9969035331481 CPD-16459_c0 + 0.00309646685192537 DIMETHYLBENZIMIDAZOLE_c0 + 0.00309646685192537 MNXM2214_c0 + 0.0250105977108944 MNXM5258_c0 + 0.00309646685192537 MNXM90619_c0 + 0.484604011306766 PPI_c0 + 40.0 PROTON_c0'

### Adding exchange reactions to precursors

```python
with model:
    ex_reac_list=[]

    for pre in bio_precursor:

        try:
            ex_precursor_reac = model.add_boundary(pre, type="exchange")
            ex_reac_list.append(ex_precursor_reac)
        except:
            pass
    print("growth after adding precursor exchanges:", model.optimize())

    for blocked in ("EX_ACP_c0", "EX_ADENOSYLCOBALAMIN_c0", "EX_MNXM7630_c0"):
        model.reactions.get_by_id(blocked).bounds=(-1000, 1000)
        print(model.reactions.get_by_id(blocked))
        model.objective=model.reactions.get_by_id(blocked)
        print("optimization:", model.optimize())

    for reac in ex_reac_list:

        reac.bounds=(0, 1000)
        print(reac)
        model.objective=model.reactions.get_by_id(reac.id)
        model.optimize()

#ex_reac_list
          #  if "EX_"+pre.id in reac.name:
           #     pass
            #else:
             #   ex_precursor_reac = model.add_boundary(pre, type="exchange")
              #  ex_reac_list.append(ex_precursor_reac)
```

    growth after adding precursor exchanges: <Solution 452.153 at 0x10f2e12e8>
    EX_ACP_c0: ACP_c0 <=>
    optimization: <Solution -0.000 at 0x10f2e19e8>
    EX_ADENOSYLCOBALAMIN_c0: ADENOSYLCOBALAMIN_c0 <=>
    optimization: <Solution 0.000 at 0x10f2e1e80>
    EX_MNXM7630_c0: MNXM7630_c0 <=>
    optimization: <Solution 0.000 at 0x10f2e1860>
    EX_DEMETHYLMENAQUINONE_c0: DEMETHYLMENAQUINONE_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000e+00
      0.0

      GLUTATHIONE-SYN-RXN_c0
      2.175501e-13
      0.0

      MNXR101695_c0
      0.000000e+00
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000e+00
      0.0

      RXN-8641_c0
      0.000000e+00
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000e+00
      0.0

      EX_L-ASPARTATE_c0
      0.000000e+00
      0.0

      EX_ZN+2_c0
      0.000000e+00
      0.0

      EX_MNXM6297_c0
      0.000000e+00
      0.0

      EX_MNXM78362_c0
      -4.189314e+02
      0.0

1982 rows × 2 columns

    EX_MNXM81014_c0: MNXM81014_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000e+00
      0.0

      GLUTATHIONE-SYN-RXN_c0
      2.175501e-13
      0.0

      MNXR101695_c0
      0.000000e+00
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000e+00
      0.0

      RXN-8641_c0
      0.000000e+00
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000e+00
      0.0

      EX_L-ASPARTATE_c0
      0.000000e+00
      0.0

      EX_ZN+2_c0
      0.000000e+00
      0.0

      EX_MNXM6297_c0
      0.000000e+00
      0.0

      EX_MNXM78362_c0
      -4.189314e+02
      0.0

1982 rows × 2 columns

    EX_K+_c0: K+_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000e+00
      0.0

      GLUTATHIONE-SYN-RXN_c0
      2.142758e-13
      0.0

      MNXR101695_c0
      0.000000e+00
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000e+00
      0.0

      RXN-8641_c0
      0.000000e+00
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000e+00
      0.0

      EX_L-ASPARTATE_c0
      0.000000e+00
      0.0

      EX_ZN+2_c0
      0.000000e+00
      0.0

      EX_MNXM6297_c0
      0.000000e+00
      0.0

      EX_MNXM78362_c0
      -4.134572e+02
      0.0

1982 rows × 2 columns

    EX_LEU_c0: LEU_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000e+00
      0.0

      GLUTATHIONE-SYN-RXN_c0
      1.992637e-13
      0.0

      MNXR101695_c0
      0.000000e+00
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000e+00
      0.0

      RXN-8641_c0
      0.000000e+00
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000e+00
      0.0

      EX_L-ASPARTATE_c0
      0.000000e+00
      0.0

      EX_ZN+2_c0
      0.000000e+00
      0.0

      EX_MNXM6297_c0
      0.000000e+00
      0.0

      EX_MNXM78362_c0
      -4.134572e+02
      0.0

1982 rows × 2 columns

    EX_GLY_c0: GLY_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000e+00
      0.0

      GLUTATHIONE-SYN-RXN_c0
      1.992637e-13
      0.0

      MNXR101695_c0
      0.000000e+00
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000e+00
      0.0

      RXN-8641_c0
      0.000000e+00
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000e+00
      0.0

      EX_L-ASPARTATE_c0
      0.000000e+00
      0.0

      EX_ZN+2_c0
      0.000000e+00
      0.0

      EX_MNXM6297_c0
      0.000000e+00
      0.0

      EX_MNXM78362_c0
      -4.134572e+02
      0.0

1982 rows × 2 columns

    EX_LYS_c0: LYS_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000e+00
      0.0

      GLUTATHIONE-SYN-RXN_c0
      1.732077e-13
      0.0

      MNXR101695_c0
      0.000000e+00
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000e+00
      0.0

      RXN-8641_c0
      0.000000e+00
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000e+00
      0.0

      EX_L-ASPARTATE_c0
      0.000000e+00
      0.0

      EX_ZN+2_c0
      0.000000e+00
      0.0

      EX_MNXM6297_c0
      0.000000e+00
      0.0

      EX_MNXM78362_c0
      -4.109233e+02
      0.0

1982 rows × 2 columns

    EX_CPD0-2271_c0: CPD0-2271_c0 -->

Optimal solution with objective value 34.483

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      -5.653620e-18

      GLUTATHIONE-SYN-RXN_c0
      377.685151
      0.000000e+00

      MNXR101695_c0
      0.000000
      -0.000000e+00

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      -9.360504e-17

      RXN-8641_c0
      0.000000
      -0.000000e+00

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.000000e+00

      EX_L-ASPARTATE_c0
      0.000000
      -1.177574e-16

      EX_ZN+2_c0
      0.000000
      0.000000e+00

      EX_MNXM6297_c0
      0.000000
      0.000000e+00

      EX_MNXM78362_c0
      -500.000000
      0.000000e+00

1982 rows × 2 columns

    EX_SER_c0: SER_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.0

      GLUTATHIONE-SYN-RXN_c0
      229.173409
      0.0

      MNXR101695_c0
      0.000000
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      0.0

      RXN-8641_c0
      0.000000
      0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.0

      EX_L-ASPARTATE_c0
      0.000000
      0.0

      EX_ZN+2_c0
      0.000000
      0.0

      EX_MNXM6297_c0
      0.000000
      0.0

      EX_MNXM78362_c0
      -500.000000
      0.0

1982 rows × 2 columns

    EX_GLN_c0: GLN_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000e+00
      0.0

      GLUTATHIONE-SYN-RXN_c0
      -5.456968e-12
      0.0

      MNXR101695_c0
      0.000000e+00
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      1.064103e-12
      0.0

      RXN-8641_c0
      0.000000e+00
      0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000e+00
      0.0

      EX_L-ASPARTATE_c0
      0.000000e+00
      0.0

      EX_ZN+2_c0
      0.000000e+00
      0.0

      EX_MNXM6297_c0
      0.000000e+00
      0.0

      EX_MNXM78362_c0
      -5.000000e+02
      0.0

1982 rows × 2 columns

    EX_HIS_c0: HIS_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000e+00
      0.0

      GLUTATHIONE-SYN-RXN_c0
      7.048584e-12
      0.0

      MNXR101695_c0
      0.000000e+00
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      2.913225e-13
      0.0

      RXN-8641_c0
      0.000000e+00
      0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000e+00
      0.0

      EX_L-ASPARTATE_c0
      0.000000e+00
      0.0

      EX_ZN+2_c0
      0.000000e+00
      0.0

      EX_MNXM6297_c0
      0.000000e+00
      0.0

      EX_MNXM78362_c0
      -4.557771e+02
      0.0

1982 rows × 2 columns

    EX_MNXM78334_c0: MNXM78334_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000e+00
      0.0

      GLUTATHIONE-SYN-RXN_c0
      7.048584e-12
      0.0

      MNXR101695_c0
      0.000000e+00
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      2.913225e-13
      0.0

      RXN-8641_c0
      0.000000e+00
      0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000e+00
      0.0

      EX_L-ASPARTATE_c0
      0.000000e+00
      0.0

      EX_ZN+2_c0
      0.000000e+00
      0.0

      EX_MNXM6297_c0
      0.000000e+00
      0.0

      EX_MNXM78362_c0
      -4.557771e+02
      0.0

1982 rows × 2 columns

    EX_NAD_c0: NAD_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.0

      GLUTATHIONE-SYN-RXN_c0
      0.000000
      0.0

      MNXR101695_c0
      0.000000
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      0.0

      RXN-8641_c0
      0.000000
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.0

      EX_L-ASPARTATE_c0
      0.000000
      0.0

      EX_ZN+2_c0
      0.000000
      0.0

      EX_MNXM6297_c0
      0.000000
      0.0

      EX_MNXM78362_c0
      -445.307874
      0.0

1982 rows × 2 columns

    EX_CPD-15815_c0: CPD-15815_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.0

      GLUTATHIONE-SYN-RXN_c0
      176.252112
      0.0

      MNXR101695_c0
      0.000000
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      0.0

      RXN-8641_c0
      0.000000
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.0

      EX_L-ASPARTATE_c0
      -156.234953
      0.0

      EX_ZN+2_c0
      0.000000
      0.0

      EX_MNXM6297_c0
      0.000000
      0.0

      EX_MNXM78362_c0
      -500.000000
      0.0

1982 rows × 2 columns

    EX_DGTP_c0: DGTP_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.0

      GLUTATHIONE-SYN-RXN_c0
      176.252112
      0.0

      MNXR101695_c0
      0.000000
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      0.0

      RXN-8641_c0
      0.000000
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.0

      EX_L-ASPARTATE_c0
      -156.234953
      0.0

      EX_ZN+2_c0
      0.000000
      0.0

      EX_MNXM6297_c0
      0.000000
      0.0

      EX_MNXM78362_c0
      -500.000000
      0.0

1982 rows × 2 columns

    EX_ACP_c0: ACP_c0 -->

Optimal solution with objective value -0.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.000000e+00

      GLUTATHIONE-SYN-RXN_c0
      176.252112
      0.000000e+00

      MNXR101695_c0
      0.000000
      -0.000000e+00

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      2.206838e-17

      RXN-8641_c0
      0.000000
      -0.000000e+00

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.000000e+00

      EX_L-ASPARTATE_c0
      -156.234953
      6.162976e-33

      EX_ZN+2_c0
      0.000000
      0.000000e+00

      EX_MNXM6297_c0
      0.000000
      0.000000e+00

      EX_MNXM78362_c0
      -500.000000
      0.000000e+00

1982 rows × 2 columns

    EX_VAL_c0: VAL_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.0

      GLUTATHIONE-SYN-RXN_c0
      165.868440
      0.0

      MNXR101695_c0
      0.000000
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      0.0

      RXN-8641_c0
      0.000000
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.0

      EX_L-ASPARTATE_c0
      -201.211391
      0.0

      EX_ZN+2_c0
      0.000000
      0.0

      EX_MNXM6297_c0
      0.000000
      0.0

      EX_MNXM78362_c0
      -500.000000
      0.0

1982 rows × 2 columns

    EX_DATP_c0: DATP_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.0

      GLUTATHIONE-SYN-RXN_c0
      242.034377
      0.0

      MNXR101695_c0
      0.000000
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      0.0

      RXN-8641_c0
      0.000000
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.0

      EX_L-ASPARTATE_c0
      -9.857316
      0.0

      EX_ZN+2_c0
      0.000000
      0.0

      EX_MNXM6297_c0
      0.000000
      0.0

      EX_MNXM78362_c0
      -448.771892
      0.0

1982 rows × 2 columns

    EX_TTP_c0: TTP_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.0

      GLUTATHIONE-SYN-RXN_c0
      195.232369
      0.0

      MNXR101695_c0
      0.000000
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      0.0

      RXN-8641_c0
      0.000000
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.0

      EX_L-ASPARTATE_c0
      -314.345823
      0.0

      EX_ZN+2_c0
      0.000000
      0.0

      EX_MNXM6297_c0
      0.000000
      0.0

      EX_MNXM78362_c0
      -446.363632
      0.0

1982 rows × 2 columns

    EX_CA+2_c0: CA+2_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.0

      GLUTATHIONE-SYN-RXN_c0
      240.279676
      0.0

      MNXR101695_c0
      0.000000
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      0.0

      RXN-8641_c0
      0.000000
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.0

      EX_L-ASPARTATE_c0
      -117.460797
      0.0

      EX_ZN+2_c0
      0.000000
      0.0

      EX_MNXM6297_c0
      0.000000
      0.0

      EX_MNXM78362_c0
      -436.691393
      0.0

1982 rows × 2 columns

    EX_THIAMINE-PYROPHOSPHATE_c0: THIAMINE-PYROPHOSPHATE_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.000000e+00

      GLUTATHIONE-SYN-RXN_c0
      476.563435
      0.000000e+00

      MNXR101695_c0
      0.000000
      7.175936e-17

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      4.421639e-16

      RXN-8641_c0
      0.000000
      -0.000000e+00

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.000000e+00

      EX_L-ASPARTATE_c0
      -59.663693
      4.166135e-18

      EX_ZN+2_c0
      0.000000
      0.000000e+00

      EX_MNXM6297_c0
      0.000000
      0.000000e+00

      EX_MNXM78362_c0
      -332.846677
      0.000000e+00

1982 rows × 2 columns

    EX_RIBOFLAVIN_c0: RIBOFLAVIN_c0 -->

Optimal solution with objective value 500.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.0

      GLUTATHIONE-SYN-RXN_c0
      968.594277
      0.0

      MNXR101695_c0
      0.000000
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      0.0

      RXN-8641_c0
      0.000000
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.0

      EX_L-ASPARTATE_c0
      -487.691192
      0.0

      EX_ZN+2_c0
      0.000000
      0.0

      EX_MNXM6297_c0
      0.000000
      0.0

      EX_MNXM78362_c0
      -156.355755
      0.0

1982 rows × 2 columns

    EX_CPD-12818_c0: CPD-12818_c0 -->

Optimal solution with objective value 500.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.0

      GLUTATHIONE-SYN-RXN_c0
      1000.000000
      0.0

      MNXR101695_c0
      0.000000
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      0.0

      RXN-8641_c0
      0.000000
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.0

      EX_L-ASPARTATE_c0
      -379.071419
      0.0

      EX_ZN+2_c0
      0.000000
      0.0

      EX_MNXM6297_c0
      0.000000
      0.0

      EX_MNXM78362_c0
      -230.139460
      0.0

1982 rows × 2 columns

    EX_GLUTATHIONE_c0: GLUTATHIONE_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.0

      GLUTATHIONE-SYN-RXN_c0
      1000.000000
      0.0

      MNXR101695_c0
      0.000000
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      0.0

      RXN-8641_c0
      0.000000
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.0

      EX_L-ASPARTATE_c0
      -517.945463
      0.0

      EX_ZN+2_c0
      0.000000
      0.0

      EX_MNXM6297_c0
      0.000000
      0.0

      EX_MNXM78362_c0
      -213.413591
      0.0

1982 rows × 2 columns

    EX_TYR_c0: TYR_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.0

      GLUTATHIONE-SYN-RXN_c0
      976.989785
      0.0

      MNXR101695_c0
      0.000000
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      0.0

      RXN-8641_c0
      0.000000
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.0

      EX_L-ASPARTATE_c0
      -640.402555
      0.0

      EX_ZN+2_c0
      0.000000
      0.0

      EX_MNXM6297_c0
      0.000000
      0.0

      EX_MNXM78362_c0
      -269.416566
      0.0

1982 rows × 2 columns

    EX_ASN_c0: ASN_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.0

      GLUTATHIONE-SYN-RXN_c0
      1000.000000
      0.0

      MNXR101695_c0
      0.000000
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      0.0

      RXN-8641_c0
      0.000000
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.0

      EX_L-ASPARTATE_c0
      -1000.000000
      -0.0

      EX_ZN+2_c0
      0.000000
      0.0

      EX_MNXM6297_c0
      0.000000
      0.0

      EX_MNXM78362_c0
      -273.048478
      0.0

1982 rows × 2 columns

    EX_UNDECAPRENYL-DIPHOSPHATE_c0: UNDECAPRENYL-DIPHOSPHATE_c0 -->

Optimal solution with objective value 90.909

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.000000e+00

      GLUTATHIONE-SYN-RXN_c0
      1000.000000
      1.617781e-32

      MNXR101695_c0
      0.000000
      3.081488e-33

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      -1.397941e-16

      RXN-8641_c0
      0.000000
      -0.000000e+00

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.000000e+00

      EX_L-ASPARTATE_c0
      -1000.000000
      3.826174e-17

      EX_ZN+2_c0
      0.000000
      0.000000e+00

      EX_MNXM6297_c0
      0.000000
      0.000000e+00

      EX_MNXM78362_c0
      -341.206595
      0.000000e+00

1982 rows × 2 columns

    EX_CTP_c0: CTP_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.0

      GLUTATHIONE-SYN-RXN_c0
      1000.000000
      0.0

      MNXR101695_c0
      0.000000
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      0.0

      RXN-8641_c0
      0.000000
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.0

      EX_L-ASPARTATE_c0
      -1000.000000
      0.0

      EX_ZN+2_c0
      0.000000
      0.0

      EX_MNXM6297_c0
      0.000000
      0.0

      EX_MNXM78362_c0
      -221.197381
      0.0

1982 rows × 2 columns

    EX_CO-A_c0: CO-A_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.000000e+00

      GLUTATHIONE-SYN-RXN_c0
      403.513313
      0.000000e+00

      MNXR101695_c0
      0.000000
      -0.000000e+00

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      7.932007e-16

      RXN-8641_c0
      0.000000
      -0.000000e+00

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.000000e+00

      EX_L-ASPARTATE_c0
      -1000.000000
      2.554455e-15

      EX_ZN+2_c0
      0.000000
      0.000000e+00

      EX_MNXM6297_c0
      0.000000
      0.000000e+00

      EX_MNXM78362_c0
      -235.051031
      0.000000e+00

1982 rows × 2 columns

    EX_PRO_c0: PRO_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.0

      GLUTATHIONE-SYN-RXN_c0
      140.312699
      0.0

      MNXR101695_c0
      0.000000
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      0.0

      RXN-8641_c0
      0.000000
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.0

      EX_L-ASPARTATE_c0
      -1000.000000
      0.0

      EX_ZN+2_c0
      0.000000
      0.0

      EX_MNXM6297_c0
      0.000000
      0.0

      EX_MNXM78362_c0
      -261.474023
      0.0

1982 rows × 2 columns

    EX_L-ALPHA-ALANINE_c0: L-ALPHA-ALANINE_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.0

      GLUTATHIONE-SYN-RXN_c0
      379.190295
      0.0

      MNXR101695_c0
      0.000000
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      0.0

      RXN-8641_c0
      0.000000
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.0

      EX_L-ASPARTATE_c0
      -1000.000000
      0.0

      EX_ZN+2_c0
      0.000000
      0.0

      EX_MNXM6297_c0
      0.000000
      0.0

      EX_MNXM78362_c0
      -250.072395
      0.0

1982 rows × 2 columns

    EX_MNXM7305_c0: MNXM7305_c0 -->

Optimal solution with objective value 83.333

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.000000e+00

      GLUTATHIONE-SYN-RXN_c0
      410.272447
      -1.232595e-32

      MNXR101695_c0
      0.000000
      8.628166e-32

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      -3.583589e-15

      RXN-8641_c0
      0.000000
      -0.000000e+00

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.000000e+00

      EX_L-ASPARTATE_c0
      -1000.000000
      8.456951e-16

      EX_ZN+2_c0
      0.000000
      0.000000e+00

      EX_MNXM6297_c0
      0.000000
      0.000000e+00

      EX_MNXM78362_c0
      -299.423472
      0.000000e+00

1982 rows × 2 columns

    EX_10-FORMYL-THF_c0: 10-FORMYL-THF_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.0

      GLUTATHIONE-SYN-RXN_c0
      21.074720
      0.0

      MNXR101695_c0
      0.000000
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      0.0

      RXN-8641_c0
      0.000000
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.0

      EX_L-ASPARTATE_c0
      -1000.000000
      -0.0

      EX_ZN+2_c0
      0.000000
      0.0

      EX_MNXM6297_c0
      0.000000
      0.0

      EX_MNXM78362_c0
      -317.415439
      0.0

1982 rows × 2 columns

    EX_DCTP_c0: DCTP_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.0

      GLUTATHIONE-SYN-RXN_c0
      0.040365
      0.0

      MNXR101695_c0
      0.000000
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      0.0

      RXN-8641_c0
      0.000000
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      -0.040365
      0.0

      EX_L-ASPARTATE_c0
      -1000.000000
      -0.0

      EX_ZN+2_c0
      -0.040365
      0.0

      EX_MNXM6297_c0
      -0.208209
      0.0

      EX_MNXM78362_c0
      -373.164833
      0.0

1982 rows × 2 columns

    EX_GLT_c0: GLT_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000e+00
      0.0

      GLUTATHIONE-SYN-RXN_c0
      -5.911217e-14
      0.0

      MNXR101695_c0
      0.000000e+00
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000e+00
      0.0

      RXN-8641_c0
      0.000000e+00
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000e+00
      0.0

      EX_L-ASPARTATE_c0
      -1.000000e+03
      -0.0

      EX_ZN+2_c0
      0.000000e+00
      0.0

      EX_MNXM6297_c0
      0.000000e+00
      0.0

      EX_MNXM78362_c0
      -3.282865e+02
      0.0

1982 rows × 2 columns

    EX_THF_c0: THF_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000e+00
      0.0

      GLUTATHIONE-SYN-RXN_c0
      -5.668776e-14
      0.0

      MNXR101695_c0
      0.000000e+00
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000e+00
      0.0

      RXN-8641_c0
      0.000000e+00
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000e+00
      0.0

      EX_L-ASPARTATE_c0
      -1.000000e+03
      -0.0

      EX_ZN+2_c0
      0.000000e+00
      0.0

      EX_MNXM6297_c0
      0.000000e+00
      0.0

      EX_MNXM78362_c0
      -3.601955e+02
      0.0

1982 rows × 2 columns

    EX_MNXM51417_c0: MNXM51417_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000e+00
      0.0

      GLUTATHIONE-SYN-RXN_c0
      -5.668776e-14
      0.0

      MNXR101695_c0
      0.000000e+00
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000e+00
      0.0

      RXN-8641_c0
      0.000000e+00
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000e+00
      0.0

      EX_L-ASPARTATE_c0
      -1.000000e+03
      -0.0

      EX_ZN+2_c0
      0.000000e+00
      0.0

      EX_MNXM6297_c0
      0.000000e+00
      0.0

      EX_MNXM78362_c0
      -3.601955e+02
      0.0

1982 rows × 2 columns

    EX_GTP_c0: GTP_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.0

      GLUTATHIONE-SYN-RXN_c0
      0.000000
      0.0

      MNXR101695_c0
      0.000000
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      0.0

      RXN-8641_c0
      0.000000
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.0

      EX_L-ASPARTATE_c0
      -1000.000000
      -0.0

      EX_ZN+2_c0
      0.000000
      0.0

      EX_MNXM6297_c0
      0.000000
      0.0

      EX_MNXM78362_c0
      -341.456743
      0.0

1982 rows × 2 columns

    EX_MNXM5124_c0: MNXM5124_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.0

      GLUTATHIONE-SYN-RXN_c0
      0.000000
      0.0

      MNXR101695_c0
      0.000000
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      0.0

      RXN-8641_c0
      0.000000
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.0

      EX_L-ASPARTATE_c0
      -1000.000000
      -0.0

      EX_ZN+2_c0
      0.000000
      0.0

      EX_MNXM6297_c0
      0.000000
      0.0

      EX_MNXM78362_c0
      -341.456743
      0.0

1982 rows × 2 columns

    EX_CYS_c0: CYS_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.0

      GLUTATHIONE-SYN-RXN_c0
      0.000000
      0.0

      MNXR101695_c0
      0.000000
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      0.0

      RXN-8641_c0
      0.000000
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.0

      EX_L-ASPARTATE_c0
      -1000.000000
      -0.0

      EX_ZN+2_c0
      0.000000
      0.0

      EX_MNXM6297_c0
      0.000000
      0.0

      EX_MNXM78362_c0
      -355.708698
      0.0

1982 rows × 2 columns

    EX_ADENOSYLCOBALAMIN_c0: ADENOSYLCOBALAMIN_c0 -->

Optimal solution with objective value 0.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.0

      GLUTATHIONE-SYN-RXN_c0
      0.000000
      0.0

      MNXR101695_c0
      0.000000
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      0.0

      RXN-8641_c0
      0.000000
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.0

      EX_L-ASPARTATE_c0
      -1000.000000
      -0.0

      EX_ZN+2_c0
      0.000000
      0.0

      EX_MNXM6297_c0
      0.000000
      0.0

      EX_MNXM78362_c0
      -355.708698
      0.0

1982 rows × 2 columns

    EX_PUTRESCINE_c0: PUTRESCINE_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.0

      GLUTATHIONE-SYN-RXN_c0
      0.000000
      0.0

      MNXR101695_c0
      0.000000
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      0.0

      RXN-8641_c0
      0.000000
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.0

      EX_L-ASPARTATE_c0
      -1000.000000
      -0.0

      EX_ZN+2_c0
      0.000000
      0.0

      EX_MNXM6297_c0
      0.000000
      0.0

      EX_MNXM78362_c0
      -400.898401
      0.0

1982 rows × 2 columns

    EX_ILE_c0: ILE_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.0

      GLUTATHIONE-SYN-RXN_c0
      0.000000
      0.0

      MNXR101695_c0
      0.000000
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      0.0

      RXN-8641_c0
      0.000000
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.0

      EX_L-ASPARTATE_c0
      -1000.000000
      -0.0

      EX_ZN+2_c0
      0.000000
      0.0

      EX_MNXM6297_c0
      41.666667
      0.0

      EX_MNXM78362_c0
      -500.000000
      0.0

1982 rows × 2 columns

    EX_MG+2_c0: MG+2_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.0

      GLUTATHIONE-SYN-RXN_c0
      0.000000
      0.0

      MNXR101695_c0
      0.000000
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      0.0

      RXN-8641_c0
      0.000000
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.0

      EX_L-ASPARTATE_c0
      -1000.000000
      -0.0

      EX_ZN+2_c0
      0.000000
      0.0

      EX_MNXM6297_c0
      41.666667
      0.0

      EX_MNXM78362_c0
      -500.000000
      0.0

1982 rows × 2 columns

    EX_MNXM7630_c0: MNXM7630_c0 -->

Optimal solution with objective value 0.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.0

      GLUTATHIONE-SYN-RXN_c0
      0.000000
      0.0

      MNXR101695_c0
      0.000000
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      0.0

      RXN-8641_c0
      0.000000
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.0

      EX_L-ASPARTATE_c0
      -1000.000000
      -0.0

      EX_ZN+2_c0
      0.000000
      0.0

      EX_MNXM6297_c0
      41.666667
      0.0

      EX_MNXM78362_c0
      -500.000000
      0.0

1982 rows × 2 columns

    EX_CL-_c0: CL-_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.0

      GLUTATHIONE-SYN-RXN_c0
      0.000000
      0.0

      MNXR101695_c0
      0.000000
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      0.0

      RXN-8641_c0
      0.000000
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.0

      EX_L-ASPARTATE_c0
      -1000.000000
      -0.0

      EX_ZN+2_c0
      0.000000
      0.0

      EX_MNXM6297_c0
      41.666667
      0.0

      EX_MNXM78362_c0
      -500.000000
      0.0

1982 rows × 2 columns

    EX_FE+2_c0: FE+2_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.0
      0.0

      GLUTATHIONE-SYN-RXN_c0
      0.0
      0.0

      MNXR101695_c0
      0.0
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.0
      0.0

      RXN-8641_c0
      0.0
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.0
      0.0

      EX_L-ASPARTATE_c0
      -1000.0
      -0.0

      EX_ZN+2_c0
      0.0
      0.0

      EX_MNXM6297_c0
      0.0
      0.0

      EX_MNXM78362_c0
      -500.0
      0.0

1982 rows × 2 columns

    EX_S-ADENOSYLMETHIONINE_c0: S-ADENOSYLMETHIONINE_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.0

      GLUTATHIONE-SYN-RXN_c0
      0.000000
      0.0

      MNXR101695_c0
      0.000000
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      0.0

      RXN-8641_c0
      0.000000
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.0

      EX_L-ASPARTATE_c0
      -1000.000000
      -0.0

      EX_ZN+2_c0
      0.000000
      0.0

      EX_MNXM6297_c0
      15.085321
      0.0

      EX_MNXM78362_c0
      0.000000
      0.0

1982 rows × 2 columns

    EX_MNXM7294_c0: MNXM7294_c0 -->

Optimal solution with objective value 83.333

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000e+00
      -4.930381e-32

      GLUTATHIONE-SYN-RXN_c0
      0.000000e+00
      3.358084e-18

      MNXR101695_c0
      0.000000e+00
      -0.000000e+00

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000e+00
      -1.947273e-16

      RXN-8641_c0
      0.000000e+00
      -0.000000e+00

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000e+00
      0.000000e+00

      EX_L-ASPARTATE_c0
      -1.000000e+03
      -3.953350e-16

      EX_ZN+2_c0
      0.000000e+00
      0.000000e+00

      EX_MNXM6297_c0
      -4.154926e-15
      -3.218299e-16

      EX_MNXM78362_c0
      0.000000e+00
      0.000000e+00

1982 rows × 2 columns

    EX_THR_c0: THR_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.0
      0.0

      GLUTATHIONE-SYN-RXN_c0
      0.0
      0.0

      MNXR101695_c0
      0.0
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.0
      0.0

      RXN-8641_c0
      0.0
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.0
      0.0

      EX_L-ASPARTATE_c0
      -1000.0
      -0.0

      EX_ZN+2_c0
      0.0
      0.0

      EX_MNXM6297_c0
      0.0
      0.0

      EX_MNXM78362_c0
      0.0
      0.0

1982 rows × 2 columns

    EX_5-METHYL-THF_c0: 5-METHYL-THF_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.0
      0.000000e+00

      GLUTATHIONE-SYN-RXN_c0
      0.0
      -1.397595e-14

      MNXR101695_c0
      0.0
      -3.944305e-31

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.0
      9.156212e-15

      RXN-8641_c0
      0.0
      -3.944305e-31

      ...
      ...
      ...

      EX_CO+2_c0
      0.0
      0.000000e+00

      EX_L-ASPARTATE_c0
      -1000.0
      9.328447e-15

      EX_ZN+2_c0
      0.0
      0.000000e+00

      EX_MNXM6297_c0
      0.0
      0.000000e+00

      EX_MNXM78362_c0
      0.0
      0.000000e+00

1982 rows × 2 columns

    EX_HSO4_c0: HSO4_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.0
      0.0

      GLUTATHIONE-SYN-RXN_c0
      0.0
      0.0

      MNXR101695_c0
      0.0
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.0
      0.0

      RXN-8641_c0
      0.0
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.0
      0.0

      EX_L-ASPARTATE_c0
      -1000.0
      -0.0

      EX_ZN+2_c0
      0.0
      0.0

      EX_MNXM6297_c0
      0.0
      0.0

      EX_MNXM78362_c0
      0.0
      0.0

1982 rows × 2 columns

    EX_SPERMIDINE_c0: SPERMIDINE_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.0
      0.0

      GLUTATHIONE-SYN-RXN_c0
      0.0
      0.0

      MNXR101695_c0
      0.0
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.0
      0.0

      RXN-8641_c0
      0.0
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.0
      0.0

      EX_L-ASPARTATE_c0
      -1000.0
      -0.0

      EX_ZN+2_c0
      0.0
      0.0

      EX_MNXM6297_c0
      0.0
      0.0

      EX_MNXM78362_c0
      0.0
      0.0

1982 rows × 2 columns

    EX_CPD-12822_c0: CPD-12822_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.0

      GLUTATHIONE-SYN-RXN_c0
      0.000000
      0.0

      MNXR101695_c0
      0.000000
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      0.0

      RXN-8641_c0
      0.000000
      0.0

      ...
      ...
      ...

      EX_CO+2_c0
      -0.026315
      0.0

      EX_L-ASPARTATE_c0
      -1000.000000
      -0.0

      EX_ZN+2_c0
      -0.026315
      0.0

      EX_MNXM6297_c0
      -0.135739
      -0.0

      EX_MNXM78362_c0
      -0.026315
      0.0

1982 rows × 2 columns

    EX_NADP_c0: NADP_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.0
      0.000000e+00

      GLUTATHIONE-SYN-RXN_c0
      0.0
      -2.538210e-16

      MNXR101695_c0
      0.0
      -0.000000e+00

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.0
      -2.000000e+00

      RXN-8641_c0
      0.0
      -0.000000e+00

      ...
      ...
      ...

      EX_CO+2_c0
      0.0
      0.000000e+00

      EX_L-ASPARTATE_c0
      -1000.0
      -3.030739e-16

      EX_ZN+2_c0
      0.0
      0.000000e+00

      EX_MNXM6297_c0
      0.0
      0.000000e+00

      EX_MNXM78362_c0
      0.0
      0.000000e+00

1982 rows × 2 columns

    EX_PHE_c0: PHE_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.0

      GLUTATHIONE-SYN-RXN_c0
      0.000000
      0.0

      MNXR101695_c0
      0.000000
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      0.0

      RXN-8641_c0
      0.000000
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.0

      EX_L-ASPARTATE_c0
      -1000.000000
      -0.0

      EX_ZN+2_c0
      0.000000
      0.0

      EX_MNXM6297_c0
      0.000000
      0.0

      EX_MNXM78362_c0
      -15.166995
      0.0

1982 rows × 2 columns

    EX_ARG_c0: ARG_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000e+00
      0.0

      GLUTATHIONE-SYN-RXN_c0
      0.000000e+00
      0.0

      MNXR101695_c0
      0.000000e+00
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000e+00
      0.0

      RXN-8641_c0
      0.000000e+00
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000e+00
      0.0

      EX_L-ASPARTATE_c0
      -1.000000e+03
      -0.0

      EX_ZN+2_c0
      0.000000e+00
      0.0

      EX_MNXM6297_c0
      0.000000e+00
      0.0

      EX_MNXM78362_c0
      -9.152838e-14
      0.0

1982 rows × 2 columns

    EX_CPD-9728_c0: CPD-9728_c0 -->

Optimal solution with objective value 125.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      -1.946604e-16

      GLUTATHIONE-SYN-RXN_c0
      0.000000
      7.375342e-17

      MNXR101695_c0
      0.000000
      -0.000000e+00

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      -2.464781e-16

      RXN-8641_c0
      0.000000
      -0.000000e+00

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.000000e+00

      EX_L-ASPARTATE_c0
      -1000.000000
      2.761701e-16

      EX_ZN+2_c0
      0.000000
      0.000000e+00

      EX_MNXM6297_c0
      0.000000
      0.000000e+00

      EX_MNXM78362_c0
      -9.524337
      0.000000e+00

1982 rows × 2 columns

    EX_MET_c0: MET_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.0

      GLUTATHIONE-SYN-RXN_c0
      0.000000
      0.0

      MNXR101695_c0
      0.000000
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      0.0

      RXN-8641_c0
      0.000000
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.0

      EX_L-ASPARTATE_c0
      -1000.000000
      -0.0

      EX_ZN+2_c0
      0.000000
      0.0

      EX_MNXM6297_c0
      0.000000
      0.0

      EX_MNXM78362_c0
      -35.581683
      0.0

1982 rows × 2 columns

    EX_MNXM6175_c0: MNXM6175_c0 -->

Optimal solution with objective value 41.667

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      -3.947718e-15

      GLUTATHIONE-SYN-RXN_c0
      0.000000
      -2.742452e-17

      MNXR101695_c0
      0.000000
      -0.000000e+00

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      -1.412946e-14

      RXN-8641_c0
      0.000000
      -0.000000e+00

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.000000e+00

      EX_L-ASPARTATE_c0
      -789.915255
      -5.999849e-15

      EX_ZN+2_c0
      0.000000
      0.000000e+00

      EX_MNXM6297_c0
      0.000000
      0.000000e+00

      EX_MNXM78362_c0
      -41.309146
      0.000000e+00

1982 rows × 2 columns

    EX_FE+3_c0: FE+3_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.0

      GLUTATHIONE-SYN-RXN_c0
      0.000000
      0.0

      MNXR101695_c0
      0.000000
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      0.0

      RXN-8641_c0
      0.000000
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.0

      EX_L-ASPARTATE_c0
      -640.439026
      0.0

      EX_ZN+2_c0
      0.000000
      0.0

      EX_MNXM6297_c0
      0.000000
      0.0

      EX_MNXM78362_c0
      -49.428396
      0.0

1982 rows × 2 columns

    EX_UBIQUINONE-8_c0: UBIQUINONE-8_c0 -->

Optimal solution with objective value 125.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000e+00
      1.023910e-15

      GLUTATHIONE-SYN-RXN_c0
      0.000000e+00
      2.517892e-15

      MNXR101695_c0
      0.000000e+00
      -0.000000e+00

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000e+00
      1.934107e-15

      RXN-8641_c0
      0.000000e+00
      -0.000000e+00

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000e+00
      0.000000e+00

      EX_L-ASPARTATE_c0
      -1.014877e+02
      0.000000e+00

      EX_ZN+2_c0
      0.000000e+00
      0.000000e+00

      EX_MNXM6297_c0
      0.000000e+00
      0.000000e+00

      EX_MNXM78362_c0
      2.046363e-12
      0.000000e+00

1982 rows × 2 columns

    EX_ATP_c0: ATP_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000e+00
      0.0

      GLUTATHIONE-SYN-RXN_c0
      0.000000e+00
      0.0

      MNXR101695_c0
      0.000000e+00
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000e+00
      0.0

      RXN-8641_c0
      0.000000e+00
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000e+00
      0.0

      EX_L-ASPARTATE_c0
      0.000000e+00
      0.0

      EX_ZN+2_c0
      0.000000e+00
      0.0

      EX_MNXM6297_c0
      1.305124e-16
      0.0

      EX_MNXM78362_c0
      0.000000e+00
      0.0

1982 rows × 2 columns

    EX_SIROHEME_c0: SIROHEME_c0 -->

Optimal solution with objective value 500.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000e+00
      -4.664638e-14

      GLUTATHIONE-SYN-RXN_c0
      0.000000e+00
      2.731263e-16

      MNXR101695_c0
      0.000000e+00
      -3.155444e-30

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000e+00
      7.065516e-14

      RXN-8641_c0
      0.000000e+00
      -0.000000e+00

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000e+00
      0.000000e+00

      EX_L-ASPARTATE_c0
      0.000000e+00
      -5.333180e-14

      EX_ZN+2_c0
      0.000000e+00
      0.000000e+00

      EX_MNXM6297_c0
      1.136868e-13
      0.000000e+00

      EX_MNXM78362_c0
      -5.000000e+02
      0.000000e+00

1982 rows × 2 columns

    EX_UTP_c0: UTP_c0 -->

Optimal solution with objective value 666.667

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      1.998401e-15

      GLUTATHIONE-SYN-RXN_c0
      0.000000
      3.812323e-15

      MNXR101695_c0
      0.000000
      -3.839384e-17

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      1.554312e-15

      RXN-8641_c0
      0.000000
      4.086556e-17

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.000000e+00

      EX_L-ASPARTATE_c0
      0.000000
      4.279208e-15

      EX_ZN+2_c0
      0.000000
      0.000000e+00

      EX_MNXM6297_c0
      0.000000
      0.000000e+00

      EX_MNXM78362_c0
      -346.482802
      0.000000e+00

1982 rows × 2 columns

    EX_MNXM5129_c0: MNXM5129_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.0

      GLUTATHIONE-SYN-RXN_c0
      0.000000
      0.0

      MNXR101695_c0
      0.000000
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      0.0

      RXN-8641_c0
      0.000000
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.0

      EX_L-ASPARTATE_c0
      0.000000
      -0.0

      EX_ZN+2_c0
      0.000000
      0.0

      EX_MNXM6297_c0
      -500.000000
      0.0

      EX_MNXM78362_c0
      -402.603684
      0.0

1982 rows × 2 columns

    EX_FAD_c0: FAD_c0 -->

Optimal solution with objective value 500.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      -3.892979e-13

      GLUTATHIONE-SYN-RXN_c0
      0.000000
      -1.927171e-13

      MNXR101695_c0
      0.000000
      4.038968e-28

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      -9.729654e-14

      RXN-8641_c0
      0.000000
      -0.000000e+00

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.000000e+00

      EX_L-ASPARTATE_c0
      0.000000
      3.179869e-13

      EX_ZN+2_c0
      0.000000
      0.000000e+00

      EX_MNXM6297_c0
      -500.000000
      0.000000e+00

      EX_MNXM78362_c0
      -438.444265
      0.000000e+00

1982 rows × 2 columns

    EX_MN+2_c0: MN+2_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.0

      GLUTATHIONE-SYN-RXN_c0
      0.000000
      0.0

      MNXR101695_c0
      0.000000
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      0.0

      RXN-8641_c0
      0.000000
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.0

      EX_L-ASPARTATE_c0
      0.000000
      0.0

      EX_ZN+2_c0
      0.000000
      0.0

      EX_MNXM6297_c0
      -500.000000
      0.0

      EX_MNXM78362_c0
      -453.512931
      0.0

1982 rows × 2 columns

    EX_MNXM6440_c0: MNXM6440_c0 -->

Optimal solution with objective value 250.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      2.355903e-16

      GLUTATHIONE-SYN-RXN_c0
      0.000000
      4.979446e-18

      MNXR101695_c0
      0.000000
      -0.000000e+00

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      1.285083e-13

      RXN-8641_c0
      0.000000
      -0.000000e+00

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.000000e+00

      EX_L-ASPARTATE_c0
      0.000000
      -1.805419e-16

      EX_ZN+2_c0
      0.000000
      0.000000e+00

      EX_MNXM6297_c0
      -500.000000
      0.000000e+00

      EX_MNXM78362_c0
      -433.675665
      0.000000e+00

1982 rows × 2 columns

    EX_PYRIDOXAL_PHOSPHATE_c0: PYRIDOXAL_PHOSPHATE_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.0
      5.547397e-16

      GLUTATHIONE-SYN-RXN_c0
      0.0
      7.494704e-16

      MNXR101695_c0
      0.0
      3.944305e-31

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.0
      5.427420e-16

      RXN-8641_c0
      0.0
      -7.395571e-32

      ...
      ...
      ...

      EX_CO+2_c0
      0.0
      0.000000e+00

      EX_L-ASPARTATE_c0
      0.0
      -1.413828e-15

      EX_ZN+2_c0
      0.0
      0.000000e+00

      EX_MNXM6297_c0
      -500.0
      0.000000e+00

      EX_MNXM78362_c0
      -500.0
      0.000000e+00

1982 rows × 2 columns

    EX_TRP_c0: TRP_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.0
      0.0

      GLUTATHIONE-SYN-RXN_c0
      0.0
      0.0

      MNXR101695_c0
      0.0
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.0
      0.0

      RXN-8641_c0
      0.0
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.0
      0.0

      EX_L-ASPARTATE_c0
      0.0
      0.0

      EX_ZN+2_c0
      0.0
      0.0

      EX_MNXM6297_c0
      -500.0
      0.0

      EX_MNXM78362_c0
      -500.0
      0.0

1982 rows × 2 columns

    EX_CU+2_c0: CU+2_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.0

      GLUTATHIONE-SYN-RXN_c0
      0.000000
      0.0

      MNXR101695_c0
      0.000000
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      0.0

      RXN-8641_c0
      0.000000
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      0.000000
      0.0

      EX_L-ASPARTATE_c0
      0.000000
      0.0

      EX_ZN+2_c0
      0.000000
      0.0

      EX_MNXM6297_c0
      -500.000000
      0.0

      EX_MNXM78362_c0
      -465.106539
      0.0

1982 rows × 2 columns

    EX_CO+2_c0: CO+2_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.0

      GLUTATHIONE-SYN-RXN_c0
      0.000000
      0.0

      MNXR101695_c0
      0.000000
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      0.0

      RXN-8641_c0
      0.000000
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      1000.000000
      2.0

      EX_L-ASPARTATE_c0
      0.000000
      0.0

      EX_ZN+2_c0
      0.000000
      0.0

      EX_MNXM6297_c0
      -500.000000
      0.0

      EX_MNXM78362_c0
      -465.106539
      0.0

1982 rows × 2 columns

    EX_L-ASPARTATE_c0: L-ASPARTATE_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.0

      GLUTATHIONE-SYN-RXN_c0
      0.000000
      0.0

      MNXR101695_c0
      0.000000
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      0.0

      RXN-8641_c0
      0.000000
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      1000.000000
      0.0

      EX_L-ASPARTATE_c0
      1000.000000
      2.0

      EX_ZN+2_c0
      0.000000
      0.0

      EX_MNXM6297_c0
      -500.000000
      0.0

      EX_MNXM78362_c0
      -462.440981
      0.0

1982 rows × 2 columns

    EX_ZN+2_c0: ZN+2_c0 -->

Optimal solution with objective value 1000.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.0

      GLUTATHIONE-SYN-RXN_c0
      0.000000
      0.0

      MNXR101695_c0
      0.000000
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      0.0

      RXN-8641_c0
      0.000000
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      1000.000000
      0.0

      EX_L-ASPARTATE_c0
      1000.000000
      0.0

      EX_ZN+2_c0
      1000.000000
      2.0

      EX_MNXM6297_c0
      -500.000000
      0.0

      EX_MNXM78362_c0
      -489.976786
      0.0

1982 rows × 2 columns

    EX_MNXM6297_c0: MNXM6297_c0 -->

Optimal solution with objective value 41.667

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000
      0.0

      GLUTATHIONE-SYN-RXN_c0
      0.000000
      0.0

      MNXR101695_c0
      0.000000
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.000000
      0.0

      RXN-8641_c0
      0.000000
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      1000.000000
      0.0

      EX_L-ASPARTATE_c0
      1000.000000
      0.0

      EX_ZN+2_c0
      1000.000000
      0.0

      EX_MNXM6297_c0
      41.666667
      0.0

      EX_MNXM78362_c0
      -485.707824
      0.0

1982 rows × 2 columns

    EX_MNXM78362_c0: MNXM78362_c0 -->

Optimal solution with objective value 125.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.000000e+00
      0.0

      GLUTATHIONE-SYN-RXN_c0
      0.000000e+00
      0.0

      MNXR101695_c0
      0.000000e+00
      -0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      -8.289737e-13
      0.0

      RXN-8641_c0
      0.000000e+00
      -0.0

      ...
      ...
      ...

      EX_CO+2_c0
      1.000000e+03
      0.0

      EX_L-ASPARTATE_c0
      1.000000e+03
      0.0

      EX_ZN+2_c0
      1.000000e+03
      0.0

      EX_MNXM6297_c0
      -2.122746e-13
      0.0

      EX_MNXM78362_c0
      1.250000e+02
      0.0

1982 rows × 2 columns

```python
with model:
    for blocked in blocked_bio:
        ex_precursor_reac = model.add_boundary(model.metabolites.get_by_id(blocked.id), type="exchange")
    for blocked in "EX_ACP_c0", "EX_ADENOSYLCOBALAMIN_c0", "EX_MNXM7630_c0":

        model.reactions.get_by_id(blocked).bounds=(0, 1000)
        print(model.reactions.get_by_id(blocked))
        model.objective=model.reactions.get_by_id(blocked)
        model.optimize()
```

    EX_ACP_c0: ACP_c0 -->

Optimal solution with objective value 0.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.0
      -1.187292e-15

      GLUTATHIONE-SYN-RXN_c0
      0.0
      -4.703436e-16

      MNXR101695_c0
      0.0
      -7.525211e-17

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.0
      6.769985e-16

      RXN-8641_c0
      0.0
      -0.000000e+00

      ...
      ...
      ...

      EX_cpd00063_e0
      0.0
      0.000000e+00

      EX_cpd00030_e0
      0.0
      0.000000e+00

      EX_ADENOSYLCOBALAMIN_c0
      0.0
      0.000000e+00

      EX_MNXM7630_c0
      0.0
      0.000000e+00

      EX_ACP_c0
      0.0
      0.000000e+00

1909 rows × 2 columns

    EX_ADENOSYLCOBALAMIN_c0: ADENOSYLCOBALAMIN_c0 -->

Optimal solution with objective value 0.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.0
      0.0

      GLUTATHIONE-SYN-RXN_c0
      0.0
      0.0

      MNXR101695_c0
      0.0
      0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.0
      0.0

      RXN-8641_c0
      0.0
      -0.0

      ...
      ...
      ...

      EX_cpd00063_e0
      0.0
      0.0

      EX_cpd00030_e0
      0.0
      0.0

      EX_ADENOSYLCOBALAMIN_c0
      0.0
      -0.0

      EX_MNXM7630_c0
      0.0
      0.0

      EX_ACP_c0
      0.0
      0.0

1909 rows × 2 columns

    EX_MNXM7630_c0: MNXM7630_c0 -->

Optimal solution with objective value 0.000

      fluxes
      reduced_costs

      H2PTEROATESYNTH-RXN_c0
      0.0
      0.0

      GLUTATHIONE-SYN-RXN_c0
      0.0
      0.0

      MNXR101695_c0
      0.0
      0.0

      HYPOXANPRIBOSYLTRAN-RXN_c0
      0.0
      0.0

      RXN-8641_c0
      0.0
      -0.0

      ...
      ...
      ...

      EX_cpd00063_e0
      0.0
      0.0

      EX_cpd00030_e0
      0.0
      0.0

      EX_ADENOSYLCOBALAMIN_c0
      0.0
      0.0

      EX_MNXM7630_c0
      0.0
      -0.0

      EX_ACP_c0
      0.0
      0.0

1909 rows × 2 columns

### Missing essential precursors

```python
missing_essential=essential_precursors_not_in_biomass(model, model.reactions.bio1)
missing_essential

len(missing_essential)
for_real=[]
for bio in model.reactions.bio1.metabolites:
    if bio.annotation["metanetx.chemical"] in missing_essential:
        for_real.append(bio.annotation["metanetx.chemical"])
        print(bio.annotation["metanetx.chemical"])
        bio.compartment

len(for_real)

main_comp = find_compartment_id_in_model(model, 'c')
main_comp

#memote looks for ids not in the annotation field, my IDs contain c0
```

```python

list_not_missing_met=[]
list_missing_met=[]
for met in model.metabolites:
    for mis in missing_essential:
        if mis in met.annotation.values():

            list_not_missing_met.append(mis)
            print(met.id, mis)
        elif mis not in met.annotation.values():
            list_missing_met.append(met.id)

len(set(list_not_missing_met) )
list_missing_met
#37 vs. 52 missing metabolite--> duplication in e0/c0

```

```python
both=set()      #because of duplicate ids c0 e0
for met in model.metabolites:
    for mis in missing_essential:
        if mis in met.annotation.values():
            both.add(mis)

len(both)
print(both)

#no missing essential precursors
```

### Blocked biomass precursors

```python
#blocked=find_blocked_biomass_precursors(model, model.reactions.bio1)

blocked_bio=find_blocked_biomass_precursors(model.reactions.bio1, model)
blocked_bio
```

    [<Metabolite ADENOSYLCOBALAMIN_c0 at 0x10d65f2b0>,
     <Metabolite MNXM7630_c0 at 0x10ea882e8>,
     <Metabolite ACP_c0 at 0x10e7cc898>]

### Sum biomass weight

```python
with model:

    for met in model.metabolites:

        met.formula=re.sub("(([R])\d+)", "", met.formula)
        met.formula=re.sub("([R])" , "", met.formula)
        met.formula=re.sub("(MISSING)" , "", met.formula)

    #sum_bio=sum_biomass_weight(model.reactions.bio1)
    #sum_bio

```

```python
sum_bio=sum_biomass_weight(model.reactions.bio1)
sum_bio

```

### Growth associated maintenance

```python
#growth-associated maintenance
#True if the biomass reaction includes ATP and H2O as reactants and ADP,Pi and H as products, False otherwise.
gam=gam_in_biomass(model, model.reactions.bio1)
gam
model.reactions.bio1.reaction
#What does it check(id?)?

model.metabolites.MNXM2214_c0
model.metabolites.MNXM5258_c0
model.metabolites.MNXM90619_c0

```

### False positive direct metabolites

### Bundle biomass components

```python
bundle=bundle_biomass_components(model, model.reactions.bio1)
bundle
```

### Find direct metabolites

```python

with model:
    #for met in model.metabolites:
     #   if "(" in met.formula:
      #      print(met.formula, met.id)

    model.metabolites.MNXM8231_c0.formula="C21H33N5O9P2"

    model.metabolites.get_by_id("DNA-6-O-Methyl-Guanines_c0").formula="C10H16N2NO2O6S"
    model.metabolites.MNXM8231_c0.formula
    model.metabolites.get_by_id("DNA-6-O-Methyl-Guanines_c0").formula
    direct_met=find_direct_metabolites(model, model.reactions.bio1, tolerance=1e-06)

    direct_met

   #     met.formula=re.sub("(([R])\d+)", "", met.formula)
   #     met.formula=re.sub("(([R]))" , "", met.formula)
   #     met.formula=re.sub("(MISSING)" , "", met.formula)

    sum_bio=sum_biomass_weight(model.reactions.bio1)
    sum_bio

```

### Stoichiometric consistency

```python
stoich=check_stoichiometric_consistency(model)
stoich
```

### Reset the exchange fluxes to zero

Change the exchange fluxes to zero. Then add the ones that are necessary for minimal media. (What if there is no media that we want? How does the media work ? Where does it show?
Create a dictionary where there is a readable format for the medium. Is there an annotation field for medium?

```python
#model.reactions.EX_cpd00009_e0.bounds = (0,1000)

with model:

    for reac in model.reactions:
        if reac.id.startswith("EX") or  ["MNXR137716_c0", 'MNXR137717_c0', 'MNXR137715_c0']:
            reac.bounds=(0,0)

    model.medium
    model.reactions.EX_cpd00012_e0.bounds = (-1000,1000) #ppi
    model.reactions.EX_cpd00009_e0.bounds = (-1000,1000) #pi
    model.reactions.EX_cpd00209_e0.bounds = (-1000,1000) #NO3
    model.reactions.EX_cpd00075_e0.bounds = (-1000,1000) #NO2
    model.reactions.EX_cpd00013_e0.bounds = (-1000,1000) #NH4
    model.reactions.EX_cpd00048_e0.bounds = (-1000,1000) #SO4
    model.reactions.EX_cpd00027_e0.bounds = (-1000,1000) #D-glucose
    model.reactions.EX_cpd00971_e0.bounds = (-1000,1000) #Na+
    model.reactions.EX_cpd00076_e0.bounds = (-1000,1000) #Sucrose
    model.reactions.EX_cpd00080_e0.bounds = (-1000,1000) #D-Glycerol 1-phosphate
    model.reactions.EX_cpd00001_e0.bounds = (-1000,1000) #H2O
    model.reactions.EX_cpd00011_e0.bounds = (-1000,1000) #CO2
    model.reactions.EX_cpd00067_e0.bounds = (-1000,1000) #H+
    model.reactions.EX_cpd00063_e0.bounds = (-1000,1000) #Ca2+
    model.reactions.EX_cpd00099_e0.bounds = (-1000,1000) #Cl-
    model.reactions.EX_cpd00205_e0.bounds = (-1000,1000) #K+
    model.reactions.EX_cpd00254_e0.bounds = (-1000,1000) #Mg2+
    model.reactions.EX_cpd00030_e0.bounds = (-1000,1000) #Mn2+
    model.reactions.EX_cpd00007_e0.bounds = (-1000,1000) #O2
    model.reactions.MNXR137716_c0.bounds = (-1000,1000) #
    model.reactions.MNXR137715_c0.bounds = (-1000,1000) #
    model.reactions.MNXR137717_c0.bounds = (-1000,1000) #
    model.reactions.EX_cpd00058_e0.bounds = (-1000,1000) #Cu2+
    model.reactions.EX_cpd10515_e0.bounds = (-1000,1000) #Fe2+
    model.reactions.EX_cpd10516_e0.bounds = (-1000,1000) #Fe2+
    model.reactions.EX_cpd00034_e0.bounds = (-1000,1000) #Fe2+

    model.reactions.EX_cpd00035_e0.bounds = (-1000,1000) #Fe2+
    model.reactions.EX_cpd00039_e0.bounds = (-1000,1000) #Fe2+
    model.reactions.EX_cpd00041_e0.bounds = (-1000,1000) #Fe2+
    model.reactions.EX_cpd11580_e0.bounds = (-1000,1000) #Fe2+
    model.reactions.EX_cpd00023_e0.bounds = (-1000,1000) #Fe2
    model.slim_optimize()

    model.medium
    #model.optimize()

    model.reactions.MNXR137715_c0
```

### Existing media and their description to dict

```python
chem_xref = read_csv("/Users/lizrad/Documents/Vibrio_folder/chem_xref.tsv" , sep='\t' , low_memory=False)
chem_xref
#499091 530559

df_seed = chem_xref.loc[499088:530556,'XREF':'Description']
pivoted_seed = df_seed.pivot_table(index='XREF',columns='XREF_ID',values='Description',aggfunc = lambda x: x)

#pivoted_seedd=pivoted_seed.drop(['metanetx'])
pivoted_seed
chem_xref_MNX_seed_dict = pivoted_seed.to_dict('index')
chem_xref_MNX_seed_dict2 = chem_xref_MNX_seed_dict['seed']
print(chem_xref_MNX_seed_dict2)

```

```python
#MNXR137716_c0','MNXR137717_c0','MNXR137715_c0' dont have seed IDs
medium_dict={}
for med in model.medium:
    if med.startswith("MNXR"):
        continue
    pre, seed, compartment=med.split("_")
    print(seed)
    for k in chem_xref_MNX_seed_dict2.keys():
        if seed in k:
            print (chem_xref_MNX_seed_dict2[k])
            medium_dict[pre+"_"+seed+"_"+compartment]=chem_xref_MNX_seed_dict2[k]

print(medium_dict)
```

```python
#check every combinations of mediums :(
#for L in range(0, len(model.medium)+1):
#    for subset in itertools.combinations(model.medium, L):
#        print(subset)
```

From KBase download medium in tsv. Try LB(Lysogeny Broth) and minimal nms(nitrate minimal salts medium). With Edit Media Application in KBase one can modify the existing medium)

Result: No growth (neither).
Check for blocked precursors: both blocked with 76 metabolites.

```python
media_nms = read_csv("/Users/lizrad/Documents/Vibrio_folder/LB.tsv" , sep='\t' , low_memory=False)
#media_nms = read_csv("/Users/lizrad/Documents/Vibrio_folder/minimal_nms.tsv" , sep='\t' , low_memory=False)
media_nms

comp_list=media_nms["compounds"].tolist()

with model:
    for met in model.metabolites:
        if met.annotation["seed.compound"] in comp_list:
            print(met.id, met.annotation["seed.compound"])

    #Adding the direct metabolites as exchange reactions

    for reac in model.reactions:
        if reac.id.startswith("EX"):

            reac.bounds=(0,0)
            reac.id
            pre, seed, compart =reac.id.split("_")
            if seed in comp_list:
                reac.bounds=(-1000,1000)
            for i in direct_met:
                meta, compart =i.id.split("_")
                if meta in seed:
                    reac.bounds
                    reac.bounds=(-1000,1000)
                    reac.bounds
    for d in direct_met:
        model.add_boundary(model.metabolites.get_by_id(d.id), type="exchange", reaction_id=None, lb=-1000.0, ub=1000.0)
    #
    model.medium
    len(model.medium)
    model.optimize().objective_value
    model.summary()

   # blocked_precursors=find_blocked_biomass_precursors(model.reactions.bio1, model)
   # blocked_precursors
   # len(blocked_precursors)
#model.reactions.get_by_id['EX_cpd00067_e0'].bounds

```

```python
direct_list=[]
with model:

    for d in direct_met:
        metanet,suff =d.id.split("_")
        direct_list.append(d.id)

direct_list

```

```python
direct_met_reaction_dict={}
for reac in model.reactions:
    for rmet in reac.metabolites:

        if  rmet in direct_met:
            #direct_met_reaction_dict[direct_met].append(rmet)
            print(rmet, "is in the reaction of ", reac)

```

Setting the direct precursors to medium, those that are already in the medium are found, the other direct metabolites cannot be found among the mediums.

```python

with model:

    for d in direct_list:
        pre1, suff1 =d.split("_")

        #create a new metabolite in the e0 compartment
        mcopy=model.metabolites.get_by_id("K+_c0").copy()
        mcopy.compartment = 'e0'
        mcopy.id = pre1+"_e0"
        mcopy.formula=""
        mcopy.name=""
        model.add_metabolites(mcopy)

        mcopy
        #create a new reaction between the c0 and e0 compartment

        rcopy=model.reactions.get_by_id("TRANS-RXN-143_c0").copy()
        rcopy.id="TRANS_"+d
        for r in rcopy.metabolites:
            r.remove_from_model
        #model.reactions.get_by_id(rcopy).subtract_metabolites()
        rcopy.name=""
        rcopy.gene_reaction_rule=""
        pre, suff=mcopy.id.split("_")
        rcopy.add_metabolites({
        model.metabolites.get_by_id(pre+"_c0"): -1.0, model.metabolites.get_by_id(mcopy.id): 1.0 })
        rcopy.reaction

model.reactions.get_by_id("TRANS-RXN-143_c0")

```

```python
from memote.support.helpers import find_transport_reactions
```

```python
for rxn in model.metabolites.MNXM5129_c0.reactions:
    rxn
    if rxn in find_transport_reactions(model):
        print(rxn.id)
```

```python
for met in model.reactions.MNXR136333_c0.metabolites:
    print(met.compartment, met.formula)
model.reactions.MNXR136333_c0.copy
```

```python
for met in model.reactions.MNXR136261_c0.metabolites:
    print(met, met.compartment, met.formula, met.annotation)
model.reactions.MNXR136261_c0.reaction
model.reactions.MNXR136261_c0.annotation
```

```python
for met in model.reactions.MNXR136333_c0.metabolites:
    print(met, met.compartment, met.formula)
model.reactions.MNXR136333_c0.reaction
```

```python
len(find_transport_reactions(model))

```

```python

with model:
   # add_ex = model.add_boundary(model.metabolites.MNXM6175_c0, type="exchange")
    #add_ex.id

    for d in direct_met:
        if d not in model.medium:
            metd=d.id
            model.metabolites.get_by_id(metd)
            model.add_boundary(model.metabolites.get_by_id(d.id), type="exchange", reaction_id="EX"+"_"+metd, lb=-1000, ub=1000)
        #model.reactions.add(add_ex)
        #model.reactions.EX
    for reac in model.reactions:

        if reac.id.startswith("EX"):
            print(reac.id)

    model.medium
    model.optimize()
    model.exchanges

```

```python
for reac in model.reactions:
    B=is_boundary_type(reac, "exchange", "c0")

    if B :
        reac.id
```

```python
from memote.support.helpers import find_biomass_reaction
with model:
    model.reactions.bio1.annotation['sbo'] = 'SBO:0000629'
    #model.reactions.bio1.annotation['SBO'] = 'SBO:0000629'
    model.reactions.bio1.annotation
    #model.reactions.bio1.id="biomass"

    biomass_reac=find_biomass_reaction(model)
    biomass_reac

#write_sbml_model(model, "/Users/lizrad/Dev/iVnat/iVnat.xml")

```

```python
#what is the id for the selected substrates from seed id
substrate=["cpd00076","cpd00027", "cpd00080","cpd00179", "cpd00082", "cpd00036", "cpd00224", "cpd00314", "cpd00020","cpd00029","cpd00154",
           "cpd00208","cpd00138","cpd00158","cpd00363","cpd00116","cpd00047"]

for met in model.metabolites:
    if met.annotation["seed.compound"] in substrate and met.compartment=="c0":
        print(met.id, met.annotation["seed.compound"] )

#does the subsrate have exchange reaction

ex_substrate=[]
for exchange in medium_dict.keys():
    ex, seed, suff=exchange.split("_")
    if  seed in substrate:
        print(exchange, medium_dict[exchange])
        ex_substrate.append(exchange)

```

### Transport reaction bug

```python
from __future__ import absolute_import

import logging
import re
from collections import defaultdict
from operator import itemgetter

import numpy as np
import pandas as pd
from six import iteritems, itervalues
from sympy import expand
from importlib_resources import open_text
from cobra.exceptions import Infeasible
from cobra.medium import find_boundary_types
from pylru import lrudecorator

import memote.utils as utils
import memote.support.data
import memote.utils as utils
import memote.support.data
from memote.support.helpers import find_biomass_reaction
```

```python
import memote
import cobra
```

```python
from cobra import Model, Reaction, Metabolite
# Best practise: SBML compliant IDs
model2 = Model('example_model')

#def abc_pump_annotations(base):
   # """Provide a model with an ABC transport reaction."""
atp = cobra.Metabolite("atp_c", compartment="c")
adp = cobra.Metabolite("adp_c", compartment="c")
h = cobra.Metabolite("h_c", formula="H",compartment="c")
pi = cobra.Metabolite("pi_c", compartment="c")
h2o = cobra.Metabolite("h2o_c", formula="H2O", compartment="c")
aso_c = cobra.Metabolite("aso3_c", compartment="c")
aso_e = cobra.Metabolite("aso3_e", compartment="e")

atp.annotation["biocyc"] = ["META:ATP", "META:CPD0-1634"]
adp.annotation["biocyc"] = ["META:ADP", "META:CPD0-1651"]
h.annotation["biocyc"] = "META:PROTON"
pi.annotation["biocyc"] = ["META:CPD-16459", "META:CPD-9010"]
h2o.annotation["biocyc"] = ["META:CPD-15815", "META:HYDROXYL-GROUP"]
aso_c.annotation["biocyc"] = ["META:CPD0-2040", "META:CPD-763"]
aso_e.annotation["biocyc"] = ["META:CPD0-2040", "META:CPD-763"]

pump = cobra.Reaction("PUMP")
pump.add_metabolites({aso_c: -1, atp: -1, h2o: -1,
                          adp: 1, h: 1, pi: 1, aso_e: 1})
model2.add_reactions([pump])
####################
MNXM11392_c0 = cobra.Metabolite("MNXM11392_c0", formula="C40H78O13P2", compartment="c" )
MNXM5129_c0 = cobra.Metabolite("MNXM5129_c0", formula="C40H78O10P", compartment="c" )
CPD_16459_c0 = cobra.Metabolite("CPD_16459_c0", formula="HO4P", compartment="c" )

#MNXM11392_c0 = cobra.Metabolite("MNXM11392_c0",  compartment="c" )
#MNXM5129_c0 = cobra.Metabolite("MNXM5129_c0",  compartment="c" )
#CPD_16459_c0=cobra.Metabolite("MNXM5129_c0",  compartment="c" )
h2o.annotation['bigg.metabolite']=['h2o', 'oh1']
h2o.annotation["chebi"]=['CHEBI:15377']
h2o.annotation['inchi']=['InChI=1S/H2O/h1H2']
MNXM11392_c0.annotation={'inchi': 'MISSING', 'inchikey': 'MISSING', 'metanetx.chemical': 'MNXM11392', 'seed.compound': 'cpd15716', 'smiles': 'MISSING'}
CPD_16459_c0.annotation={'bigg.metabolite': 'pi', 'biocyc': ['CPD-16459', 'CPD-9010', 'PHOSPHATE-GROUP', 'Pi'], 'chebi': 'CHEBI:43474', 'inchi': 'InChI=1S/H3O4P/c1-5(2,3)4/h(H3,1,2,3,4)/p-2', 'inchikey': 'NBIIXXVUZAFLBC-UHFFFAOYSA-L', 'kegg.compound': ['C00009', 'C13558'], 'metanetx.chemical': 'MNXM9', 'seed.compound': 'cpd00009', 'smiles': 'OP([O-])([O-])=O'}
MNXM5129_c0.annotation={'inchi': 'MISSING', 'inchikey': 'MISSING', 'metanetx.chemical': 'MNXM5129', 'seed.compound': 'cpd15722', 'smiles': 'MISSING'}

MNXR136261_c0=cobra.Reaction("MNXR136261_c0")
MNXR136261_c0.add_metabolites({ MNXM11392_c0: -1, h2o: -1,
                           h: 1, CPD_16459_c0: 1, MNXM5129_c0: 1})

model2.add_reactions([MNXR136261_c0])
#'CPD-15815_c0 + MNXM11392_c0 --> CPD-16459_c0 + MNXM5129_c0 + PROTON_c0'
####################

GLYCEROL_c0 = cobra.Metabolite("GLYCEROL_c0", formula="C3H8O3", compartment="c" )
MNXM6297_c0 = cobra.Metabolite("MNXM6297_c0", formula="C77H148O17P2", compartment="c" )

MNXR136333_c0=cobra.Reaction("MNXR136333_c0", lower_bound=-1000)
MNXR136333_c0.add_metabolites({ MNXM5129_c0: -2, GLYCEROL_c0: 1,
                           MNXM6297_c0: 1})

model2.add_reactions([MNXR136333_c0])

model2
    #return base
print('%i reaction' % len(model2.reactions))
print('%i metabolites' % len(model2.metabolites))
print('%i genes' % len(model2.genes))
pump.reaction
MNXR136261_c0.reaction
MNXR136333_c0.reaction
MNXM5129_c0.annotation

```

```python
def find_biomass_reaction(model):
    """
    Return a list of the biomass reaction(s) of the model.
    This function identifies possible biomass reactions using two steps:
    1. Return reactions that include the SBO annotation "SBO:0000629" for
    biomass.
    If no reactions can be identifies this way:
    2. Look for the ``buzzwords`` "biomass", "growth" and "bof" in reaction IDs.
    3. Look for metabolite IDs or names that contain the ``buzzword`` "biomass"
    and obtain the set of reactions they are involved in.
    4. Remove boundary reactions from this set.
    5. Return the union of reactions that match the buzzwords and of the
    reactions that metabolites are involved in that match the buzzword.
    Parameters
    ----------
    model : cobra.Model
        The metabolic model under investigation.
    Returns
    -------
    list
        Identified biomass reactions.
    """
    sbo_matches = set([rxn for rxn in model.reactions if
                       rxn.annotation is not None and
                       'SBO' in rxn.annotation and
                       rxn.annotation['SBO'] == 'SBO:0000629'])

    if len(sbo_matches) > 0:
        return list(sbo_matches)

    buzzwords = ['biomass', 'growth', 'bof']

    buzzword_matches = set([rxn for rxn in model.reactions if any(
        string in rxn.id.lower() for string in buzzwords)])

    biomass_met = []
    for met in model.metabolites:
        if met.id.lower().startswith('biomass') or met.name.lower().startswith(
            'biomass'
        ):
            biomass_met.append(met)
    if biomass_met == 1:
        biomass_met_matches = set(
            biomass_met.reactions
        ) - set(model.boundary)
    else:
        biomass_met_matches = set()

    return list(buzzword_matches | biomass_met_matches)

```

```python
def is_transport_reaction_formulae(rxn):
    """
    Return boolean if a reaction is a transport reaction (from formulae).
    Parameters
    ----------
    rxn: cobra.Reaction
        The metabolic reaction under investigation.
    """
    # Collecting criteria to classify transporters by.
    rxn_reactants = set([met.formula for met in rxn.reactants])
    rxn_products = set([met.formula for met in rxn.products])
    # Looking for formulas that stay the same on both side of the reaction.
    transported_mets = \
        [formula for formula in rxn_reactants if formula in rxn_products]
    # Collect information on the elemental differences between
    # compartments in the reaction.
    delta_dicts = find_transported_elements(rxn)
    non_zero_array = [v for (k, v) in iteritems(delta_dicts) if v != 0]
    # Excluding reactions such as oxidoreductases where no net
    # transport of Hydrogen is occurring, but rather just an exchange of
    # electrons or charges effecting a change in protonation.
    if set(transported_mets) != set('H') and list(
        delta_dicts.keys()
    ) == ['H']:
        pass
    # All other reactions for which the amount of transported elements is
    # not zero, which are not part of the model's exchange nor
    # biomass reactions, are defined as transport reactions.
    # This includes reactions where the transported metabolite reacts with
    # a carrier molecule.
    elif sum(non_zero_array):
        return True
```

```python
def find_transported_elements(rxn):
    """
    Return a dictionary showing the amount of transported elements of a rxn.
    Collects the elements for each metabolite participating in a reaction,
    multiplies the amount by the metabolite's stoichiometry in the reaction and
    bins the result according to the compartment that metabolite is in. This
    produces a dictionary of dictionaries such as this
    ``{'p': {'C': -1, 'H': -4}, c: {'C': 1, 'H': 4}}`` which shows the
    transported entities. This dictionary is then simplified to only include
    the non-zero elements of one single compartment i.e. showing the precise
    elements that are transported.
    Parameters
    ----------
    rxn : cobra.Reaction
        Any cobra.Reaction containing metabolites.
    """
    element_dist = defaultdict()
    # Collecting elements for each metabolite.
    for met in rxn.metabolites:
        if met.compartment not in element_dist:
            # Multiplication by the metabolite stoichiometry.
            element_dist[met.compartment] = \
                {k: v * rxn.metabolites[met]
                 for (k, v) in iteritems(met.elements)}
        else:
            x = {k: v * rxn.metabolites[met] for (k, v) in
                 iteritems(met.elements)}
            y = element_dist[met.compartment]
            element_dist[met.compartment] = \
                {k: x.get(k, 0) + y.get(k, 0) for k in set(x) | set(y)}
    delta_dict = defaultdict()
    # Simplification of the resulting dictionary of dictionaries.
    for elements in itervalues(element_dist):
        delta_dict.update(elements)
    # Only non-zero values get included in the returned delta-dict.
    delta_dict = {k: abs(v) for (k, v) in iteritems(delta_dict) if v != 0}
    return delta_dict

```

```python
def is_transport_reaction_annotations(rxn):
    """
    Return boolean if a reaction is a transport reaction (from annotations).
    Parameters
    ----------
    rxn: cobra.Reaction
        The metabolic reaction under investigation.
    """
    reactants = set([(k, tuple(v)) for met in rxn.reactants
                     for k, v in iteritems(met.annotation)
                     if met.id is not "H" and k is not None and v is not None])
    #print("reactants", reactants)
    products = set([(k, tuple(v)) for met in rxn.products
                    for k, v in iteritems(met.annotation)
                    if met.id is not "H" and k is not None and v is not None])
    #print("products", products)
    # Find intersection between reactant annotations and
    # product annotations to find common metabolites between them,
    # satisfying the requirements for a transport reaction. Reactions such
    # as those involving oxidoreductases (where no net transport of
    # Hydrogen is occurring, but rather just an exchange of electrons or
    # charges effecting a change in protonation) are excluded.
    transported_mets = reactants & products
    #print("transported_mets", transported_mets, len(transported_mets))

    if len(transported_mets) > 0:
        return True

```

```python
def find_transport_reactions(model):
    """
    Return a list of all transport reactions.
    Parameters
    ----------
    model : cobra.Model
        The metabolic model under investigation.
    Notes
    -----
    A transport reaction is defined as follows:
    1. It contains metabolites from at least 2 compartments and
    2. at least 1 metabolite undergoes no chemical reaction, i.e.,
    the formula and/or annotation stays the same on both sides of the equation.
    A notable exception is transport via PTS, which also contains the following
    restriction:
    3. The transported metabolite(s) are transported into a compartment through
    the exchange of a phosphate group.
    An example of transport via PTS would be
    pep(c) + glucose(e) -> glucose-6-phosphate(c) + pyr(c)
    Reactions similar to transport via PTS (referred to as "modified transport
    reactions") follow a similar pattern:
    A(x) + B-R(y) -> A-R(y) + B(y)
    Such modified transport reactions can be detected, but only when a formula
    field exists for all metabolites in a particular reaction. If this is not
    the case, transport reactions are identified through annotations, which
    cannot detect modified transport reactions.
    """
    transport_reactions = []
    transport_rxn_candidates = set(model.reactions) - set(model.boundary) \
        - set(find_biomass_reaction(model))
    #print("transport_rxn_candidates",transport_rxn_candidates)
    # Add all labeled transport reactions
    sbo_matches = set([rxn for rxn in transport_rxn_candidates if
                       rxn.annotation is not None and
                       'SBO' in rxn.annotation and
                       rxn.annotation['SBO'] in TRANSPORT_RXN_SBO_TERMS])
    if len(sbo_matches) > 0:
        transport_reactions += list(sbo_matches)
    # Find unlabeled transport reactions via formula or annotation checks
    for rxn in transport_rxn_candidates:
        # Check if metabolites have formula field
        rxn_mets = set([met.formula for met in rxn.metabolites])
        if (None not in rxn_mets) and (len(rxn_mets) != 0):
            if is_transport_reaction_formulae(rxn):
                transport_reactions.append(rxn)
        elif is_transport_reaction_annotations(rxn): #
            transport_reactions.append(rxn)
       # print("rxn_mets",rxn_mets)
    return set(transport_reactions)

```

```python
for rxn in model.metabolites.MNXM5129_c0.reactions:

    if rxn in find_transport_reactions(model):
        print(rxn.id)
```

```python
model2_trans=memote.support.helpers.find_transport_reactions(model2)
model2_trans
#find_direct_metabolites(model, bio1)
```

```python
model2_bio=find_biomass_reaction(model2)
model2_bio
```

```python
find_transported_elements(MNXR136261_c0)
```

```python
istranspann=is_transport_reaction_annotations(MNXR136261_c0)
istranspann
```

### Blocked precursors bug

```python
missing_essential=essential_precursors_not_in_biomass(model, model.reactions.bio1)
missing_essential

```

```python
def find_biomass_precursors(model, reaction):
    """
    Return a list of all biomass precursors excluding ATP and H2O.
    Parameters
    ----------
    reaction : cobra.core.reaction.Reaction
        The biomass reaction of the model under investigation.
    model : cobra.Model
        The metabolic model under investigation.
    Returns
    -------
    list
        Metabolite objects that are reactants of the biomass reaction excluding
        ATP and H2O.
    """
    id_of_main_compartment =find_compartment_id_in_model(model, 'c')
    print(id_of_main_compartment)
    gam_reactants = set()
    try:
        gam_reactants.update([
            find_met_in_model(
                model, "MNXM3", id_of_main_compartment)[0]])
    except RuntimeError:
        pass
    try:
        gam_reactants.update([
            find_met_in_model(
                model, "MNXM2", id_of_main_compartment)[0]])
    except RuntimeError:
        pass

    biomass_precursors = set(reaction.reactants) - gam_reactants
    print("number of gam", gam_reactants)

    return list(biomass_precursors)
```

```python
met = cobra.Metabolite('test')
rxn = cobra.Reaction(id='test2')
rxn.add_metabolites({met: 1})
```

```python
rxn.add_metabolites({met: -1})
```

```python
rxn
```

```python

import logging
LOGGER = logging.getLogger(__name__)
def find_blocked_biomass_precursors(reaction, model):

    LOGGER.debug("Finding blocked biomass precursors")
    precursors = find_biomass_precursors(model, reaction)
    precursors
    blocked_precursors = list()
    for precursor in precursors:
        precursor
        with model:
            dm_rxn = model.add_boundary(precursor, type="demand")

            model.objective = dm_rxn
            try:
                print("demand reaction", dm_rxn)
                solution = model.optimize()

                print(solution)
                LOGGER.debug(
                    "%s: demand flux is '%g' and solver status is '%s'",
                    str(precursor), solution.objective_value, solution.status)

                if solution.objective_value <= 0.0:
                    blocked_precursors.append(precursor)
                    print("obj value 0 or negative:", blocked_precursors)
            except Infeasible:
                blocked_precursors.append(precursor)

    return blocked_precursors
```

```python
from memote.support.helpers import find_met_in_model, find_compartment_id_in_model
x=find_biomass_precursors(model, model.reactions.bio1)

len(x)
len(model.reactions.bio1.reactants)
model.metabolites.ACP_c0
model.metabolites.ADENOSYLCOBALAMIN_c0
model.metabolites.MNXM7630_c0
```

```python
with model:
    rxn=model.add_boundary(model.metabolites.ACP_c0, type="exchange")
    model.objective = rxn
    solution = model.optimize()
    solution
    lin=linear_reaction_coefficients(model)
    lin
    solution.status
    model.summary()
    solution.fluxes
    solution.shadow_prices
    rxn.bounds
    model.metabolites.ACP_c0.reactions

```

```python
from cobra.util.solver import linear_reaction_coefficients
blocked_bio_precursor=find_blocked_biomass_precursors(model.reactions.bio1, model)

```

```python
print(model.objective)
```

```python
model.optimize()
```

```python
with model:
    #bio_copy=model.reactions.bio1.copy()
    #bio_copy
    #model.add_reaction(bio_copy)

    model.reactions.bio1.metabolites
    model.reactions.bio1.add_metabolites({model.metabolites.ACP_c0: +0.003096466851925328, model.metabolites.ADENOSYLCOBALAMIN_c0: +0.003096466851925328, model.metabolites.MNXM7630_c0: +0.025010597710894533 })
    model.reactions.bio1.metabolites
    #for reac in model.reactions:
    #    if reac.id.startswith("EX"):
    #        model.reactions.bio1.bounds=(0,0)

with model:
    reac_list=[]

    for blo in blocked_bio_precursor:
        blo
        dm_rxn = model.add_boundary(blo, type="demand", reaction_id='test')
        model.objective = dm_rxn.id
        print(model.objective)
        reac_list.append(dm_rxn)
       # dm_rxn.bounds=(0,0)
        print ('#####'*50)
        model.optimize()
        print ('#####'*50)
        model.summary

    #model.reactions.bio1.metabolites
    #model.reactions.bio1.add_metabolites({model.metabolites.ACP_c0: -1, model.metabolites.ADENOSYLCOBALAMIN_c0: -1, model.metabolites.MNXM7630_c0:-1 })
    #model.add_reactions(reac_list)

with model:
    blocked_fx=find_blocked_biomass_precursors(model.reactions.bio1, model)
    print ('Blocked Precursors')
    blocked_fx

    model.optimize()
    model.summary

    model.metabolites.ACP_c0.reactions
    model.reactions.MNXR109353_c0

```

```python

```