Unverified Commit e2a0d430 authored by St. Elmo's avatar St. Elmo
Browse files

improved docstring of join

parent ef14232b
......@@ -84,7 +84,7 @@ function Base.push!(
end
"""
Base.join(models::Vector{M},
join(models::Vector{M},
exchange_rxn_ids::Vector{String},
exchange_met_ids::Vector{String};
add_biomass_objective=false,
......@@ -94,7 +94,7 @@ end
Return a `CoreModel` representing the community model of `models` joined through
their `exchange_rxn_ids` and `exchange_met_ids`. These exchange reactions and
metabolites are converted into environmental metabolites that link the models.
metabolites link to environmental metabolites and reactions.
Optionally specify `species_names` to append a specific name to each reaction
and metabolite of an organism for easier reference (default is `species_i` for
each model index i in `models`). Note, the bounds of the environmental variables
......@@ -110,6 +110,29 @@ objective reaction. Note, this reaction is unspecified, further action needs to
be taken to specify it, e.g. assign weights to the last column of the
stoichiometric matrix in the rows corresponding to the biomass metabolites.
To further clarify how this `join` works. Suppose you have 2 organisms with
stoichiometric matrices S₁ and S₂ and you want to link them with `exchange_met_ids = [em₁, em₂, em₃, ...]`
and `exchange_rxn_ids = [er₁, er₂, er₃, ...]`. Then a new community stoichiometric matrix is constructed
that looks like this:
```
_ er₁ er₂ er₃ ... b_
|S₁ |
| S₂ |
em₁| |
S = em₂| |
em₃| |
...| |
bm₁| |
bm₂|_ _|
```
Each of the exchange reactions in each model get linked to `emᵢ` and these get
linked to `erᵢ`. These `erᵢ` behave like normal single organism exchange
reactions. When `add_biomass_objective` is true each model's biomass becomes a
pseudo-metabolite (`bmᵢ`). These can be weighted in column `b`, called the
`community_biomass` reaction in the communit model, if desired. Refer to the
tutorial if this is unclear.
# Example
```
model_path = joinpath("..","models","e_coli_core.json")
......
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