From 9a8b74c7c43d0a994d2da0b217ae24a5be808211 Mon Sep 17 00:00:00 2001 From: Claus Jonathan Fritzemeier <clausjonathan.fritzemeier@hhu.de> Date: Mon, 18 Apr 2016 14:21:45 +0200 Subject: [PATCH] changes on double genedeletion --- DESCRIPTION | 2 +- R/doubleGeneDel.R | 60 +++++++++++++++++++++----------------------- inst/NEWS.Rd | 8 ++++++ man/sybil-package.Rd | 2 +- 4 files changed, 39 insertions(+), 33 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index ee31cce..bc93784 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 84b3ac7..760c168 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 2875c43..69f03dd 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 b4699ac..784dcd7 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 -- GitLab