Commit 9c9b6bc3 authored by St. Elmo's avatar St. Elmo
Browse files

Revert "fixed formatting"

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