Commit 9fe75709 authored by St. Elmo's avatar St. Elmo Committed by Laurent Heirendt
Browse files

small edits

parent 30023972
......@@ -5,11 +5,6 @@
# Ignore data files
*.brenda.txt
/models/*
!/models/iJO1366.xml
!/models/iJ01366.json
!/models/iJO1366.mat
!/models/e_coli_core.json
# Ignore working files
/notebooks_and_scripts/imgs
......
......@@ -12,6 +12,7 @@ Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
GLPK = "60bf3e95-4087-53dc-ae20-288a0d20c6a6"
HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
MAT = "23992714-dd62-5051-b70f-ba57cb901cac"
......
# Model Structure
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.
```@docs
Metabolite
```
......
......@@ -76,4 +76,5 @@ function ⟷(substrates::Union{Metabolite, MetaboliteWithCoefficient, Array{Meta
metdict = mkrxn(substrates, products)
return Reaction("", metdict, "bidir")
end
const =
\ No newline at end of file
const =
const =
\ No newline at end of file
......@@ -11,8 +11,8 @@ function get_core_model(model::CobraTools.Model)
ubs = [rxn.ub for rxn in model.reactions]
lbs = [rxn.lb for rxn in model.reactions]
b = spzeros(length(model.metabolites))
S = spzeros(length(model.metabolites), length(model.reactions))
b = SparseArrays.spzeros(length(model.metabolites))
S = SparseArrays.spzeros(length(model.metabolites), length(model.reactions))
metids = [met.id for met in model.metabolites] # need indices for S matrix construction
for (i, rxn) in enumerate(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.
# Example
```
......
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