Description Usage Arguments Details Value Methods Author(s) See Also Examples
The generic optimizeProb performs the optimization of a mathematical
programming object.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | ## S4 method for signature 'modelorg'
optimizeProb(object,
algorithm = SYBIL_SETTINGS("ALGORITHM"),
gene = NULL,
react = NULL,
lb = NULL,
ub = NULL,
retOptSol = TRUE,
obj_coef = NULL,
lpdir = NULL,
mtfobj = NULL,
fldind = TRUE,
prCmd = NA,
poCmd = NA,
prCil = NA,
poCil = NA,
...)
## S4 method for signature 'sysBiolAlg'
optimizeProb(object,
react = NULL,
lb = NULL,
ub = NULL,
obj_coef = NULL,
lpdir = NULL,
fldind = TRUE,
resetChanges = TRUE,
prCmd = NA,
poCmd = NA,
prCil = NA,
poCil = NA)
|
object |
An object of class |
algorithm |
A single character string giving the name of the algorithm to use. See
parameter |
gene |
A character or integer vector containing gene id's or indices of gene id's
in |
react |
An object of class |
lb |
Numeric vector, must have the same length as |
ub |
Same functionality as |
obj_coef |
Numeric vector, must have the same length as |
lpdir |
Character value, direction of optimization. Can be set to |
mtfobj |
Only used, if argument |
fldind |
Boolean value. If set to |
resetChanges |
Boolean value. If set to |
prCmd |
A list of preprocessing commands. See Details below. |
poCmd |
A list of postprocessing commands. See Details below. |
prCil |
Can be used if |
poCil |
Same as |
retOptSol |
Boolean. Return an object of class
|
... |
Only for the |
The arguments prCmd and poCmd can be used to execute R commands
working on the problem object. All commands in prCmd are executed
immediately before solving the problem; all commands in poCmd are
executed after the problem has been solved. In all other aspects, the
arguments work the same. The value of prCmd or poCmd are
lists of character vectors (each list element is one command). Each command
is a character vector and should be built as follows:
The first element is the name of the function to call.
All other elements are arguments to the function named in the first element.
If any argument is character, enclose it in single
quotes ' '.
Use the keyword LP_PROB in order to refer to the variable name
of the problem object (object of class
optObj).
If the length of the character vector is one, it is treated as a
function call with the problem object
(object of class optObj) as single
argument.
The result will be an object of class ppProc.
A few examples for arguments prCmd or poCmd (all arguments must
be lists, see examples section below):
1 2 |
will be translated to the command
1 2 | sensitivityAnalysis(LP_PROB)
|
with LP_PROB being the placeholder for the variable name of the
problem object. The vector
1 2 | c("writeProb", "LP_PROB", "'Ec_core.lp'", "'lp'")
|
will be translated to the command
1 2 | writeProb(LP_PROB, 'Ec_core.lp', 'lp')
|
The first element will be the function name and the others the arguments to that function. The list of commands
1 2 3 4 5 6 |
will be translated to the commands
1 2 3 4 | sensitivityAnalysis(LP_PROB)
getDjCPLEX(LP_PROB@oobj@env, LP_PROB@oobj@lp,
0, react_num(Ec_core)-1)
|
For more information on the usage of prCmd and poCmd, see the
examples section below.
The method optimizeProb for class modelorg
generates a subclass of class sysBiolAlg
and calls optimizeProb for that object again. Argument MoreArgs
is used to transport arguments to the second optimizeProb call.
Argument ... instead is used to transport arguments to the constructor
function sysBiolAlg, for example algorithm,
solver, method and solverParm.
See SYBIL_SETTINGS for possible values.
Arguments gene, react, lb, ub and react
cause changes in the problem object (object of class
optObj, slot problem of class
sysBiolAlg). These changes will be reset
immediately after optimization if argument resetChanges is set to
TRUE, otherwise changes will persist.
Calls to optimizeProb returns either an object of class
optsol_optimizeProb of length one
if argument retOptSol is set to TRUE and object is of
class modelorg, or a list containing the results of the
optimization:
ok |
Return value of the optimizer (e.g. “solution process was successful” or “time limit exceeded”). |
obj |
Value of the objective function after optimization. |
stat |
Status value of the optimization (e.g. “solution is optimal” or “no feasible solution exists”). |
fluxes |
The resulting flux distribution. |
fldind |
Pointers to columns (variables) representing a flux (reaction) in the
original network. The variable |
preP |
An object of class |
postP |
An object of class |
signature(object = "modelorg")Translates the object of class modelorg into an
object of class sysBiolAlg and calls
optimizeProb again.
signature(object = "sysBiolAlg")Run optimization with the given problem object.
Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de>
Maintainer: Mayo Roettger <mayo.roettger@hhu.de>
modelorg, applyChanges and sysBiolAlg.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | ## 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)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.