## The examples here require the package glpkAPI to be
## installed. If that package is not available, you have to set
## the argument 'solver' (the default is: solver = SYBIL_SETTINGS("SOLVER")).
## load the example data set
data(Ec_core)
## run optimizeProb(), Ec_sf will be a list
Ec_sf <- optimizeProb(Ec_core)
## run optimizeProb(), Ec_sf will be an object of
## class optsol_optimizeProb
Ec_sf <- optimizeProb(Ec_core, retOptSol = TRUE)
## do FBA, change the upper and lower bounds for the reactions
## "ATPM" and "PFK".
optimizeProb(Ec_core, react = c("ATPM", "PFK"),
lb = c(3, -3), ub = c(5, 6))
## do FBA, perform sensitivity analysis after optimization
optimizeProb(Ec_core, MoreArgs = list(poCmd = list("sensitivityAnalysis")))
## do FBA, write the problem object to file in lp-format
optimizeProb(Ec_core,
MoreArgs = list(poCmd = list(c("writeProb", "LP_PROB",
"'Ec_core.lp'", "'lp'"))))
## do FBA, use "cplexAPI" as lp solver. Get all upper bounds before
## solving the problem. After solving, perform a sensitivity
## analysis and retrieve the reduced costs
optimizeProb(Ec_core, solver = "cplexAPI", MoreArgs = list(
prCmd = list(c("getColsUppBnds", "LP_PROB", "1:77")),
poCmd = list("sensitivityAnalysis",
c("getDjCPLEX",
"LP_PROB@oobj@env",
"LP_PROB@oobj@lp",
"0", "react_num(Ec_core)-1"
)
)
)
)
Run the code above in your browser using DataLab