From b4eda33dea4ca00a886d07c9b14ee0a8dae59793 Mon Sep 17 00:00:00 2001
From: Claus Jonathan Fritzemeier <clausjonathan.fritzemeier@hhu.de>
Date: Tue, 18 Jul 2017 09:50:32 +0200
Subject: [PATCH] making addReact a method 1

---
 R/addReact.R | 29 +++++++++++++++--------------
 R/generics.R |  4 ++++
 inst/NEWS.Rd |  6 ++++++
 3 files changed, 25 insertions(+), 14 deletions(-)

diff --git a/R/addReact.R b/R/addReact.R
index 35e6a25..915a5af 100644
--- a/R/addReact.R
+++ b/R/addReact.R
@@ -31,19 +31,20 @@
 # The algorithm is (more or less) the same.
 
 
-addReact <- function(model,
-                     id,
-                     met,
-                     Scoef,
-                     reversible = FALSE,
-                     lb = 0,
-                     ub = SYBIL_SETTINGS("MAXIMUM"),
-                     obj = 0,
-                     subSystem = NA,
-                     gprAssoc = NA,
-                     reactName = NA,
-                     metName = NA,
-                     metComp = NA) {
+setMethod("addReact", signature(model = "modelorg"),
+	function(model,
+			id,
+			met,
+			Scoef,
+			reversible = FALSE,
+			lb = 0,
+			ub = SYBIL_SETTINGS("MAXIMUM"),
+			obj = 0,
+			subSystem = NA,
+			gprAssoc = NA,
+			reactName = NA,
+			metName = NA,
+			metComp = NA) {
 
   
     # ------------------------------------------------------------------------ #
@@ -410,5 +411,5 @@ addReact <- function(model,
 
     return(mod_out)
 
-}
+})
 
diff --git a/R/generics.R b/R/generics.R
index 9ba8754..b294389 100644
--- a/R/generics.R
+++ b/R/generics.R
@@ -38,6 +38,10 @@ setGeneric(name = "addColsToProb",
            def  = function(lp, ...) { standardGeneric("addColsToProb") }
 )
 
+setGeneric(name = "addReact",
+           def  = function(model, ...) { standardGeneric("addReact") }
+)
+
 setGeneric(name = "addRows",
            def  = function(lp, nrows, ...) { standardGeneric("addRows") }
 )
diff --git a/inst/NEWS.Rd b/inst/NEWS.Rd
index 5aec788..43eca55 100644
--- a/inst/NEWS.Rd
+++ b/inst/NEWS.Rd
@@ -6,6 +6,12 @@
 
 \newcommand{\CRANpkg}{\href{http://CRAN.R-project.org/package=#1}{\pkg{#1}}}
 
+\section{Changes in version 2.0.4 2017-07-17}{
+  \itemize{
+  	\item \code{addReact} is now a method of the \code{modelorg} class.
+  }
+}
+% ---------------------------------------------------------------------------- %
 \section{Changes in version 2.0.3 2017-04-20}{
   \itemize{
   	\item Preparation for \code{sybilNLO}.
-- 
GitLab