From faab9173b9057c35a30e75502dea6d97f9cf0234 Mon Sep 17 00:00:00 2001 From: Claus Jonathan Fritzemeier <clausjonathan.fritzemeier@hhu.de> Date: Mon, 30 Mar 2015 17:31:27 +0200 Subject: [PATCH] new examples for readProb/writeProb --- man/readProb-methods.Rd | 21 +++++++++++++++++++++ man/writeProb-methods.Rd | 21 +++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/man/readProb-methods.Rd b/man/readProb-methods.Rd index ec3d4a6..3b2edbf 100644 --- a/man/readProb-methods.Rd +++ b/man/readProb-methods.Rd @@ -76,6 +76,27 @@ \seealso{ Superclass \code{\linkS4class{optObj}} and constructor function \code{\link{optObj}}. + Method to write problem objects: \code{\link{writeProb}} +} + +\examples{ + \dontrun{ + # In very rare cases it is handy to save a sysBiolAlg-object: + + library(sybil) + data(Ec_core) + prob <- sysBiolAlg(Ec_core, algorithm = "fba", solver="glpkAPI") # create a sysBiolAlg object (we use here GLPK (!)) + save(file="prob.RData",prob) # write the R-object to disc + writeProb(prob@problem, fname="prob.lp", ff="lp") # now write the linear program part (managed by the solver) to disc + + # start new R session + + library(sybil) + library(glpkAPI) + load("prob.RData") # restore the R-object + prob@problem@oobj <- initProbGLPK() # initialize a new linear program + readProb(problem(prob), fname="prob.lp") # load the previously saved linear program + } } \keyword{methods} diff --git a/man/writeProb-methods.Rd b/man/writeProb-methods.Rd index 15fb6da..42c839b 100644 --- a/man/writeProb-methods.Rd +++ b/man/writeProb-methods.Rd @@ -75,6 +75,27 @@ \seealso{ Superclass \code{\linkS4class{optObj}} and constructor function \code{\link{optObj}}. + Method to read problem objects: \code{\link{readProb}} +} + +\examples{ + \dontrun{ + # In very rare cases it is handy to save a sysBiolAlg-object: + + library(sybil) + data(Ec_core) + prob <- sysBiolAlg(Ec_core, algorithm = "fba", solver="glpkAPI") # create a sysBiolAlg object (we use here GLPK (!)) + save(file="prob.RData",prob) # write the R-object to disc + writeProb(prob@problem, fname="prob.lp", ff="lp") # now write the linear program part (managed by the solver) to disc + + # start new R session + + library(sybil) + library(glpkAPI) + load("prob.RData") # restore the R-object + prob@problem@oobj <- initProbGLPK() # initialize a new linear program + readProb(problem(prob), fname="prob.lp") # load the previously saved linear program + } } \keyword{methods} -- GitLab