Skip to content

Commit

Permalink
update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
VonAlphaBisZulu committed Jun 9, 2022
1 parent 336b85c commit 36746b2
Show file tree
Hide file tree
Showing 7 changed files with 199 additions and 17 deletions.
126 changes: 121 additions & 5 deletions docs/source/examples/JN_03_plotting.ipynb

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions docs/source/examples/JN_04_strain_design_introduction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
"# Computational strain design: Growth-coupling principles"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Continued.."
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down
60 changes: 48 additions & 12 deletions docs/source/examples/JN_05_strain_design_mcs.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,68 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 5,
"metadata": {},
"outputs": [
{
"ename": "TypeError",
"evalue": "'SDSolution' object is not iterable",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)",
"\u001b[1;32mc:\\Users\\Philipp\\Documents\\Python\\straindesign\\docs\\source\\examples\\JN_05_strain_design_mcs.ipynb Cell 3'\u001b[0m in \u001b[0;36m<cell line: 9>\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_05_strain_design_mcs.ipynb#ch0000004?line=5'>6</a>\u001b[0m modules \u001b[39m+\u001b[39m\u001b[39m=\u001b[39m [sd\u001b[39m.\u001b[39mSDModule(model,sd\u001b[39m.\u001b[39mnames\u001b[39m.\u001b[39mSUPPRESS,constraints\u001b[39m=\u001b[39m\u001b[39m'\u001b[39m\u001b[39mR4 <= 1\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_05_strain_design_mcs.ipynb#ch0000004?line=7'>8</a>\u001b[0m sols \u001b[39m=\u001b[39m sd\u001b[39m.\u001b[39mcompute_strain_designs(model,sd_modules \u001b[39m=\u001b[39m modules)\n\u001b[1;32m----> <a href='vscode-notebook-cell:/c%3A/Users/Philipp/Documents/Python/straindesign/docs/source/examples/JN_05_strain_design_mcs.ipynb#ch0000004?line=8'>9</a>\u001b[0m \u001b[39mfor\u001b[39;00m s \u001b[39min\u001b[39;00m sols:\n\u001b[0;32m <a href='vscode-notebook-cell:/c%3A/Users/Philipp/Documents/Python/straindesign/docs/source/examples/JN_05_strain_design_mcs.ipynb#ch0000004?line=9'>10</a>\u001b[0m \u001b[39mprint\u001b[39m(s\u001b[39m.\u001b[39msd_solutions)\n",
"\u001b[1;31mTypeError\u001b[0m: 'SDSolution' object is not iterable"
"name": "stdout",
"output_type": "stream",
"text": [
"{'R1': -1.0}\n",
"{'R4': -1.0}\n",
"{'R7': -1.0}\n",
"{'R10': -1.0}\n",
"{'R6': -1.0, 'R8': -1.0}\n"
]
}
],
"source": [
"import straindesign as sd\n",
"import cobra\n",
"\n",
"model = cobra.io.read_sbml_model('../../../tests/model_small_example.xml')\n",
"\n",
"modules = [sd.SDModule(model,sd.names.PROTECT, constraints='R3 >= 1')]\n",
"modules += [sd.SDModule(model,sd.names.SUPPRESS,constraints='R4 <= 1')]\n",
"modules += [sd.SDModule(model,sd.names.SUPPRESS,constraints='R4 >= 1')]\n",
"\n",
"sols = sd.compute_strain_designs(model,sd_modules = modules)\n",
"for s in sols:\n",
" print(s.sd_solutions)"
"for s in sols.reaction_sd:\n",
" print(s)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"To see the current status of the strain design computation, import the logging package and lower the reporting level."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[]"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import logging\n",
"logging.basicConfig(level=logging.INFO)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Continued.."
]
},
{
Expand Down
7 changes: 7 additions & 0 deletions docs/source/examples/JN_06_strain_design_nested.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
"# Multi-level strain optimization approaches"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Continued ..."
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down
7 changes: 7 additions & 0 deletions docs/source/examples/JN_07_network_design.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
"# Tailoring metabolic networks"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Continued .."
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down
7 changes: 7 additions & 0 deletions docs/source/examples/JN_08_compression.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
"# Network Compression\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Continued .."
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down
2 changes: 2 additions & 0 deletions straindesign/compute_strain_designs.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ def compute_strain_designs(model: Model, **kwargs):

if MAX_COST in kwargs:
kwargs.update({MAX_COST: float(kwargs.pop(MAX_COST))})
else:
kwargs.update({MAX_COST: np.inf})

if MODEL_ID in kwargs:
model_id = kwargs.pop(MODEL_ID)
Expand Down

0 comments on commit 36746b2

Please sign in to comment.