# NOT RUN {
## 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 an object of
## class optsol_optimizeProb
Ec_sf <- optimizeProb(Ec_core)
## run optimizeProb(), Ec_sf will be a list
Ec_sf <- optimizeProb(Ec_core, retOptSol = FALSE)
## 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, poCmd = list("sensitivityAnalysis"))
## do FBA, write the problem object to file in lp-format
optimizeProb(Ec_core,
poCmd = list(c("writeProb", "LP_PROB",
"'Ec_core.lp'", "'lp'")))
## do FBA, use "cplexAPI" as lp solver. Get all lower bounds before
## solving the problem. After solving, perform a sensitivity
## analysis and retrieve the reduced costs
opt <- optimizeProb(Ec_core, solver = "cplexAPI",
prCmd = list(c("getColsLowBnds", "LP_PROB", "1:77")),
poCmd = list("sensitivityAnalysis",
c("getDjCPLEX",
"LP_PROB@oobj@env",
"LP_PROB@oobj@lp",
"0", "react_num(Ec_core)-1")))
## get lower bounds
preProc(opt)
## get results of sensitivity analysis
postProc(opt)
# }
Run the code above in your browser using DataLab