Commit b1e98f28 authored by Miroslav Kratochvil's avatar Miroslav Kratochvil
Browse files

documentation fixes and formatting, ...

References in tutorial 4 are left out for Mo, to avoid conflicts
parent 7251cdca
Pipeline #43285 passed with stages
in 13 minutes and 51 seconds
......@@ -7,7 +7,8 @@ exploring the biological models. The currently supported methods include
- Flux balance analysis (FBA), in function [`flux_balance_analysis`](@ref)
- Flux variability analysis (FVA), in [`flux_variability_analysis`](@ref)
- Flux sampling by hit-and-run algorithm, in [`hit_and_run`](@ref)
- Flux sampling by linearized hit-and-run algorithm, in
[`affine_hit_and_run`](@ref)
- Parsimonious flux balance analysis (pFBA), in
[`parsimonious_flux_balance_analysis`](@ref)
......@@ -149,15 +150,15 @@ Otherwise, the function behaves just like [`flux_balance_analysis`](@ref):
## Flux sampling
For the [`hit_and_run`](@ref), you need a previously optimized and constrained
For the [`affine_hit_and_run`](@ref), you need a previously optimized and constrained
model from another analysis function, such as [`flux_balance_analysis`](@ref),
or created by [`make_optimization_model`](@ref). You may need to carefully
choose the number of iterations and sample sizes to match your model; see the
documentation of [`hit_and_run`](@ref) for details.
documentation of [`affine_hit_and_run`](@ref) for details.
As an example, you can run the sampling for 100 thousand iterations with:
```
hit_and_run(100_000, make_optimization_model(m, GLPK.Optimizer))
affine_hit_and_run(100_000, make_optimization_model(m, GLPK.Optimizer))
```
You should receive a matching flux sample with the (default) 1000 samples in a
......
......@@ -89,7 +89,9 @@ function change_objective(
[first(indexin([rxnid], reactions(model))) for rxnid in new_objective]
end
any(isnothing.(objective_indices)) && throw(DomainError(new_objective, "No matching reaction found for one or more ids."))
any(isnothing.(objective_indices)) && throw(
DomainError(new_objective, "No matching reaction found for one or more ids."),
)
# Initialize weights
opt_weights = spzeros(n_reactions(model))
......
......@@ -70,11 +70,12 @@ end
Add `model` to `community`, which is a pre-existing community model with
`exchange_rxn_ids` and `exchange_met_ids`. The `model_name` is appended to
each reaction and metabolite, see [`join`](@ref). If `biomass_id` is specified
then a biomass metabolite for `model` is also added to the resulting model. The
column corresponding to the `biomass_id` reaction then produces this new biomass
metabolite with unit coefficient. Note, `exchange_rxn_ids` and
`exchange_met_ids` must already exist in the `community` model.
each reaction and metabolite, see [`join_with_exchanges`](@ref). If
`biomass_id` is specified then a biomass metabolite for `model` is also added
to the resulting model. The column corresponding to the `biomass_id` reaction
then produces this new biomass metabolite with unit coefficient. Note,
`exchange_rxn_ids` and `exchange_met_ids` must already exist in the `community`
model.
# Example
```
......
......@@ -20,7 +20,7 @@ with_removed_metabolites(args...; kwargs...) =
with_added_reactions(args...; kwargs...)
Specifies a model variant with reactions added. Forwards the arguments to
[`add_Reactions`](@ref). Intended to be used with [`screen`](@ref).
[`add_reactions`](@ref). Intended to be used with [`screen`](@ref).
"""
with_added_reactions(args...; kwargs...) = m -> add_reactions(m, args...; kwargs...)
......
......@@ -69,28 +69,20 @@ end
)
@test_throws DomainError flux_balance_analysis_dict(
model,
Tulip.Optimizer;
modifications = [
change_constraint("gbbrsh", -12, -12)
],
)
model,
Tulip.Optimizer;
modifications = [change_constraint("gbbrsh", -12, -12)],
)
@test_throws DomainError flux_balance_analysis_dict(
model,
Tulip.Optimizer;
modifications = [
change_objective("gbbrsh")
],
)
model,
Tulip.Optimizer;
modifications = [change_objective("gbbrsh")],
)
@test_throws DomainError flux_balance_analysis_dict(
model,
Tulip.Optimizer;
modifications = [
change_objective(
["BIOMASS_Ecoli_core_w_GAM"; "gbbrsh"]
)
],
)
model,
Tulip.Optimizer;
modifications = [change_objective(["BIOMASS_Ecoli_core_w_GAM"; "gbbrsh"])],
)
end
@testset "Flux balance analysis with CoreModelCoupled" begin
......
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