Skip to content

Commit

Permalink
Use the Queen's English
Browse files Browse the repository at this point in the history
  • Loading branch information
stelmo committed Jul 9, 2021
1 parent 3882c6a commit 2f13056
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
14 changes: 7 additions & 7 deletions docs/src/advanced/1_variants.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ screen_variants(
m, # the model for screening
[
[], # a variant with no modifications
[with_change_bound("CO2t", lb = 0, ub = 0)], # disable CO2 transport
[with_change_bound("O2t", lb = 0, ub = 0)], # disable O2 transport
[with_change_bound("CO2t", lb = 0, ub = 0), with_change_bound("O2t", lb = 0, ub = 0)], # disable both transports
[with_changed_bound("CO2t", lb = 0, ub = 0)], # disable CO2 transport
[with_changed_bound("O2t", lb = 0, ub = 0)], # disable O2 transport
[with_changed_bound("CO2t", lb = 0, ub = 0), with_changed_bound("O2t", lb = 0, ub = 0)], # disable both transports
],
m -> flux_balance_analysis_dict(m, Tulip.Optimizer)["BIOMASS_Ecoli_core_w_GAM"],
)
Expand Down Expand Up @@ -58,8 +58,8 @@ applied to the model in sequence.

For example:
- `[]` specifies no modifications at all
- `[with_change_bound("CO2t", lb=0, ub=10)]` limits the CO2 transport
- `[with_change_bound("CO2t", lb=0, ub=2), with_change_bound("O2t", lb=0, ub=100)]`
- `[with_changed_bound("CO2t", lb=0, ub=10)]` limits the CO2 transport
- `[with_changed_bound("CO2t", lb=0, ub=2), with_changed_bound("O2t", lb=0, ub=100)]`
severely limits the CO2 transport _and_ slightly restricts the transport of
O2

Expand All @@ -81,7 +81,7 @@ using IterTools # for cartesian products
res = screen_variants(m,
[
# for each variant we restricts 2 reactions
[with_change_bound(r1, lb=-3, ub=3), with_change_bound(r2, lb=-1, ub=1)]
[with_changed_bound(r1, lb=-3, ub=3), with_changed_bound(r2, lb=-1, ub=1)]

# the reaction pair will be chosen from a cartesian product
for (r1,r2) in product(
Expand Down Expand Up @@ -193,7 +193,7 @@ end
```

In turn, these variants can be used in [`screen_variants`](@ref) just as we
used [`with_change_bound`](@ref) above:
used [`with_changed_bound`](@ref) above:

```julia
screen_variants(
Expand Down
4 changes: 2 additions & 2 deletions docs/src/notebooks/6_screening.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ model = load_model(StandardModel, "e_coli_core.json")

# ## Preparing the functions
#
# While we could use the [`with_change_bound`](@ref) to limit the reaction rates,
# While we could use the [`with_changed_bound`](@ref) to limit the reaction rates,
# but we will make a slightly more precise, usage-tailored modification. This
# is a straightforward modification of the [`with_change_bound`](@ref) that does
# is a straightforward modification of the [`with_changed_bound`](@ref) that does
# not set bounds "outside" of the original bounds:

with_limited_rate(reaction_id::String, limit) =
Expand Down
8 changes: 4 additions & 4 deletions src/reconstruction/modifications/generic.jl
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
"""
with_change_bound(args...; kwargs...)
with_changed_bound(args...; kwargs...)
Specifies a model variant that has a new bound set. Forwards arguments to
[`change_bound`](@ref). Intended for usage with [`screen`](@ref).
"""
with_change_bound(args...; kwargs...) = m -> change_bound(m, args...; kwargs...)
with_changed_bound(args...; kwargs...) = m -> change_bound(m, args...; kwargs...)

"""
with_change_bounds(args...; kwargs...)
with_changed_bounds(args...; kwargs...)
Specifies a model variant that has new bounds set. Forwards arguments to
[`change_bounds`](@ref). Intended for usage with [`screen`](@ref).
"""
with_change_bounds(args...; kwargs...) = m -> change_bounds(m, args...; kwargs...)
with_changed_bounds(args...; kwargs...) = m -> change_bounds(m, args...; kwargs...)

"""
with_removed_metabolites(args...; kwargs...)
Expand Down

0 comments on commit 2f13056

Please sign in to comment.