Before reading, writing, or building models, it is important to understand how they are represented internally in `CobraTools`.
Before reading, writing, or building models, it is important to understand how they are represented internally in `CobraTools.jl`.
Each model is a struct of the type `CobraTools.Model`, which is composed of a model `id`, and arrays of `Reaction`s, `Metabolite`s and `Gene`s.
```@docs
Model
...
...
@@ -13,7 +13,7 @@ Note, the format of `grr` (gene reaction rule) in `Reaction` should be a nested
Each sub-array, e.g. `[g1, g2]`, is composed of essential genes (`g1::CobraTools.Gene`, etc.) for the reaction to function.
Thus, if the reaction requires (`g1` and `g2`) or (`g3` and `g4`) to function, then this would be represented by `[[g1, g2], [g3, g4]]` in `grr`. Also note, the metabolites dictionary field of `Reaction` maps a `Metabolite` to its stoichiometrix coefficient, i.e. it represents the reaction equation.
Also note, the format used the `annotation` field in `Reaction`, `Metabolite` and `Gene` should always be a dictionary with string ids mapped to vectors of entries EXCEPT for "sbo" terms, these are not vectors but strings. E.g. `reaction.annotation = Dict("bigg.reaction" => ["PFK"], "rhea" => ["16111", "16109", "16110", "16112"]"sbo" => "SBO:0000176", "ec-code" => ["2.7.1.11"])` is correct, any other format will cause issues.
Also note, the format used the `annotation` field in `Reaction`, `Metabolite` and `Gene` should always be a dictionary with string ids mapped to vectors of entries EXCEPT for "sbo" terms, which are not vectors but strings, e.g. `reaction.annotation = Dict("bigg.reaction" => ["PFK"], "rhea" => ["16111", "16109", "16110", "16112"], "sbo" => "SBO:0000176", "ec-code" => ["2.7.1.11"])` is correct, any other format will cause issues.
metids=[met.idformetinmodel.metabolites]# need indices for S matrix construction
for(i,rxn)inenumerate(model.reactions)# column
...
...
@@ -391,7 +391,7 @@ The model is then constrained to produce objective flux bounded by `optimum_boun
Note, the `optimizer` must be set to perform the analysis, any JuMP solver will work.
The `solver_attributes` can also be specified in the form of a dictionary where each (key, value) pair will be passed to `set_optimizer_attribute(cbmodel, key, value)`.
This function builds the optimization problem from the model, and hence uses the constraints implied by the model object.
Returns two dictionaries (fva_max and fva_min) that each reaction `id`s to dictionaries of the resultant flux distributions (if solved successfully) when that `id` is optimized.
Returns two dictionaries (`fva_max` and `fva_min`) that each reaction `id`s to dictionaries of the resultant flux distributions (if solved successfully) when that `id` is optimized.