-
Let's make macros to really make the user interface clean. I have implemented fba macros in #53 (see the last few commits) and @marvinvanaalst has implemented a macro for reaction adding in #59 . @exaexa and I were also talking about this extensively on slack, it would be really cool to have something like this (from slack @exaexa): vs = @variants
knockout(123)
knockout(4345)
...
end
@mod_variants! vs
remove_reaction(123)
end
@combine_variants! vs
no_modification()
add_random_ATP()
add_some_toxin()
end Currently I have an fba mini version of this working as shown below: using COBREXA
using Tulip
model = read_model(joinpath("e_coli_core.json"))
biomass = findfirst(model.reactions, "BIOMASS_Ecoli_core_w_GAM")
glucose = findfirst(model.reactions, "EX_glc__D_e")
vec = @flux_balance_analysis_vec model Tulip.Optimizer begin
modify_objective(biomass)
modify_constraint(glucose, -8.0, -8.0)
end |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
anyway, it might be better not to over-macro the code in some parts. A minilanguage is certainly viable for combining the modifications (although there should be a normal functional variant of the code), but the example below may read easier as a normal function: res = flux_balance_analysis_vec(model, Tulip.optimizer,
modifications=@mods begin
objective(biomass)
constraint(glucose, -8, -8)
end) (even then the code can still be shorter with a normal vector |
Beta Was this translation helpful? Give feedback.
anyway, it might be better not to over-macro the code in some parts. A minilanguage is certainly viable for combining the modifications (although there should be a normal functional variant of the code), but the example below may read easier as a normal function:
(even then the code can still be shorter with a normal vector
[]
)