diff --git a/R/parseBoolean.R b/R/parseBoolean.R index 2e4c77c2276c7df931f92ab847c670f3fa52138d..77c52c012ddc82ff0c07616abc1833503ba32abb 100644 --- a/R/parseBoolean.R +++ b/R/parseBoolean.R @@ -32,6 +32,7 @@ .parseBoolean <- function(gprRule, tokens = "()&|~") { + print(gprRule) #.parseBoolean <- function(gprRule, # tokens = "()&|~", @@ -41,6 +42,11 @@ if ( is.na(gprRule) || (gprRule == "") ) { return(list(gene = "", rule = "")) } + + if( grepl("\\s*\\(\\s*\\)\\s*", gprRule) ){ + warning("found empty expression rule: '( )'. check if this is intended.") + return(list(gene = "", rule = "")) + } # quit, if there is no gene association # if ( (gprRule == "UNKNOWN") || (gprRule == "SPONTANEOUS") ) { @@ -167,18 +173,6 @@ - - - - - - - - - - - - # for (i in 1:length(genes[[1]])) { # #current_tok <- gsub("(^\\s+)|(\\s+$)", "", genes[[1]][i], perl = TRUE) diff --git a/inst/NEWS.Rd b/inst/NEWS.Rd index 01828146cbded76139b31652c445d9b278b9bd7e..83b08200705f322e1ed234092f96e639298e0fda 100644 --- a/inst/NEWS.Rd +++ b/inst/NEWS.Rd @@ -14,6 +14,7 @@ \item modified \code{multiDel} to not use \code{require} \item \code{doubleFluxDel} had a bug if \code{react1} or \code{react2} contained duplicated entries. \item documentation of \code{hasEffect} in \code{optsol_genedel} is now clearer. + \item \code{.parseBoolean} now gives a warning, but handles empty gpr in a intuitive way. } }