Commit 48e8e4f5 authored by Miroslav Kratochvil's avatar Miroslav Kratochvil
Browse files

make the downloaded file handling robust in docs

parent e957ee8b
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",
......@@ -25,6 +22,3 @@ makedocs(modules = [COBREXA],
"Sampling Tools" => "sampling_tools.md",
],
)
# delete core model
rm("e_coli_core.json")
......@@ -24,7 +24,10 @@ using COBREXA
using JuMP
using Tulip
download("http://bigg.ucsd.edu/static/models/e_coli_core.json", "e_coli_core.json")
if !isfile("e_coli_core.json")
download("http://bigg.ucsd.edu/static/models/e_coli_core.json", "e_coli_core.json")
end
model = read_model("e_coli_core.json")
biomass = findfirst(model.reactions, "BIOMASS_Ecoli_core_w_GAM")
......@@ -108,11 +111,8 @@ build_cbm
set_bound
map_fluxes(::Array{Float64,1}, ::CobraModel)
```
```@example fba
using COBREXA
using JuMP
using Tulip
```@example fba
model = read_model("e_coli_core.json")
cbm, v, mb, ubs, lbs = build_cbm(model)
glucose_index = model[findfirst(model.reactions, "EX_glc__D_e")]
......@@ -123,5 +123,4 @@ set_optimizer(cbm, Tulip.Optimizer)
optimize!(cbm)
sol = map_fluxes(v, model)
rm("e_coli_core.json") # hide
```
......@@ -51,11 +51,13 @@ using COBREXA
using JuMP
using Tulip
download("http://bigg.ucsd.edu/static/models/e_coli_core.json", "e_coli_core.json")
if !isfile("e_coli_core.json")
download("http://bigg.ucsd.edu/static/models/e_coli_core.json", "e_coli_core.json")
end
model = read_model("e_coli_core.json")
biomass = findfirst(model.reactions, "BIOMASS_Ecoli_core_w_GAM")
optimizer = Tulip.Optimizer
sol = fba(model, biomass, optimizer)
rm("e_coli_core.json") # hide
```
......@@ -10,10 +10,12 @@ read_model(file_location::String)
```@example ioexample
using COBREXA
download("http://bigg.ucsd.edu/static/models/e_coli_core.json", "e_coli_core.json")
if !isfile("e_coli_core.json")
download("http://bigg.ucsd.edu/static/models/e_coli_core.json", "e_coli_core.json")
end
model = read_model("e_coli_core.json")
rm("e_coli_core.json") # hide
model # pretty printing
model # pretty print the model
```
## Writing constraint based models
......@@ -25,7 +27,6 @@ save_model(model::CobraModel, file_location::String)
```@example ioexample
save_model(model, "e_coli_core2.json")
rm("e_coli_core2.json") # hide
```
## IO Problems?
......
......@@ -12,9 +12,8 @@ using COBREXA
using JuMP
using Tulip
download("http://bigg.ucsd.edu/static/models/e_coli_core.json", "e_coli_core.json")
model = read_model("e_coli_core.json")
rm("e_coli_core.json") # hide
optimizer = Tulip.Optimizer
biomass = findfirst(model.reactions, "BIOMASS_Ecoli_core_w_GAM")
cons = Dict("EX_glc__D_e" => (-12.0, -12.0))
......
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