\n", " | fluxes | \n", "reduced_costs | \n", "
---|---|---|
ACALD | \n", "0.000000 | \n", "0.0 | \n", "
ACALDt | \n", "0.000000 | \n", "0.0 | \n", "
ACKr | \n", "0.000000 | \n", "0.0 | \n", "
ACONTa | \n", "6.007250 | \n", "0.0 | \n", "
ACONTb | \n", "6.007250 | \n", "0.0 | \n", "
... | \n", "... | \n", "... | \n", "
TALA | \n", "1.496984 | \n", "0.0 | \n", "
THD2 | \n", "0.000000 | \n", "0.0 | \n", "
TKT1 | \n", "1.496984 | \n", "0.0 | \n", "
TKT2 | \n", "1.181498 | \n", "0.0 | \n", "
TPI | \n", "7.477382 | \n", "0.0 | \n", "
95 rows × 2 columns
\n", "\n", " | fluxes | \n", "reduced_costs | \n", "
---|---|---|
ACALD | \n", "0.000000 | \n", "0.000000e+00 | \n", "
ACALDt | \n", "0.000000 | \n", "0.000000e+00 | \n", "
ACKr | \n", "0.000000 | \n", "0.000000e+00 | \n", "
ACONTa | \n", "6.007250 | \n", "0.000000e+00 | \n", "
ACONTb | \n", "6.007250 | \n", "0.000000e+00 | \n", "
... | \n", "... | \n", "... | \n", "
TALA | \n", "1.496984 | \n", "2.220446e-16 | \n", "
THD2 | \n", "0.000000 | \n", "2.220446e-16 | \n", "
TKT1 | \n", "1.496984 | \n", "0.000000e+00 | \n", "
TKT2 | \n", "1.181498 | \n", "-1.110223e-16 | \n", "
TPI | \n", "7.477382 | \n", "0.000000e+00 | \n", "
95 rows × 2 columns
\n", "\n", " | fluxes | \n", "reduced_costs | \n", "
---|---|---|
ACALD | \n", "1.495879e-14 | \n", "2.914335e-16 | \n", "
ACALDt | \n", "1.495879e-14 | \n", "0.000000e+00 | \n", "
ACKr | \n", "1.554312e-15 | \n", "1.110223e-16 | \n", "
ACONTa | \n", "6.007250e+00 | \n", "0.000000e+00 | \n", "
ACONTb | \n", "6.007250e+00 | \n", "0.000000e+00 | \n", "
... | \n", "... | \n", "... | \n", "
TALA | \n", "1.496984e+00 | \n", "-1.665335e-15 | \n", "
THD2 | \n", "5.789919e-14 | \n", "0.000000e+00 | \n", "
TKT1 | \n", "1.496984e+00 | \n", "1.665335e-16 | \n", "
TKT2 | \n", "1.181498e+00 | \n", "-2.220446e-16 | \n", "
TPI | \n", "7.477382e+00 | \n", "0.000000e+00 | \n", "
95 rows × 2 columns
\n", "\n", " | minimum | \n", "maximum | \n", "
---|---|---|
DM_4crsol_c | \n", "0.000208 | \n", "0.000219 | \n", "
DM_5drib_c | \n", "0.000210 | \n", "0.112258 | \n", "
DM_aacald_c | \n", "0.000000 | \n", "0.000000 | \n", "
DM_amob_c | \n", "0.000002 | \n", "0.000002 | \n", "
DM_mththf_c | \n", "0.000418 | \n", "0.515309 | \n", "
... | \n", "... | \n", "... | \n", "
ZN2abcpp | \n", "0.000000 | \n", "11.842500 | \n", "
ZN2t3pp | \n", "0.000000 | \n", "47.370000 | \n", "
ZN2tpp | \n", "0.000000 | \n", "47.370318 | \n", "
ZNabcpp | \n", "0.000000 | \n", "9.474064 | \n", "
Zn2tex | \n", "0.000318 | \n", "0.000335 | \n", "
2583 rows × 2 columns
\n", "\n", " | minimum | \n", "maximum | \n", "
---|---|---|
DM_4crsol_c | \n", "0.000208 | \n", "0.000219 | \n", "
DM_5drib_c | \n", "0.000210 | \n", "0.112258 | \n", "
DM_aacald_c | \n", "0.000000 | \n", "0.000000 | \n", "
DM_amob_c | \n", "0.000002 | \n", "0.000002 | \n", "
DM_mththf_c | \n", "0.000418 | \n", "0.515309 | \n", "
... | \n", "... | \n", "... | \n", "
ZN2abcpp | \n", "0.000000 | \n", "11.842500 | \n", "
ZN2t3pp | \n", "0.000000 | \n", "47.370000 | \n", "
ZN2tpp | \n", "0.000000 | \n", "47.370318 | \n", "
ZNabcpp | \n", "0.000000 | \n", "9.474064 | \n", "
Zn2tex | \n", "0.000318 | \n", "0.000335 | \n", "
2583 rows × 2 columns
\n", "\n", " | growth | \n", "status | \n", "
---|---|---|
ids | \n", "\n", " | \n", " |
(b1779) | \n", "5.034815e+00 | \n", "optimal | \n", "
(b2276) | \n", "5.475871e+00 | \n", "optimal | \n", "
(b0114) | \n", "1.224159e+00 | \n", "optimal | \n", "
(b0008) | \n", "3.028591e-15 | \n", "optimal | \n", "
\n", " | growth | \n", "status | \n", "
---|---|---|
ids | \n", "\n", " | \n", " |
(b1779) | \n", "5.034815 | \n", "optimal | \n", "
(b2276) | \n", "5.475871 | \n", "optimal | \n", "
(b0114) | \n", "1.224159 | \n", "optimal | \n", "
(b0008) | \n", "0.000000 | \n", "optimal | \n", "
\n", " | growth | \n", "status | \n", "
---|---|---|
ids | \n", "\n", " | \n", " |
(b1779) | \n", "5.034815e+00 | \n", "optimal | \n", "
(b2276) | \n", "5.475871e+00 | \n", "optimal | \n", "
(b0114) | \n", "1.224159e+00 | \n", "optimal | \n", "
(b0008) | \n", "-5.857507e-17 | \n", "optimal | \n", "
\n", " | growth | \n", "status | \n", "
---|---|---|
ids | \n", "\n", " | \n", " |
(b1779) | \n", "45.0 | \n", "optimal | \n", "
(b0008) | \n", "0.0 | \n", "optimal | \n", "
(b0114) | \n", "27.0 | \n", "optimal | \n", "
(b2276) | \n", "46.0 | \n", "optimal | \n", "
\n", " | growth | \n", "status | \n", "
---|---|---|
ids | \n", "\n", " | \n", " |
(b1779) | \n", "45.0 | \n", "optimal | \n", "
(b0008) | \n", "0.0 | \n", "optimal | \n", "
(b0114) | \n", "27.0 | \n", "optimal | \n", "
(b2276) | \n", "46.0 | \n", "optimal | \n", "
\n", " | ids | \n", "growth | \n", "status | \n", "
---|---|---|---|
0 | \n", "{b1779} | \n", "45.0 | \n", "optimal | \n", "
1 | \n", "{b2276} | \n", "NaN | \n", "time_limit | \n", "
2 | \n", "{b0008} | \n", "0.0 | \n", "optimal | \n", "
3 | \n", "{b0114} | \n", "NaN | \n", "time_limit | \n", "
Reaction identifier | EX_co2_e | \n", "
Name | CO2 exchange | \n", "
Memory address | \n", "0x07fef04703d90 | \n", "
Stoichiometry | \n", "\n",
" co2_e <=> \n", "CO2 <=> \n", " | \n",
"
GPR | \n", " |
Lower bound | -1000.0 | \n", "
Upper bound | 1000.0 | \n", "
Reaction identifier | SK_glycogen_c | \n", "
Name | glycogen sink | \n", "
Memory address | \n", "0x07fef046eb2e0 | \n", "
Stoichiometry | \n", "\n",
" glycogen_c <=> \n", "glycogen <=> \n", " | \n",
"
GPR | \n", " |
Lower bound | -1000.0 | \n", "
Upper bound | 1000.0 | \n", "
Reaction identifier | R1 | \n", "
Name | \n", " |
Memory address | \n", "0x7f8642e5bba8 | \n", "
Stoichiometry | \n", "\n",
" --> \n", "--> \n", " | \n",
"
GPR | \n", " |
Lower bound | 0.0 | \n", "
Upper bound | 20 | \n", "
Reaction identifier | R2 | \n", "
Name | \n", " |
Memory address | \n", "0x7f8642e5bda0 | \n", "
Stoichiometry | \n", "\n",
" <=> \n", "<=> \n", " | \n",
"
GPR | \n", " |
Lower bound | -10 | \n", "
Upper bound | 20 | \n", "
Reaction identifier | ACt2r | \n", "
Name | R acetate reversible transport via proton - symport | \n", "
Memory address | \n", "0x7f8642f174e0 | \n", "
Stoichiometry | \n", "\n",
" ac_e + h_e <=> ac_c + h_c \n", "Acetate + H+ <=> Acetate + H+ \n", " | \n",
"
GPR | \n", " |
Lower bound | -1000.0 | \n", "
Upper bound | 1000.0 | \n", "
\n", " | ids | \n", "growth | \n", "status | \n", "
---|---|---|---|
0 | \n", "{b1849} | \n", "0.873922 | \n", "optimal | \n", "
1 | \n", "{b1478} | \n", "0.873922 | \n", "optimal | \n", "
2 | \n", "{b1276} | \n", "0.873922 | \n", "optimal | \n", "
3 | \n", "{b0351} | \n", "0.873922 | \n", "optimal | \n", "
4 | \n", "{b3733} | \n", "0.374230 | \n", "optimal | \n", "
5 | \n", "{b1241} | \n", "0.873922 | \n", "optimal | \n", "
6 | \n", "{b0116} | \n", "0.782351 | \n", "optimal | \n", "
7 | \n", "{b0727} | \n", "0.858307 | \n", "optimal | \n", "
8 | \n", "{b0356} | \n", "0.873922 | \n", "optimal | \n", "
9 | \n", "{b2587} | \n", "0.873922 | \n", "optimal | \n", "
10 | \n", "{b0118} | \n", "0.873922 | \n", "optimal | \n", "
11 | \n", "{b0726} | \n", "0.858307 | \n", "optimal | \n", "
12 | \n", "{b3736} | \n", "0.374230 | \n", "optimal | \n", "
13 | \n", "{b3735} | \n", "0.374230 | \n", "optimal | \n", "
14 | \n", "{b2296} | \n", "0.873922 | \n", "optimal | \n", "
15 | \n", "{b3115} | \n", "0.873922 | \n", "optimal | \n", "
16 | \n", "{b3732} | \n", "0.374230 | \n", "optimal | \n", "
17 | \n", "{b0474} | \n", "0.873922 | \n", "optimal | \n", "
18 | \n", "{s0001} | \n", "0.211141 | \n", "optimal | \n", "
19 | \n", "{b3734} | \n", "0.374230 | \n", "optimal | \n", "
\n", " | ids | \n", "growth | \n", "status | \n", "
---|---|---|---|
0 | \n", "{AKGt2r} | \n", "8.739215e-01 | \n", "optimal | \n", "
1 | \n", "{D_LACt2} | \n", "8.739215e-01 | \n", "optimal | \n", "
2 | \n", "{Biomass_Ecoli_core} | \n", "0.000000e+00 | \n", "optimal | \n", "
3 | \n", "{ETOHt2r} | \n", "8.739215e-01 | \n", "optimal | \n", "
4 | \n", "{ADK1} | \n", "8.739215e-01 | \n", "optimal | \n", "
5 | \n", "{ACONTb} | \n", "3.279963e-17 | \n", "optimal | \n", "
6 | \n", "{ACt2r} | \n", "8.739215e-01 | \n", "optimal | \n", "
7 | \n", "{ACONTa} | \n", "3.344590e-15 | \n", "optimal | \n", "
8 | \n", "{ACKr} | \n", "8.739215e-01 | \n", "optimal | \n", "
9 | \n", "{ALCD2x} | \n", "8.739215e-01 | \n", "optimal | \n", "
10 | \n", "{ATPS4r} | \n", "3.742299e-01 | \n", "optimal | \n", "
11 | \n", "{ACALD} | \n", "8.739215e-01 | \n", "optimal | \n", "
12 | \n", "{ENO} | \n", "1.357454e-16 | \n", "optimal | \n", "
13 | \n", "{EX_ac_e} | \n", "8.739215e-01 | \n", "optimal | \n", "
14 | \n", "{ACALDt} | \n", "8.739215e-01 | \n", "optimal | \n", "
15 | \n", "{CS} | \n", "4.757918e-15 | \n", "optimal | \n", "
16 | \n", "{AKGDH} | \n", "8.583074e-01 | \n", "optimal | \n", "
17 | \n", "{CO2t} | \n", "4.616696e-01 | \n", "optimal | \n", "
18 | \n", "{CYTBD} | \n", "2.116629e-01 | \n", "optimal | \n", "
19 | \n", "{ATPM} | \n", "9.166475e-01 | \n", "optimal | \n", "
\n", " | ids | \n", "growth | \n", "status | \n", "
---|---|---|---|
0 | \n", "{b2465, b3919} | \n", "0.7040 | \n", "optimal | \n", "
1 | \n", "{b2935, b2464} | \n", "0.8739 | \n", "optimal | \n", "
2 | \n", "{b0008, b2465} | \n", "0.8739 | \n", "optimal | \n", "
3 | \n", "{b2465} | \n", "0.8739 | \n", "optimal | \n", "
4 | \n", "{b0008} | \n", "0.8739 | \n", "optimal | \n", "
5 | \n", "{b0008, b2464} | \n", "0.8648 | \n", "optimal | \n", "
6 | \n", "{b2465, b2935} | \n", "-0.0000 | \n", "optimal | \n", "
7 | \n", "{b0008, b3919} | \n", "0.7040 | \n", "optimal | \n", "
8 | \n", "{b2465, b2464} | \n", "0.8739 | \n", "optimal | \n", "
9 | \n", "{b0008, b2935} | \n", "0.8739 | \n", "optimal | \n", "
10 | \n", "{b3919} | \n", "0.7040 | \n", "optimal | \n", "
11 | \n", "{b2464} | \n", "0.8739 | \n", "optimal | \n", "
12 | \n", "{b2935} | \n", "0.8739 | \n", "optimal | \n", "
13 | \n", "{b2935, b3919} | \n", "0.7040 | \n", "optimal | \n", "
14 | \n", "{b3919, b2464} | \n", "0.7040 | \n", "optimal | \n", "
\n", " | ids | \n", "growth | \n", "status | \n", "
---|---|---|---|
0 | \n", "{ACONTa} | \n", "0.0000 | \n", "optimal | \n", "
1 | \n", "{ACt2r, ACONTa} | \n", "0.0000 | \n", "optimal | \n", "
2 | \n", "{ACKr} | \n", "0.8739 | \n", "optimal | \n", "
3 | \n", "{ACt2r, ACKr} | \n", "0.8739 | \n", "optimal | \n", "
4 | \n", "{ADK1, ACONTb} | \n", "0.0000 | \n", "optimal | \n", "
5 | \n", "{ACONTa, ACONTb} | \n", "0.0000 | \n", "optimal | \n", "
6 | \n", "{ACKr, ACONTa} | \n", "0.0000 | \n", "optimal | \n", "
7 | \n", "{ACKr, ACONTb} | \n", "0.0000 | \n", "optimal | \n", "
8 | \n", "{ACt2r, ADK1} | \n", "0.8739 | \n", "optimal | \n", "
9 | \n", "{ACt2r, ACONTb} | \n", "0.0000 | \n", "optimal | \n", "
10 | \n", "{ADK1, ACKr} | \n", "0.8739 | \n", "optimal | \n", "
11 | \n", "{ACONTb} | \n", "0.0000 | \n", "optimal | \n", "
12 | \n", "{ADK1, ACONTa} | \n", "0.0000 | \n", "optimal | \n", "
13 | \n", "{ACt2r} | \n", "0.8739 | \n", "optimal | \n", "
14 | \n", "{ADK1} | \n", "0.8739 | \n", "optimal | \n", "
Metabolite identifier | test_10fthf_c | \n", "
Name | 10-Formyltetrahydrofolate | \n", "
Memory address | \n", "0x7f9c91ec0a90 | \n", "
Formula | C20H21N7O7 | \n", "
Compartment | c | \n", "
In 9 reaction(s) | \n", " FTHFD, ULA4NFT, GARFT, AICART, TDPFRMT, MTHFC, BIOMASS_Ec_iAF1260_core_59p81M, BIOMASS_invivo, FMETTRS\n", " | \n", "
Name | \n", "e_coli_core | \n", "
Memory address | \n", "0x07feb1af21f28 | \n", "
Number of metabolites | \n", "72 | \n", "
Number of reactions | \n", "95 | \n", "
Number of groups | \n", "0 | \n", "
Objective expression | \n", "1.0*Biomass_Ecoli_core - 1.0*Biomass_Ecoli_core_reverse_2cdba | \n", "
Compartments | \n", "cytosol, extracellular | \n", "
Reaction identifier | EX_glu__L_e | \n", "
Name | L-Glutamate exchange | \n", "
Memory address | \n", "0x7feb1b012eb8 | \n", "
Stoichiometry | \n", "\n",
" glu__L_e --> \n", "L-Glutamate --> \n", " | \n",
"
GPR | \n", " |
Lower bound | 0.0 | \n", "
Upper bound | 1000.0 | \n", "
Metabolite identifier | atp_c | \n", "
Name | ATP | \n", "
Memory address | \n", "0x7feb1af41550 | \n", "
Formula | C10H12N5O13P3 | \n", "
Compartment | c | \n", "
In 13 reaction(s) | \n", " Biomass_Ecoli_core, ATPS4r, PGK, ACKr, ADK1, GLNS, ATPM, PFK, PPS, GLNabc, PYK, PPCK, SUCOAS\n", " | \n", "
Reaction identifier | PGI | \n", "
Name | glucose-6-phosphate isomerase | \n", "
Memory address | \n", "0x7feb1b09c2e8 | \n", "
Stoichiometry | \n", "\n",
" g6p_c <=> f6p_c \n", "D-Glucose 6-phosphate <=> D-Fructose 6-phosphate \n", " | \n",
"
GPR | b4025 | \n", "
Lower bound | -1000.0 | \n", "
Upper bound | 1000.0 | \n", "
Metabolite identifier | atp_c | \n", "
Name | ATP | \n", "
Memory address | \n", "0x7feb1af41550 | \n", "
Formula | C10H12N5O13P3 | \n", "
Compartment | c | \n", "
In 13 reaction(s) | \n", " Biomass_Ecoli_core, ATPS4r, PGK, ACKr, ADK1, GLNS, ATPM, PFK, PPS, GLNabc, PYK, PPCK, SUCOAS\n", " | \n", "
Gene identifier | b4025 | \n", "
Name | pgi | \n", "
Memory address | \n", "0x7feb1afb0f98 | \n", "
Functional | True | \n", "
In 1 reaction(s) | \n", " PGI\n", " | \n", "
Gene identifier | spam | \n", "
Name | \n", " |
Memory address | \n", "0x7feb1b0aacf8 | \n", "
Functional | True | \n", "
In 1 reaction(s) | \n", " PGI\n", " | \n", "
Name | \n", "mini_textbook | \n", "
Memory address | \n", "0x07fbe29d69cf8 | \n", "
Number of metabolites | \n", "23 | \n", "
Number of reactions | \n", "18 | \n", "
Number of groups | \n", "0 | \n", "
Objective expression | \n", "1.0*ATPM - 1.0*ATPM_reverse_5b752 + 1.0*PFK - 1.0*PFK_reverse_d24a6 | \n", "
Compartments | \n", "cytosol, extracellular | \n", "
Name | \n", "mini_textbook | \n", "
Memory address | \n", "0x07fbe29d693c8 | \n", "
Number of metabolites | \n", "23 | \n", "
Number of reactions | \n", "18 | \n", "
Number of groups | \n", "0 | \n", "
Objective expression | \n", "1.0*ATPM - 1.0*ATPM_reverse_5b752 + 1.0*PFK - 1.0*PFK_reverse_d24a6 | \n", "
Compartments | \n", "cytosol, extracellular | \n", "
Name | \n", "mini_textbook | \n", "
Memory address | \n", "0x07fbe29c6ac50 | \n", "
Number of metabolites | \n", "23 | \n", "
Number of reactions | \n", "18 | \n", "
Number of groups | \n", "0 | \n", "
Objective expression | \n", "1.0*ATPM - 1.0*ATPM_reverse_5b752 + 1.0*PFK - 1.0*PFK_reverse_d24a6 | \n", "
Compartments | \n", "cytosol, extracellular | \n", "
Name | \n", "mini_textbook | \n", "
Memory address | \n", "0x07fbe29c6ad30 | \n", "
Number of metabolites | \n", "23 | \n", "
Number of reactions | \n", "18 | \n", "
Number of groups | \n", "0 | \n", "
Objective expression | \n", "1.0*ATPM - 1.0*ATPM_reverse_5b752 + 1.0*PFK - 1.0*PFK_reverse_d24a6 | \n", "
Compartments | \n", "cytosol, extracellular | \n", "
Name | \n", "mini_textbook | \n", "
Memory address | \n", "0x07fbe29c5dd30 | \n", "
Number of metabolites | \n", "23 | \n", "
Number of reactions | \n", "18 | \n", "
Number of groups | \n", "0 | \n", "
Objective expression | \n", "1.0*ATPM - 1.0*ATPM_reverse_5b752 + 1.0*PFK - 1.0*PFK_reverse_d24a6 | \n", "
Compartments | \n", "c, e | \n", "
Name | \n", "mini_textbook | \n", "
Memory address | \n", "0x07fbe299af940 | \n", "
Number of metabolites | \n", "23 | \n", "
Number of reactions | \n", "18 | \n", "
Number of groups | \n", "0 | \n", "
Objective expression | \n", "1.0*ATPM - 1.0*ATPM_reverse_5b752 + 1.0*PFK - 1.0*PFK_reverse_d24a6 | \n", "
Compartments | \n", "c, e | \n", "
\n", " | 0 | \n", "1 | \n", "2 | \n", "3 | \n", "4 | \n", "5 | \n", "
---|---|---|---|---|---|---|
EX_fru_e | \n", "0.000000 | \n", "308.82944 | \n", "0.00000 | \n", "31.58596 | \n", "0.000000 | \n", "0.000000 | \n", "
EX_glc__D_e | \n", "0.000000 | \n", "0.00000 | \n", "308.82944 | \n", "0.00000 | \n", "31.157104 | \n", "0.000000 | \n", "
EX_gln__L_e | \n", "0.000000 | \n", "0.00000 | \n", "0.00000 | \n", "2.18112 | \n", "0.000000 | \n", "18.848678 | \n", "
EX_glu__L_e | \n", "277.588056 | \n", "6.10840 | \n", "6.10840 | \n", "0.00000 | \n", "0.000000 | \n", "0.000000 | \n", "
EX_mal__L_e | \n", "0.000000 | \n", "0.00000 | \n", "0.00000 | \n", "0.00000 | \n", "0.000000 | \n", "1000.000000 | \n", "
EX_nh4_e | \n", "0.000000 | \n", "0.00000 | \n", "0.00000 | \n", "0.00000 | \n", "4.362240 | \n", "0.000000 | \n", "
EX_o2_e | \n", "500.000000 | \n", "0.00000 | \n", "0.00000 | \n", "0.00000 | \n", "0.000000 | \n", "0.000000 | \n", "
EX_pi_e | \n", "46.944976 | \n", "2.94296 | \n", "2.94296 | \n", "2.94296 | \n", "2.942960 | \n", "12.583458 | \n", "
\n", " | carbon_source | \n", "flux_minimum | \n", "carbon_yield_minimum | \n", "mass_yield_minimum | \n", "flux_maximum | \n", "carbon_yield_maximum | \n", "mass_yield_maximum | \n", "EX_glc__D_e | \n", "EX_o2_e | \n", "
---|---|---|---|---|---|---|---|---|---|
0 | \n", "EX_glc__D_e | \n", "0.0 | \n", "0.0 | \n", "NaN | \n", "0.000000 | \n", "5.692701e-14 | \n", "NaN | \n", "-10.0 | \n", "-60.000000 | \n", "
1 | \n", "EX_glc__D_e | \n", "0.0 | \n", "0.0 | \n", "NaN | \n", "0.072244 | \n", "1.310050e+00 | \n", "NaN | \n", "-10.0 | \n", "-56.842105 | \n", "
2 | \n", "EX_glc__D_e | \n", "0.0 | \n", "0.0 | \n", "NaN | \n", "0.144488 | \n", "2.620100e+00 | \n", "NaN | \n", "-10.0 | \n", "-53.684211 | \n", "
3 | \n", "EX_glc__D_e | \n", "0.0 | \n", "0.0 | \n", "NaN | \n", "0.216732 | \n", "3.930150e+00 | \n", "NaN | \n", "-10.0 | \n", "-50.526316 | \n", "
4 | \n", "EX_glc__D_e | \n", "0.0 | \n", "0.0 | \n", "NaN | \n", "0.288975 | \n", "5.240200e+00 | \n", "NaN | \n", "-10.0 | \n", "-47.368421 | \n", "
\n", " | carbon_source | \n", "flux_minimum | \n", "carbon_yield_minimum | \n", "mass_yield_minimum | \n", "flux_maximum | \n", "carbon_yield_maximum | \n", "mass_yield_maximum | \n", "EX_o2_e | \n", "
---|---|---|---|---|---|---|---|---|
0 | \n", "EX_glc__D_e | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.000000 | \n", "0.000000 | \n", "0.000000 | \n", "-60.000000 | \n", "
1 | \n", "EX_glc__D_e | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "1.578947 | \n", "0.052632 | \n", "0.051748 | \n", "-56.842105 | \n", "
2 | \n", "EX_glc__D_e | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "3.157895 | \n", "0.105263 | \n", "0.103496 | \n", "-53.684211 | \n", "
3 | \n", "EX_glc__D_e | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "4.736842 | \n", "0.157895 | \n", "0.155245 | \n", "-50.526316 | \n", "
4 | \n", "EX_glc__D_e | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "6.315789 | \n", "0.210526 | \n", "0.206993 | \n", "-47.368421 | \n", "
\n", " | ACALD | \n", "ACALDt | \n", "ACKr | \n", "ACONTa | \n", "ACONTb | \n", "ACt2r | \n", "ADK1 | \n", "AKGDH | \n", "AKGt2r | \n", "ALCD2x | \n", "... | \n", "RPI | \n", "SUCCt2_2 | \n", "SUCCt3 | \n", "SUCDi | \n", "SUCOAS | \n", "TALA | \n", "THD2 | \n", "TKT1 | \n", "TKT2 | \n", "TPI | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "-0.771296 | \n", "-0.431093 | \n", "-2.284246 | \n", "6.735302 | \n", "6.735302 | \n", "-2.284246 | \n", "2.273930 | \n", "3.942050 | \n", "-1.589360 | \n", "-0.340203 | \n", "... | \n", "-2.314416 | \n", "6.997002 | \n", "8.082133 | \n", "335.977726 | \n", "-3.942050 | \n", "2.152983 | \n", "12.850348 | \n", "2.152983 | \n", "2.088065 | \n", "7.542984 | \n", "
1 | \n", "-2.089680 | \n", "-1.099843 | \n", "-0.386453 | \n", "10.477790 | \n", "10.477790 | \n", "-0.386453 | \n", "3.396770 | \n", "3.163168 | \n", "-1.592767 | \n", "-0.989837 | \n", "... | \n", "-1.756359 | \n", "3.093051 | \n", "3.415053 | \n", "540.804734 | \n", "-3.163168 | \n", "1.657479 | \n", "56.649368 | \n", "1.657479 | \n", "1.617715 | \n", "8.029587 | \n", "
2 | \n", "-1.108346 | \n", "-0.126460 | \n", "-1.198639 | \n", "5.057819 | \n", "5.057819 | \n", "-1.198639 | \n", "7.154043 | \n", "0.313155 | \n", "-0.227554 | \n", "-0.981886 | \n", "... | \n", "-4.491355 | \n", "7.873466 | \n", "8.606818 | \n", "558.331088 | \n", "-0.313155 | \n", "4.295540 | \n", "12.141283 | \n", "4.295540 | \n", "4.216795 | \n", "5.181243 | \n", "
3 | \n", "-1.239111 | \n", "-0.334024 | \n", "-1.284023 | \n", "12.035499 | \n", "12.035499 | \n", "-1.284023 | \n", "19.790232 | \n", "1.359155 | \n", "-0.007846 | \n", "-0.905088 | \n", "... | \n", "-2.063827 | \n", "9.002800 | \n", "10.772472 | \n", "647.037371 | \n", "-1.359155 | \n", "2.016495 | \n", "26.609381 | \n", "2.016495 | \n", "1.997461 | \n", "7.712080 | \n", "
4 | \n", "-1.943290 | \n", "-1.571257 | \n", "-0.842072 | \n", "11.035900 | \n", "11.035900 | \n", "-0.842072 | \n", "15.963163 | \n", "0.288986 | \n", "-0.861444 | \n", "-0.372033 | \n", "... | \n", "-1.468256 | \n", "7.188997 | \n", "8.085781 | \n", "368.039875 | \n", "-0.288986 | \n", "1.465663 | \n", "5.730886 | \n", "1.465663 | \n", "1.464620 | \n", "8.298285 | \n", "
5 rows × 95 columns
\n", "1.0 Biomass_Ecoli_core = 0.8739215069684306
Metabolite | \n", "Reaction | \n", "Flux | \n", "C-Number | \n", "C-Flux | \n", "
---|---|---|---|---|
glc__D_e | \n", "EX_glc__D_e | \n", "10 | \n", "6 | \n", "100.00% | \n", "
nh4_e | \n", "EX_nh4_e | \n", "4.765 | \n", "0 | \n", "0.00% | \n", "
o2_e | \n", "EX_o2_e | \n", "21.8 | \n", "0 | \n", "0.00% | \n", "
pi_e | \n", "EX_pi_e | \n", "3.215 | \n", "0 | \n", "0.00% | \n", "
Metabolite | \n", "Reaction | \n", "Flux | \n", "C-Number | \n", "C-Flux | \n", "
---|---|---|---|---|
co2_e | \n", "EX_co2_e | \n", "-22.81 | \n", "1 | \n", "100.00% | \n", "
h2o_e | \n", "EX_h2o_e | \n", "-29.18 | \n", "0 | \n", "0.00% | \n", "
h_e | \n", "EX_h_e | \n", "-17.53 | \n", "0 | \n", "0.00% | \n", "
C21H27N7O14P2
Percent | \n", "Flux | \n", "Reaction | \n", "Definition | \n", "
---|---|---|---|
13.14% | \n", "5.064 | \n", "AKGDH | \n", "akg_c + coa_c + nad_c --> co2_c + nadh_c + succoa_c | \n", "
8.04% | \n", "3.1 | \n", "Biomass_Ecoli_core | \n", "1.496 3pg_c + 3.7478 accoa_c + 59.81 atp_c + 0.361 e4p_c + 0.0709 f6p_c + 0.129 g3p_c + 0.205 g6p_c + 0.2557 gln__L_c + 4.9414 glu__L_c + 59.81 h2o_c + 3.547 nad_c + 13.0279 nadph_c + 1.7867 oaa_c + 0.5191 pep_c + 2.8328 pyr_c + 0.8977 r5p_c --> 59.81 adp_c + 4.1182 akg_c + 3.7478 coa_c + 59.81 h_c + 3.547 nadh_c + 13.0279 nadp_c + 59.81 pi_c | \n", "
41.58% | \n", "16.02 | \n", "GAPD | \n", "g3p_c + nad_c + pi_c <=> 13dpg_c + h_c + nadh_c | \n", "
13.14% | \n", "5.064 | \n", "MDH | \n", "mal__L_c + nad_c <=> h_c + nadh_c + oaa_c | \n", "
24.09% | \n", "9.283 | \n", "PDH | \n", "coa_c + nad_c + pyr_c --> accoa_c + co2_c + nadh_c | \n", "
Percent | \n", "Flux | \n", "Reaction | \n", "Definition | \n", "
---|---|---|---|
100.00% | \n", "-38.53 | \n", "NADH16 | \n", "4.0 h_c + nadh_c + q8_c --> 3.0 h_e + nad_c + q8h2_c | \n", "
C10H12N5O13P3
Percent | \n", "Flux | \n", "Reaction | \n", "Definition | \n", "
---|---|---|---|
66.58% | \n", "45.51 | \n", "ATPS4r | \n", "adp_c + 4.0 h_e + pi_c <=> atp_c + h2o_c + 3.0 h_c | \n", "
23.44% | \n", "16.02 | \n", "PGK | \n", "3pg_c + atp_c <=> 13dpg_c + adp_c | \n", "
2.57% | \n", "1.758 | \n", "PYK | \n", "adp_c + h_c + pep_c --> atp_c + pyr_c | \n", "
7.41% | \n", "5.064 | \n", "SUCOAS | \n", "atp_c + coa_c + succ_c <=> adp_c + pi_c + succoa_c | \n", "
Percent | \n", "Flux | \n", "Reaction | \n", "Definition | \n", "
---|---|---|---|
12.27% | \n", "-8.39 | \n", "ATPM | \n", "atp_c + h2o_c --> adp_c + h_c + pi_c | \n", "
76.46% | \n", "-52.27 | \n", "Biomass_Ecoli_core | \n", "1.496 3pg_c + 3.7478 accoa_c + 59.81 atp_c + 0.361 e4p_c + 0.0709 f6p_c + 0.129 g3p_c + 0.205 g6p_c + 0.2557 gln__L_c + 4.9414 glu__L_c + 59.81 h2o_c + 3.547 nad_c + 13.0279 nadph_c + 1.7867 oaa_c + 0.5191 pep_c + 2.8328 pyr_c + 0.8977 r5p_c --> 59.81 adp_c + 4.1182 akg_c + 3.7478 coa_c + 59.81 h_c + 3.547 nadh_c + 13.0279 nadp_c + 59.81 pi_c | \n", "
0.33% | \n", "-0.2235 | \n", "GLNS | \n", "atp_c + glu__L_c + nh4_c --> adp_c + gln__L_c + h_c + pi_c | \n", "
10.94% | \n", "-7.477 | \n", "PFK | \n", "atp_c + f6p_c --> adp_c + fdp_c + h_c | \n", "
\n", " | minimum | \n", "maximum | \n", "
---|---|---|
ACALD | \n", "-2.623542e-14 | \n", "0.000000e+00 | \n", "
ACALDt | \n", "-2.623542e-14 | \n", "0.000000e+00 | \n", "
ACKr | \n", "-4.012477e-14 | \n", "0.000000e+00 | \n", "
ACONTa | \n", "2.000000e+01 | \n", "2.000000e+01 | \n", "
ACONTb | \n", "2.000000e+01 | \n", "2.000000e+01 | \n", "
ACt2r | \n", "-4.012477e-14 | \n", "0.000000e+00 | \n", "
ADK1 | \n", "0.000000e+00 | \n", "1.705303e-13 | \n", "
AKGDH | \n", "2.000000e+01 | \n", "2.000000e+01 | \n", "
AKGt2r | \n", "-1.451321e-14 | \n", "0.000000e+00 | \n", "
ALCD2x | \n", "-2.273737e-14 | \n", "0.000000e+00 | \n", "
\n", " | minimum | \n", "maximum | \n", "
---|---|---|
ACALD | \n", "-2.692308 | \n", "0.0 | \n", "
ACALDt | \n", "-2.692308 | \n", "0.0 | \n", "
ACKr | \n", "-4.117647 | \n", "0.0 | \n", "
ACONTa | \n", "8.461538 | \n", "20.0 | \n", "
ACONTb | \n", "8.461538 | \n", "20.0 | \n", "
ACt2r | \n", "-4.117647 | \n", "0.0 | \n", "
ADK1 | \n", "0.000000 | \n", "17.5 | \n", "
AKGDH | \n", "2.500000 | \n", "20.0 | \n", "
AKGt2r | \n", "-1.489362 | \n", "0.0 | \n", "
ALCD2x | \n", "-2.333333 | \n", "0.0 | \n", "
\n", " | minimum | \n", "maximum | \n", "
---|---|---|
FRD7 | \n", "0.0 | \n", "980.0 | \n", "
SUCDi | \n", "20.0 | \n", "1000.0 | \n", "
\n", " | minimum | \n", "maximum | \n", "
---|---|---|
FRD7 | \n", "0.0 | \n", "0.0 | \n", "
SUCDi | \n", "20.0 | \n", "20.0 | \n", "
1.0 ATPM = 175.0
Metabolite | \n", "Reaction | \n", "Flux | \n", "Range | \n", "C-Number | \n", "C-Flux | \n", "
---|---|---|---|---|---|
glc__D_e | \n", "EX_glc__D_e | \n", "10 | \n", "[9.5; 10] | \n", "6 | \n", "100.00% | \n", "
o2_e | \n", "EX_o2_e | \n", "60 | \n", "[55.88; 60] | \n", "0 | \n", "0.00% | \n", "
Metabolite | \n", "Reaction | \n", "Flux | \n", "Range | \n", "C-Number | \n", "C-Flux | \n", "
---|---|---|---|---|---|
ac_e | \n", "EX_ac_e | \n", "0 | \n", "[-2.059; 0] | \n", "2 | \n", "0.00% | \n", "
acald_e | \n", "EX_acald_e | \n", "0 | \n", "[-1.346; 0] | \n", "2 | \n", "0.00% | \n", "
akg_e | \n", "EX_akg_e | \n", "0 | \n", "[-0.7447; 0] | \n", "5 | \n", "0.00% | \n", "
co2_e | \n", "EX_co2_e | \n", "-60 | \n", "[-60; -54.17] | \n", "1 | \n", "100.00% | \n", "
etoh_e | \n", "EX_etoh_e | \n", "0 | \n", "[-1.167; 0] | \n", "2 | \n", "0.00% | \n", "
for_e | \n", "EX_for_e | \n", "0 | \n", "[-5.833; 0] | \n", "1 | \n", "0.00% | \n", "
glu__L_e | \n", "EX_glu__L_e | \n", "0 | \n", "[-0.6731; 0] | \n", "5 | \n", "0.00% | \n", "
h2o_e | \n", "EX_h2o_e | \n", "-60 | \n", "[-60; -54.17] | \n", "0 | \n", "0.00% | \n", "
h_e | \n", "EX_h_e | \n", "0 | \n", "[-5.833; 0] | \n", "0 | \n", "0.00% | \n", "
lac__D_e | \n", "EX_lac__D_e | \n", "0 | \n", "[-1.129; 0] | \n", "3 | \n", "0.00% | \n", "
nh4_e | \n", "EX_nh4_e | \n", "0 | \n", "[0; 0.6731] | \n", "0 | \n", "0.00% | \n", "
pi_e | \n", "EX_pi_e | \n", "0 | \n", "[0; 0.171] | \n", "0 | \n", "0.00% | \n", "
pyr_e | \n", "EX_pyr_e | \n", "0 | \n", "[-1.346; 0] | \n", "3 | \n", "0.00% | \n", "
succ_e | \n", "EX_succ_e | \n", "0 | \n", "[-0.875; 0] | \n", "4 | \n", "0.00% | \n", "
C3H3O3
Percent | \n", "Flux | \n", "Range | \n", "Reaction | \n", "Definition | \n", "
---|---|---|---|---|
50.00% | \n", "10 | \n", "[9.5; 10] | \n", "GLCpts | \n", "glc__D_e + pep_c --> g6p_c + pyr_c | \n", "
0.00% | \n", "0 | \n", "[-1.129; 0] | \n", "LDH_D | \n", "lac__D_c + nad_c <=> h_c + nadh_c + pyr_c | \n", "
0.00% | \n", "0 | \n", "[0; 8.75] | \n", "ME1 | \n", "mal__L_c + nad_c --> co2_c + nadh_c + pyr_c | \n", "
0.00% | \n", "0 | \n", "[0; 8.75] | \n", "ME2 | \n", "mal__L_c + nadp_c --> co2_c + nadph_c + pyr_c | \n", "
50.00% | \n", "10 | \n", "[1.25; 18.75] | \n", "PYK | \n", "adp_c + h_c + pep_c --> atp_c + pyr_c | \n", "
0.00% | \n", "0 | \n", "[-1.346; 0] | \n", "PYRt2 | \n", "h_e + pyr_e <=> h_c + pyr_c | \n", "
Percent | \n", "Flux | \n", "Range | \n", "Reaction | \n", "Definition | \n", "
---|---|---|---|---|
0.00% | \n", "0 | \n", "[-0.1316; 0] | \n", "Biomass_Ecoli_core | \n", "1.496 3pg_c + 3.7478 accoa_c + 59.81 atp_c + 0.361 e4p_c + 0.0709 f6p_c + 0.129 g3p_c + 0.205 g6p_c + 0.2557 gln__L_c + 4.9414 glu__L_c + 59.81 h2o_c + 3.547 nad_c + 13.0279 nadph_c + 1.7867 oaa_c + 0.5191 pep_c + 2.8328 pyr_c + 0.8977 r5p_c --> 59.81 adp_c + 4.1182 akg_c + 3.7478 coa_c + 59.81 h_c + 3.547 nadh_c + 13.0279 nadp_c + 59.81 pi_c | \n", "
100.00% | \n", "-20 | \n", "[-28.75; -13] | \n", "PDH | \n", "coa_c + nad_c + pyr_c --> accoa_c + co2_c + nadh_c | \n", "
0.00% | \n", "0 | \n", "[-5.833; 0] | \n", "PFL | \n", "coa_c + pyr_c --> accoa_c + for_c | \n", "
0.00% | \n", "0 | \n", "[-8.75; 0] | \n", "PPS | \n", "atp_c + h2o_c + pyr_c --> amp_c + 2.0 h_c + pep_c + pi_c | \n", "
\n", " | fluxes | \n", "reduced_costs | \n", "
---|---|---|
ACALD | \n", "0.000000e+00 | \n", "0.0 | \n", "
ACALDt | \n", "0.000000e+00 | \n", "0.0 | \n", "
ACKr | \n", "7.454685e-15 | \n", "0.0 | \n", "
ACONTa | \n", "6.007250e+00 | \n", "0.0 | \n", "
ACONTb | \n", "6.007250e+00 | \n", "0.0 | \n", "
... | \n", "... | \n", "... | \n", "
TALA | \n", "1.496984e+00 | \n", "0.0 | \n", "
THD2 | \n", "0.000000e+00 | \n", "0.0 | \n", "
TKT1 | \n", "1.496984e+00 | \n", "0.0 | \n", "
TKT2 | \n", "1.181498e+00 | \n", "0.0 | \n", "
TPI | \n", "7.477382e+00 | \n", "0.0 | \n", "
95 rows × 2 columns
\n", "Attribute | Description | Value |
solver |
Mathematical optimization solver | {interface_to_str(self.solver)} |
tolerance |
General solver tolerance (feasibility, integrality, etc.) | {self.tolerance} |
lower_bound |
Default reaction lower bound | {self.lower_bound} |
upper_bound |
Default reaction upper bound | {self.upper_bound} |
processes |
Number of parallel processes | {self.processes} |
cache_directory |
Path for the model cache | {self.cache_directory} |
max_cache_size |
Maximum cache size in bytes | {self.max_cache_size} |
cache_expiration |
Model cache expiration time in seconds (if any) | {self.cache_expiration} |
Gene identifier | {self.id} |
Name | {self.name} |
Memory address | {id(self):#x} |
Functional | {self.functional} |
In {len(self.reactions)} reaction(s) | {format_long_string(", ".join(r.id for r in self.reactions), 200)} |
GPR
{format_long_string(self.to_string(), 100)}
""" def as_symbolic( self, names: dict = None, ) -> Union[spl.Or, spl.And, Symbol]: """Convert compiled ast to sympy expression. Parameters ---------- self : GPR compiled ast Module describing GPR names: dict dictionary of gene ids to gene names. If this is empty, returns sympy expression using gene ids Returns ------ Symbol or BooleanFunction SYMPY expression (Symbol or And or Or). Symbol("") if the GPR is empty Notes ----- Calls _symbolic_gpr() """ # noinspection PyTypeChecker if names: GPRGene_dict = {gid: Symbol(names[gid]) for gid in self.genes} else: GPRGene_dict = None return self._symbolic_gpr(self, GPRGene_dict=GPRGene_dict) def _symbolic_gpr( self, expr: Union["GPR", Expression, BoolOp, Name, list] = None, GPRGene_dict: dict = None, ) -> Union[spl.Or, spl.And, Symbol]: """Parse gpr into SYMPY using ast similar to _ast2str(). Parameters ---------- expr : AST or GPR or list or Name or BoolOp compiled GPR GPRGene_dict: dict dictionary from gene id to GPRGeneSymbol Returns ------- Symbol or BooleanFunction SYMPY expression (Symbol or And or Or). Symbol("") if the GPR is empty """ if GPRGene_dict is None: GPRGene_dict = {gid: Symbol(name=gid) for gid in expr.genes} if isinstance(expr, (Expression, GPR)): return ( self._symbolic_gpr(expr.body, GPRGene_dict) if expr.body else Symbol("") ) else: if isinstance(expr, Name): return GPRGene_dict.get(expr.id) elif isinstance(expr, BoolOp): op = expr.op if isinstance(op, Or): # noinspection PyTypeChecker sym_exp = spl.Or( *[self._symbolic_gpr(i, GPRGene_dict) for i in expr.values] ) elif isinstance(op, And): # noinspection PyTypeChecker sym_exp = spl.And( *[self._symbolic_gpr(i, GPRGene_dict) for i in expr.values] ) else: raise TypeError("Unsupported operation " + op.__class__.__name) return sym_exp elif not expr: return Symbol("") else: raise TypeError("Unsupported Expression " + repr(expr)) @classmethod def from_symbolic(cls, sympy_gpr: Union[spl.BooleanFunction, Symbol]) -> "GPR": """Construct a GPR from a sympy expression. Parameters ---------- sympy_gpr: sympy a sympy that describes the gene rules, being a Symbol for single genes or a BooleanFunction for AND/OR relationships Returns ------- GPR: returns a new GPR while setting self.body as Parsed AST tree that has the gene rules This function also sets self._genes with the gene ids in the AST """ def _sympy_to_ast( sympy_expr: Union[spl.BooleanFunction, Symbol] ) -> Union[BoolOp, Name]: if sympy_expr.func is spl.Or: return BoolOp( op=Or(), values=[_sympy_to_ast(i) for i in sympy_expr.args] ) elif sympy_expr.func is spl.And: return BoolOp( op=And(), values=[_sympy_to_ast(i) for i in sympy_expr.args] ) elif not sympy_expr.args: return Name(id=sympy_expr.name) else: raise TypeError(f"Unsupported operation: {sympy_expr.func}") if not isinstance(sympy_gpr, (spl.BooleanFunction, Symbol)): raise TypeError( f"{cls.__name__}.from_symbolic " f"requires a sympy BooleanFunction or " f"Symbol argument, not {type(sympy_gpr)}." ) gpr = cls() if sympy_gpr == Symbol(""): gpr.body = None return gpr try: tree = Expression(_sympy_to_ast(sympy_gpr)) except SyntaxError as e: logger.warning( f"Problem with sympy expression '{sympy_gpr}' for {repr(gpr)}", ) logger.warning("GPR will be empty") logger.warning(e.msg) return gpr gpr = cls(tree) gpr.update_genes() return gpr def __eq__(self, other) -> bool: """Check equality of GPR via symbolic equality.""" if not self.body and not other.body: return True elif not self.body or not other.body: return False else: self_symb = self.as_symbolic() other_symb = other.as_symbolic() if isinstance(self_symb, Symbol) and isinstance(other_symb, Symbol): return self_symb == other_symb if isinstance(self_symb, Symbol) or isinstance(other_symb, Symbol): return False return self_symb.equals(other_symb) def eval_gpr(expr: Union[Expression, GPR], knockouts: Union[DictList, set]) -> bool: """Evaluate compiled ast of gene_reaction_rule with knockouts. .. deprecated :: Use GPR().eval() in the future. Because of the GPR() class, this function will be removed. Parameters ---------- expr : Expression or GPR The ast of the gene reaction rule knockouts : DictList, set Set of genes that are knocked out Returns ------- bool True if the gene reaction rule is true with the given knockouts otherwise false """ warn( "eval_gpr() will be removed soon." "Use GPR().eval(knockouts) in the future", DeprecationWarning, ) if isinstance(expr, GPR): return expr.eval(knockouts=knockouts) else: return GPR(expr).eval(knockouts=knockouts) # functions for gene reaction rules def ast2str(expr: Union[Expression, GPR], level: int = 0, names: dict = None) -> str: """Convert compiled ast to gene_reaction_rule str. Parameters ---------- expr : AST or GPR AST or GPR level : int internal use only. Ignored because of GPR() class, kept only for interface consistency with code still using ast2str. names : dict Dict where each element id a gene identifier and the value is the gene name. Use this to get a rule str which uses names instead. This should be done for display purposes only. All gene_reaction_rule strings which are computed with should use the id. Returns ------ string The gene reaction rule .. deprecated :: Use GPR.to_string(names=) in the future. Because of the GPR() class, this function will be removed. """ warn( "ast2satr() will be removed soon. Use gpr.to_string(names=names) in the future", DeprecationWarning, ) if isinstance(expr, GPR): return expr.to_string(names=names) else: return GPR(expr).to_string(names=names) cobrapy-0.29.1/src/cobra/core/group.py 0000664 0000000 0000000 00000011304 14673015623 0017563 0 ustar 00root root 0000000 0000000 """Define the group class.""" from typing import Iterable, Optional, Set from warnings import warn from .object import Object class Group(Object): """ Manage groups via this implementation of the SBML group specification. `Group` is a class for holding information regarding a pathways, subsystems, or other custom groupings of objects within a cobra.Model object. Parameters ---------- id : str The identifier to associate with this group name : str, optional A human readable name for the group members : iterable, optional A DictList containing references to cobra.Model-associated objects that belong to the group. kind : {"collection", "classification", "partonomy"}, optional The kind of group, as specified for the Groups feature in the SBML level 3 package specification. Can be any of "classification", "partonomy", or "collection". The default is "collection". Please consult the SBML level 3 package specification to ensure you are using the proper value for kind. In short, members of a "classification" group should have an "is-a" relationship to the group (e.g. member is-a polar compound, or member is-a transporter). Members of a "partonomy" group should have a "part-of" relationship (e.g. member is part-of glycolysis). Members of a "collection" group do not have an implied relationship between the members, so use this value for kind when in doubt (e.g. member is a gap-filled reaction, or member is involved in a disease phenotype). """ KIND_TYPES = ("collection", "classification", "partonomy") def __init__( self, id: str, name: str = "", members: Optional[Iterable] = None, kind: Optional[str] = None, ): """Initialize the group object. id : str The identifier to associate with this group name : str, optional A human readable name for the group members : iterable, optional A DictList containing references to cobra.Model-associated objects that belong to the group. kind : {"collection", "classification", "partonomy"}, optional The kind of group, as specified for the Groups feature in the SBML level 3 package specification. """ Object.__init__(self, id, name) self._members = set() if members is None else set(members) self._kind = None self.kind = "collection" if kind is None else kind # self.model is None or refers to the cobra.Model that # contains self self._model = None def __len__(self) -> int: """Get length of group. Returns ------- int An int with the length of the group. """ return len(self._members) # read-only @property def members(self) -> Set: """Get members of the group. Returns ------- Set A Set containing the members of the group. """ return self._members @property def kind(self) -> str: """Return the group kind. Returns ------- str The group kind. Should be one of the three types allowed in SBML. """ return self._kind @kind.setter def kind(self, kind: str) -> None: """Set the group kind. Parameters ---------- kind: str Must be one of the allowed kind types "collection", "classification", "partonomy". If kind is not one of these types, a ValueError Exception is raised. """ kind = kind.lower() if kind in self.KIND_TYPES: self._kind = kind else: raise ValueError(f"Kind can only by one of: {', '.join(self.KIND_TYPES)}.") def add_members(self, new_members: list) -> None: """Add objects to the group. Parameters ---------- new_members : list A list of cobrapy objects to add to the group. """ if isinstance(new_members, str) or hasattr(new_members, "id"): warn("need to pass in a list") new_members = [new_members] self._members.update(new_members) def remove_members(self, to_remove: list) -> None: """Remove objects from the group. Parameters ---------- to_remove : list A list of cobra objects to remove from the group """ if isinstance(to_remove, str) or hasattr(to_remove, "id"): warn("need to pass in a list") to_remove = [to_remove] self._members.difference_update(to_remove) cobrapy-0.29.1/src/cobra/core/metabolite.py 0000664 0000000 0000000 00000026336 14673015623 0020567 0 ustar 00root root 0000000 0000000 """Define the Metabolite class.""" import re from typing import TYPE_CHECKING, Dict, Optional, Union from warnings import warn from ..exceptions import OptimizationError from ..util.solver import check_solver_status from ..util.util import format_long_string from .formula import elements_and_molecular_weights from .species import Species if TYPE_CHECKING: from optlang.interface import Container from pandas import DataFrame from cobra.core import Solution from cobra.summary.metabolite_summary import MetaboliteSummary # Numbers are not required because of the |(?=[A-Z])? block. See the # discussion in https://github.com/opencobra/cobrapy/issues/128 for # more details. element_re = re.compile("([A-Z][a-z]?)([0-9.]+[0-9.]?|(?=[A-Z])?)") class Metabolite(Species): """Class for information about metabolite in cobra.Reaction. Metabolite is a class for holding information regarding a metabolite in a cobra.Reaction object. Parameters ---------- id : str the identifier to associate with the metabolite formula : str Chemical formula (e.g. H2O) name : str A human readable name. charge : float The charge number of the metabolite compartment: str or None Compartment of the metabolite. """ # noinspection PyShadowingBuiltins def __init__( self, id: Optional[str] = None, formula: Optional[str] = None, name: Optional[str] = "", charge: Optional[float] = None, compartment: Optional[str] = None, ) -> None: """Initialize Metaboblite cobra Species. Parameters ---------- id : str the identifier to associate with the metabolite formula : str Chemical formula (e.g. H2O) name : str A human readable name. charge : float The charge number of the metabolite compartment: str or None Compartment of the metabolite. """ super().__init__(id=id, name=name) self.formula = formula # because in a Model a metabolite may participate in multiple Reactions self.compartment = compartment self.charge = charge self._bound = 0.0 def _set_id_with_model(self, value: str) -> None: """Set id with value. Parameters ---------- value: str """ if value in self.model.metabolites: raise ValueError( f"The model already contains a metabolite with the id:" f" {value}" ) self.model.constraints[self.id].name = value self._id = value self.model.metabolites._generate_index() @property def constraint(self) -> "Container": """Get the constraints associated with this metabolite from the solver. Returns ------- optlang.Metabolite identifier | {self.id} |
Name | {format_long_string(self.name)} |
Memory address | {id(self):#x} |
Formula | {self.formula} |
Compartment | {self.compartment} |
In {len(self.reactions)} reaction(s) | {format_long_string(", ".join(r.id for r in self.reactions), 200)} |
Name | {self.id} |
Memory address | {f"{id(self):x}"} |
Number of metabolites | {len(self.metabolites)} |
Number of reactions | {len(self.reactions)} |
Number of genes | {len(self.genes)} |
Number of groups | {len(self.groups)} |
Objective expression | {format_long_string(str(self.objective.expression), 100)} |
Compartments | {", ".join(v if v else k for k, v in self.compartments.items())} |
Reaction identifier | {format_long_string( self.id, 100)} |
Name | {format_long_string( self.name, 100)} |
Memory address | {f"{id(self):#x}"} |
Stoichiometry |
{format_long_string( self.build_reaction_string(), 200)} {format_long_string( self.build_reaction_string(True), 200)} |
GPR | {format_long_string( self.gene_reaction_rule, 100)} |
Lower bound | {self.lower_bound} |
Upper bound | {self.upper_bound} |