diff --git a/R/rmReact.R b/R/rmReact.R index 0efb32c1de032df7a56bbabf84caed276379fd94..c420d70941bb3161316ccfcf208bf212cbbf25f3 100644 --- a/R/rmReact.R +++ b/R/rmReact.R @@ -162,21 +162,9 @@ rmReact <- function(model, react, rm_met = TRUE) { ag <- ag[which(ncag != 0)] allGenes(mod_out) <- ag } - #TODO: update indices in the GPR rules accoording to the updated allGenes slot! - - # reaction to gene mapping - #SrGMbin <- rxnGeneMat(mod_out) != 0 - - #SrGMbindiag <- diag(crossprod(SrGMbin)) - - #keepGenes <- ifelse(SrGMbindiag == 0, FALSE, TRUE) - keepGenes <- sapply(allGenes(model), function(x) match(x, allGenes(mod_out))) - keepGenes <- ifelse(is.na(keepGenes), FALSE, TRUE) - #print(keepGenes) - - rxnGeneMat(mod_out) <- rxnGeneMat(mod_out)[, keepGenes, drop = FALSE] - #print(dim(rxnGeneMat)) + newGeneOrder <- match(allGenes(mod_out), allGenes(model)) + rxnGeneMat(mod_out) <- rxnGeneMat(mod_out)[, newGeneOrder, drop = FALSE] } diff --git a/inst/NEWS.Rd b/inst/NEWS.Rd index 9f9fd1fc7e00edb4df6c915bc1bf7afc4e1e3aeb..7e44a597cad5ec973f0eb0dd4f7306af531b6521 100644 --- a/inst/NEWS.Rd +++ b/inst/NEWS.Rd @@ -8,6 +8,8 @@ \section{Changes in version 2.0.1 2016-07-05}{ \itemize{ + \item After \code{rmReact} the columns of \code{rxnGeneMat} and + \code{allGenes}-slot did not match. \item \code{upgradeModelorg} was not working correctly, when all gprRules are empty. }