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 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",
...@@ -21,4 +24,7 @@ makedocs(modules = [COBREXA], ...@@ -21,4 +24,7 @@ makedocs(modules = [COBREXA],
"Optimization Based Analysis Tools" => "basic_analysis.md", "Optimization Based Analysis Tools" => "basic_analysis.md",
"Sampling Tools" => "sampling_tools.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 ...@@ -19,15 +19,12 @@ using any `JuMP` compatible solver. Typically ``I`` is a singleton set that only
fba fba
``` ```
Here, we use `Tulip.jl`, a pure Julia interior point linear program solver, with the `fba` function from `COBREXA.jl`. 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 ```@example fba
using COBREXA using COBREXA
using JuMP using JuMP
using Tulip using Tulip
model = read_model(model_location) 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
...@@ -115,7 +112,7 @@ using COBREXA ...@@ -115,7 +112,7 @@ using COBREXA
using JuMP using JuMP
using Tulip using Tulip
model = read_model(model_location) model = read_model("e_coli_core.json")
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,15 +46,12 @@ The optimization solvers are implemented through `JuMP` and thus this package sh ...@@ -46,15 +46,12 @@ 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.
```@setup intro
model_location = download("http://bigg.ucsd.edu/static/models/e_coli_core.json", "core.json")
```
```@example intro ```@example intro
using COBREXA using COBREXA
using JuMP using JuMP
using Tulip using Tulip
model = read_model(model_location) 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
......
...@@ -9,9 +9,8 @@ read_model(file_location::String) ...@@ -9,9 +9,8 @@ read_model(file_location::String)
```@example ioexample ```@example ioexample
using COBREXA using COBREXA
model_location = download("http://bigg.ucsd.edu/static/models/iJO1366.json" ,"iJO1366.json") model = read_model("e_coli_core.json")
model = read_model(model_location)
model # pretty printing model # pretty printing
``` ```
...@@ -23,9 +22,8 @@ save_model(model::CobraModel, file_location::String) ...@@ -23,9 +22,8 @@ save_model(model::CobraModel, file_location::String)
``` ```
```@example ioexample ```@example ioexample
model_location = joinpath("e_coli_json_model.json") save_model(model, "e_coli_core2.json")
save_model(model, model_location) rm("e_coli_core2.json") # hide
rm(model_location) # hide
``` ```
## IO Problems? ## IO Problems?
......
...@@ -140,7 +140,7 @@ getindex(rxns::Array{Reaction, 1}, rxn::Reaction) ...@@ -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 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: using the empty model constructor:
```@docs ```@docs
Model() CobraModel()
``` ```
The fields of `CobraModel` can then be assigned as usual. The fields of `CobraModel` can then be assigned as usual.
```@example ```@example
...@@ -236,7 +236,7 @@ atp2 = Metabolite("atp2") ...@@ -236,7 +236,7 @@ atp2 = Metabolite("atp2")
mets = [atp, atp2] mets = [atp, atp2]
model = Model() model = CobraModel()
add!(model, mets) add!(model, mets)
rm!(model, atp2) rm!(model, atp2)
...@@ -257,7 +257,7 @@ anabolism.id = "anabolism" ...@@ -257,7 +257,7 @@ anabolism.id = "anabolism"
mets = [atp] mets = [atp]
rxns = [anabolism] rxns = [anabolism]
model = Model() model = CobraModel()
model.id = "Test model" model.id = "Test model"
add!(model, mets) # missing adp add!(model, mets) # missing adp
add!(model, rxns) add!(model, rxns)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
Before reading, writing, or building models, it is important to understand how they are represented internally in `COBREXA.jl`. 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. 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 ```@docs
Model CobraModel
``` ```
The fields of `Reaction`, `Metabolite`, `Gene` types are shown below. 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`. 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 ...@@ -7,15 +7,12 @@ Sampling methods have been developed to uniformly sample from this feasible solu
hit_and_run hit_and_run
achr achr
``` ```
```@setup sample
model_location = download("http://bigg.ucsd.edu/static/models/e_coli_core.json", "core.json")
```
```@example sample ```@example sample
using COBREXA using COBREXA
using JuMP using JuMP
using Tulip using Tulip
model = read_model(model_location) model = read_model("e_coli_core.json")
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))
......
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