Skip to content

Commit

Permalink
Update JN_02_analysis.ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
VonAlphaBisZulu committed Jun 7, 2022
1 parent 9d914b6 commit 419ba98
Showing 1 changed file with 34 additions and 21 deletions.
55 changes: 34 additions & 21 deletions docs/source/examples/JN_02_analysis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,18 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 1,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Set parameter Username\n",
"Academic license - for non-commercial use only - expires 2022-07-13\n"
]
}
],
"source": [
"import cobra\n",
"import straindesign as sd\n",
Expand Down Expand Up @@ -126,14 +135,14 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The sum of fluxes of the regular FBA: 2508.293334194643is usually higher than of the parsimoniuos FBA: 518.4220855176071\n"
"The sum of fluxes of the regular FBA: 2508.293334194643 is usually higher than of the parsimoniuos FBA: 518.4220855176071\n"
]
}
],
Expand All @@ -153,7 +162,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 6,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -182,7 +191,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 7,
"metadata": {},
"outputs": [
{
Expand All @@ -191,7 +200,7 @@
"{'cplex', 'glpk', 'gurobi', 'scip'}"
]
},
"execution_count": 17,
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -209,7 +218,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 8,
"metadata": {},
"outputs": [
{
Expand All @@ -235,14 +244,14 @@
},
{
"cell_type": "code",
"execution_count": 25,
"execution_count": 9,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"When the model's solver is '<optlang.gurobi_interface.Configuration object at 0x000001C9B8A5A970>', StrainDesign selects gurobi.\n"
"When the model's solver is '<optlang.gurobi_interface.Configuration object at 0x0000027BA3654160>', StrainDesign selects gurobi.\n"
]
}
],
Expand All @@ -259,7 +268,7 @@
},
{
"cell_type": "code",
"execution_count": 28,
"execution_count": 10,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -290,7 +299,7 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 11,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -328,7 +337,7 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 12,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -373,15 +382,19 @@
},
{
"cell_type": "code",
"execution_count": 68,
"execution_count": 13,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Minimum yield (FBA): 0.031965425062067315.\n",
"Minimum yield (yOpt): 0.03629426243040193.\n"
"ename": "AttributeError",
"evalue": "'DataFrame' object has no attribute 'fluxes'",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mAttributeError\u001b[0m Traceback (most recent call last)",
"\u001b[1;32mc:\\Users\\Philipp\\Documents\\Python\\straindesign\\docs\\source\\examples\\JN_02_analysis.ipynb Cell 29'\u001b[0m in \u001b[0;36m<cell line: 6>\u001b[1;34m()\u001b[0m\n\u001b[0;32m <a href='vscode-notebook-cell:/c%3A/Users/Philipp/Documents/Python/straindesign/docs/source/examples/JN_02_analysis.ipynb#ch0000028?line=2'>3</a>\u001b[0m constraint \u001b[39m=\u001b[39m \u001b[39m'\u001b[39m\u001b[39m-EX_o2_e <= 3\u001b[39m\u001b[39m'\u001b[39m\n\u001b[0;32m <a href='vscode-notebook-cell:/c%3A/Users/Philipp/Documents/Python/straindesign/docs/source/examples/JN_02_analysis.ipynb#ch0000028?line=4'>5</a>\u001b[0m sol_fba \u001b[39m=\u001b[39m sd\u001b[39m.\u001b[39mfba(model,obj\u001b[39m=\u001b[39m\u001b[39m'\u001b[39m\u001b[39mBIOMASS_Ecoli_core_w_GAM\u001b[39m\u001b[39m'\u001b[39m,obj_sense\u001b[39m=\u001b[39m\u001b[39m'\u001b[39m\u001b[39mmaximize\u001b[39m\u001b[39m'\u001b[39m,constraints\u001b[39m=\u001b[39mconstraint)\n\u001b[1;32m----> <a href='vscode-notebook-cell:/c%3A/Users/Philipp/Documents/Python/straindesign/docs/source/examples/JN_02_analysis.ipynb#ch0000028?line=5'>6</a>\u001b[0m fba_yield \u001b[39m=\u001b[39m solution\u001b[39m.\u001b[39;49mfluxes[numerator] \u001b[39m/\u001b[39m \u001b[39m-\u001b[39msolution\u001b[39m.\u001b[39mfluxes[\u001b[39m'\u001b[39m\u001b[39mEX_glc__D_e\u001b[39m\u001b[39m'\u001b[39m] \n\u001b[0;32m <a href='vscode-notebook-cell:/c%3A/Users/Philipp/Documents/Python/straindesign/docs/source/examples/JN_02_analysis.ipynb#ch0000028?line=7'>8</a>\u001b[0m sol_yopt \u001b[39m=\u001b[39m sd\u001b[39m.\u001b[39myopt(model,obj_num\u001b[39m=\u001b[39mnumerator,obj_den\u001b[39m=\u001b[39mdenominator,obj_sense\u001b[39m=\u001b[39m\u001b[39m'\u001b[39m\u001b[39mmaximize\u001b[39m\u001b[39m'\u001b[39m,constraints\u001b[39m=\u001b[39mconstraint)\n\u001b[0;32m <a href='vscode-notebook-cell:/c%3A/Users/Philipp/Documents/Python/straindesign/docs/source/examples/JN_02_analysis.ipynb#ch0000028?line=8'>9</a>\u001b[0m yopt_yield \u001b[39m=\u001b[39m sol_yopt\u001b[39m.\u001b[39mobjective_value\n",
"File \u001b[1;32mc:\\Users\\Philipp\\anaconda3\\envs\\cnapy-dev\\lib\\site-packages\\pandas\\core\\generic.py:5575\u001b[0m, in \u001b[0;36mNDFrame.__getattr__\u001b[1;34m(self, name)\u001b[0m\n\u001b[0;32m <a href='file:///c%3A/Users/Philipp/anaconda3/envs/cnapy-dev/lib/site-packages/pandas/core/generic.py?line=5567'>5568</a>\u001b[0m \u001b[39mif\u001b[39;00m (\n\u001b[0;32m <a href='file:///c%3A/Users/Philipp/anaconda3/envs/cnapy-dev/lib/site-packages/pandas/core/generic.py?line=5568'>5569</a>\u001b[0m name \u001b[39mnot\u001b[39;00m \u001b[39min\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_internal_names_set\n\u001b[0;32m <a href='file:///c%3A/Users/Philipp/anaconda3/envs/cnapy-dev/lib/site-packages/pandas/core/generic.py?line=5569'>5570</a>\u001b[0m \u001b[39mand\u001b[39;00m name \u001b[39mnot\u001b[39;00m \u001b[39min\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_metadata\n\u001b[0;32m <a href='file:///c%3A/Users/Philipp/anaconda3/envs/cnapy-dev/lib/site-packages/pandas/core/generic.py?line=5570'>5571</a>\u001b[0m \u001b[39mand\u001b[39;00m name \u001b[39mnot\u001b[39;00m \u001b[39min\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_accessors\n\u001b[0;32m <a href='file:///c%3A/Users/Philipp/anaconda3/envs/cnapy-dev/lib/site-packages/pandas/core/generic.py?line=5571'>5572</a>\u001b[0m \u001b[39mand\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_info_axis\u001b[39m.\u001b[39m_can_hold_identifiers_and_holds_name(name)\n\u001b[0;32m <a href='file:///c%3A/Users/Philipp/anaconda3/envs/cnapy-dev/lib/site-packages/pandas/core/generic.py?line=5572'>5573</a>\u001b[0m ):\n\u001b[0;32m <a href='file:///c%3A/Users/Philipp/anaconda3/envs/cnapy-dev/lib/site-packages/pandas/core/generic.py?line=5573'>5574</a>\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39m[name]\n\u001b[1;32m-> <a href='file:///c%3A/Users/Philipp/anaconda3/envs/cnapy-dev/lib/site-packages/pandas/core/generic.py?line=5574'>5575</a>\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mobject\u001b[39;49m\u001b[39m.\u001b[39;49m\u001b[39m__getattribute__\u001b[39;49m(\u001b[39mself\u001b[39;49m, name)\n",
"\u001b[1;31mAttributeError\u001b[0m: 'DataFrame' object has no attribute 'fluxes'"
]
}
],
Expand Down Expand Up @@ -434,11 +447,11 @@
"\\begin{array}{l c}\n",
"\t\\text{maximize} \\; & y \\\\\\\\\n",
"\t\\text{subject to} &\n",
"\t\\begin{bmatrix*}[r]\n",
"\t\\begin{bmatrix}\n",
"\t\t\\mathbf{A~} & \\mathbf{-b} & \\mathbf{0} \\\\\n",
"\t\t\\mathbf{d}^\\intercal & 0 \t\t & 0 \\\\\n",
"\t\t\\mathbf{c}^\\intercal & 0 \t\t & -1 \\\\\n",
"\t\\end{bmatrix*} \n",
"\t\\end{bmatrix} \n",
"\t\\begin{bmatrix}\\mathbf{\\tilde{x}} \\\\ e \\\\ y \\end{bmatrix} \n",
"\t\\begin{matrix} \\le \\\\ = \\\\ = \\end{matrix} \n",
"\t\\begin{bmatrix}\\mathbf{0} \\\\ 1 \\\\ 0 \\end{bmatrix}\\\\\\\\\n",
Expand Down

0 comments on commit 419ba98

Please sign in to comment.