Skip to content
Snippets Groups Projects
Commit 14905fef authored by Claus Jonathan Fritzemeier's avatar Claus Jonathan Fritzemeier
Browse files

.parseboolean fix for empty gpr like "( )"

parent 763c6cb4
No related branches found
No related tags found
No related merge requests found
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
.parseBoolean <- function(gprRule, tokens = "()&|~") { .parseBoolean <- function(gprRule, tokens = "()&|~") {
print(gprRule)
#.parseBoolean <- function(gprRule, #.parseBoolean <- function(gprRule,
# tokens = "()&|~", # tokens = "()&|~",
...@@ -42,6 +43,11 @@ ...@@ -42,6 +43,11 @@
return(list(gene = "", rule = "")) 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 # quit, if there is no gene association
# if ( (gprRule == "UNKNOWN") || (gprRule == "SPONTANEOUS") ) { # if ( (gprRule == "UNKNOWN") || (gprRule == "SPONTANEOUS") ) {
# return(list(gene = "", rule = "")) # return(list(gene = "", rule = ""))
...@@ -168,18 +174,6 @@ ...@@ -168,18 +174,6 @@
# for (i in 1:length(genes[[1]])) { # for (i in 1:length(genes[[1]])) {
# #current_tok <- gsub("(^\\s+)|(\\s+$)", "", genes[[1]][i], perl = TRUE) # #current_tok <- gsub("(^\\s+)|(\\s+$)", "", genes[[1]][i], perl = TRUE)
# current_tok <- genes[[1]][i] # current_tok <- genes[[1]][i]
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
\item modified \code{multiDel} to not use \code{require} \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 \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 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.
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment