diff --git a/DESCRIPTION b/DESCRIPTION index ee31cce95b67a06544b778f85f7775884eaa8e5f..bc9378415e2a4755981a70877eb2d2f264014e2c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: sybil Type: Package Title: Efficient Constrained Based Modelling in R Version: 1.3.4 -Date: 2015-11-16 +Date: 2015-04-18 Authors@R: c( person(c("C.", "Jonathan"), "Fritzemeier", role = c("cre", "ctb"), email = "clausjonathan.fritzemeier@uni-duesseldorf.de"), person("Gabriel", "Gelius-Dietrich", role = c("aut")), diff --git a/R/doubleGeneDel.R b/R/doubleGeneDel.R index 84b3ac7a19872622050e5c346c519a30f911fb17..760c16809868e8f4f1987e361e5ad2e540ca1e58 100644 --- a/R/doubleGeneDel.R +++ b/R/doubleGeneDel.R @@ -195,44 +195,42 @@ doubleGeneDel <- function(model, geneList1, geneList2, lb = NULL, ub = NULL, # Exclude everything from tmpMAT we do not need. #tmpMAT <- tmpMAT[geneList1, geneList2, drop = FALSE] - - } - else { - - tmpMAT <- matrix(FALSE, nrow = num_genes, ncol = num_genes) - #diag(tmpMAT) <- TRUE - for (i in seq(along = geneList1)) { - tmpMAT[geneList1[i], geneList2[i]] <- TRUE - } + geneList1 <- unique(geneList1) + geneList2 <- unique(geneList2) + + # Exclude everything from tmpMAT we do not need. + tmpMAT <- tmpMAT[geneList1, geneList2, drop = FALSE] + + # The number of TRUE's in tmpMAT is equal to the number of optimizations + num_opt <- sum(tmpMAT == TRUE) + + + rownames(tmpMAT) <- geneList1 + colnames(tmpMAT) <- geneList2 + + deletions <- which(tmpMAT == TRUE, arr.ind = TRUE) + + kogenesID <- cbind(geneList1[deletions[,"row"]], + geneList2[deletions[,"col"]]) + } + else { + +# tmpMAT <- matrix(FALSE, nrow = num_genes, ncol = num_genes) +# #diag(tmpMAT) <- TRUE +# for (i in seq(along = geneList1)) { +# tmpMAT[geneList1[i], geneList2[i]] <- TRUE +# } + + kogenesID <- cbind(geneList1, geneList2) + } - geneList11 <- geneList1 - geneList22 <- geneList2 - - geneList1 <- unique(geneList1) - geneList2 <- unique(geneList2) - - # Exclude everything from tmpMAT we do not need. - tmpMAT <- tmpMAT[geneList1, geneList2, drop = FALSE] - - # The number of TRUE's in tmpMAT is equal to the number of optimizations - num_opt <- sum(tmpMAT == TRUE) - - - rownames(tmpMAT) <- geneList1 - colnames(tmpMAT) <- geneList2 - #print(tmpMAT) - #print(num_opt) - #------------------------------------------------------------------------------# # run optimization # #------------------------------------------------------------------------------# - deletions <- which(tmpMAT == TRUE, arr.ind = TRUE) - - kogenesID <- cbind(geneList1[deletions[,"row"]], - geneList2[deletions[,"col"]]) + kogenes <- lapply(seq_len(nrow(kogenesID)), function(x) kogenesID[x, ]) fd <- .generateFluxdels(model, kogenes) diff --git a/inst/NEWS.Rd b/inst/NEWS.Rd index 2875c437eeb4e21e56ff3852c94e77b73c3e79ca..69f03dd906a17cee7b2801898d84310f34375cdd 100644 --- a/inst/NEWS.Rd +++ b/inst/NEWS.Rd @@ -6,6 +6,14 @@ \newcommand{\CRANpkg}{\href{http://CRAN.R-project.org/package=#1}{\pkg{#1}}} + +\section{Changes in version 1.3.4 2016-04-18}{ + \itemize{ + \item \code{doubleGeneDel} messed up the order of deletions when using exlicit gene lists. + \item corrected url of openCOBRA in the manual. + } +} +% ---------------------------------------------------------------------------- % \section{Changes in version 1.3.3 2015-11-25}{ \itemize{ \item \code{addReact} crashed for irreversible models. diff --git a/man/sybil-package.Rd b/man/sybil-package.Rd index b4699acf95fb580e3e498dbda335171161485d10..784dcd7ea1745f1d40cd9fbf67d34285e598ba32 100644 --- a/man/sybil-package.Rd +++ b/man/sybil-package.Rd @@ -64,7 +64,7 @@ model <- readTSVmod(prefix = "Ec_core", BiGG: a Biochemical Genetic and Genomic knowledgebase of large scale metabolic reconstructions. \emph{BMC Bioinformatics} \bold{11}, 213. - The openCOBRA project \url{http://opencobra.sourceforge.net/}. + The openCOBRA project \url{https://opencobra.github.io/}. Becker, S. A., Feist, A. M., Mo, M. L., Hannum, G., Palsson, B. Ø. and Herrgard, M. J. (2007) Quantitative prediction of cellular metabolism with