Commit 7d8b5ba0 authored by St. Elmo's avatar St. Elmo
Browse files

docs should work now (lots of warnings though)

parent c86064e2
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",
......@@ -21,4 +24,7 @@ makedocs(modules = [COBREXA],
"Optimization Based Analysis Tools" => "basic_analysis.md",
"Sampling Tools" => "sampling_tools.md",
],
)
\ No newline at end of file
)
# delete core model
rm("e_coli_core.json")
\ No newline at end of file
......@@ -19,15 +19,12 @@ using any `JuMP` compatible solver. Typically ``I`` is a singleton set that only
fba
```
Here, we use `Tulip.jl`, a pure Julia interior point linear program solver, with the `fba` function from `COBREXA.jl`.
```@setup fba
model_location = joinpath("..","..", "models", "e_coli_core.json")
```
```@example fba
using COBREXA
using JuMP
using Tulip
model = read_model(model_location)
model = read_model("e_coli_core.json")
biomass = findfirst(model.reactions, "BIOMASS_Ecoli_core_w_GAM")
optimizer = Tulip.Optimizer
......@@ -115,7 +112,7 @@ using COBREXA
using JuMP
using Tulip
model = read_model(model_location)
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")]
set_bound(glucose_index, ubs, lbs; ub=-12.0, lb=-12.0)
......
......@@ -46,15 +46,12 @@ 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.
```@setup intro
model_location = download("http://bigg.ucsd.edu/static/models/e_coli_core.json", "core.json")
```
```@example intro
using COBREXA
using JuMP
using Tulip
model = read_model(model_location)
model = read_model("e_coli_core.json")
biomass = findfirst(model.reactions, "BIOMASS_Ecoli_core_w_GAM")
optimizer = Tulip.Optimizer
......
......@@ -9,9 +9,8 @@ read_model(file_location::String)
```@example ioexample
using COBREXA
model_location = download("http://bigg.ucsd.edu/static/models/iJO1366.json" ,"iJO1366.json")
model = read_model(model_location)
model = read_model("e_coli_core.json")
model # pretty printing
```
......@@ -23,9 +22,8 @@ save_model(model::CobraModel, file_location::String)
```
```@example ioexample
model_location = joinpath("e_coli_json_model.json")
save_model(model, model_location)
rm(model_location) # hide
save_model(model, "e_coli_core2.json")
rm("e_coli_core2.json") # hide
```
## IO Problems?
......
......@@ -140,7 +140,7 @@ getindex(rxns::Array{Reaction, 1}, rxn::Reaction)
Once you have defined some metabolites, genes, and reactions, you can construct a model! This is most simply done by
using the empty model constructor:
```@docs
Model()
CobraModel()
```
The fields of `CobraModel` can then be assigned as usual.
```@example
......@@ -236,7 +236,7 @@ atp2 = Metabolite("atp2")
mets = [atp, atp2]
model = Model()
model = CobraModel()
add!(model, mets)
rm!(model, atp2)
......@@ -257,7 +257,7 @@ anabolism.id = "anabolism"
mets = [atp]
rxns = [anabolism]
model = Model()
model = CobraModel()
model.id = "Test model"
add!(model, mets) # missing adp
add!(model, rxns)
......
......@@ -2,7 +2,7 @@
Before reading, writing, or building models, it is important to understand how they are represented internally in `COBREXA.jl`.
Each model is a struct of the type `CobraModel`, which is composed of a model `id`, and arrays of `Reaction`s, `Metabolite`s and `Gene`s.
```@docs
Model
CobraModel
```
The fields of `Reaction`, `Metabolite`, `Gene` types are shown below.
When reading, writing, building or analysing models, these fields are what is used by `COBREXA.jl`.
......
......@@ -7,15 +7,12 @@ Sampling methods have been developed to uniformly sample from this feasible solu
hit_and_run
achr
```
```@setup sample
model_location = download("http://bigg.ucsd.edu/static/models/e_coli_core.json", "core.json")
```
```@example sample
using COBREXA
using JuMP
using Tulip
model = read_model(model_location)
model = read_model("e_coli_core.json")
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