Commit 0f01c343 authored by St. Elmo's avatar St. Elmo
Browse files

fixed formatting

parent e97a3182
using Documenter, COBREXA
# download core model
download("http://bigg.ucsd.edu/static/models/e_coli_core.json", "e_coli_core.json")
makedocs(modules = [COBREXA],
clean = false,
sitename = "COBREXA.jl",
......@@ -26,5 +23,5 @@ makedocs(modules = [COBREXA],
],
)
# delete core model
rm("e_coli_core.json")
\ No newline at end of file
# delete core model that was downloaded as part of the documentation generation process
rm("e_coli_core.json")
......@@ -24,7 +24,8 @@ using COBREXA
using JuMP
using Tulip
model = read_model("e_coli_core.json")
model_location = "e_coli_core.json" # hide
model = read_model(model_location)
biomass = findfirst(model.reactions, "BIOMASS_Ecoli_core_w_GAM")
optimizer = Tulip.Optimizer
......@@ -38,6 +39,7 @@ using JSON
open("fluxes.json", "w") do io
JSON.print(io, sol)
end
rm("fluxes.json") # hide
```
## Solution inspection
......@@ -112,7 +114,9 @@ using COBREXA
using JuMP
using Tulip
model = read_model("e_coli_core.json")
model_location = "e_coli_core.json" # hide
model = read_model(model_location)
cbm, v, mb, ubs, lbs = build_cbm(model)
glucose_index = model[findfirst(model.reactions, "EX_glc__D_e")]
set_bound(glucose_index, ubs, lbs; ub=-12.0, lb=-12.0)
......
......@@ -46,17 +46,18 @@ The optimization solvers are implemented through `JuMP` and thus this package sh
## Quick Example
Let's perform flux balance analysis on a constraint based model.
```@example intro
```@example
using COBREXA
using JuMP
using Tulip
# Download a model from the BIGG database
download("http://bigg.ucsd.edu/static/models/e_coli_core.json", "e_coli_core.json")
# Read that model into Julia
model = read_model("e_coli_core.json")
biomass = findfirst(model.reactions, "BIOMASS_Ecoli_core_w_GAM")
optimizer = Tulip.Optimizer
sol = fba(model, biomass, optimizer)
```
......@@ -7,9 +7,13 @@ Currently, JSON and Matlab formatted models can be imported.
read_model(file_location::String)
```
```@example ioexample
```@example io
using COBREXA
# Download a model from the BIGG database
download("http://bigg.ucsd.edu/static/models/e_coli_core.json", "e_coli_core.json")
# Read that model into Julia
model = read_model("e_coli_core.json")
model # pretty printing
```
......@@ -21,10 +25,10 @@ Currently, JSON and Matlab models can be exported.
save_model(model::CobraModel, file_location::String)
```
```@example ioexample
save_model(model, "e_coli_core2.json")
```@example io
save_model(model, "e_coli_core_saved.json")
rm("e_coli_core2.json") # hide
```
## IO Problems?
Please let me know when you run into model import/export problems by filing an issue.
\ No newline at end of file
Please let me know when you run into model import/export problems by filing an issue.
......@@ -12,7 +12,9 @@ using COBREXA
using JuMP
using Tulip
model = read_model("e_coli_core.json")
model_location = "e_coli_core.json" # hide
model = read_model(model_location)
optimizer = Tulip.Optimizer
biomass = findfirst(model.reactions, "BIOMASS_Ecoli_core_w_GAM")
cons = Dict("EX_glc__D_e" => (-12.0, -12.0))
......@@ -20,4 +22,4 @@ sol = fba(model, biomass, optimizer, constraints=cons) # classic flux balance an
cons["BIOMASS_Ecoli_core_w_GAM"] = (sol["BIOMASS_Ecoli_core_w_GAM"], sol["BIOMASS_Ecoli_core_w_GAM"]*0.99)
samples = hit_and_run(100_000, model, optimizer; keepevery=10, samplesize=5000, constraints=cons)
```
\ No newline at end of file
```
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment