I used a function to run enrichPathway so I can return null results and plot a blank panel when running multiple datasets.
If I use my function, messages on the screen seem to indicate that everything is running, but it runs very quickly and there are no results.
If I manually run enrichPathway() before running the function, it works correctly.
Here's my function:
get_path <- function(ez_list,pvalcut=0.15){
#catch all errors by returning data frame with nrow = 0
tryCatch(
{
result <- ReactomePA::enrichPathway(ez_list, pvalueCutoff = pvalcut,readable = T)
if(is.null(result)){
return(data.frame())
} else {
return(result)
}
},
error = function(e) {
result <- data.frame()
return(result)
},
warning = function(w) {
result <- data.frame()
return(result)
}
)
}
Any idea what I'm doing wrong?
I used a function to run enrichPathway so I can return null results and plot a blank panel when running multiple datasets.
If I use my function, messages on the screen seem to indicate that everything is running, but it runs very quickly and there are no results.
If I manually run enrichPathway() before running the function, it works correctly.
Here's my function:
Any idea what I'm doing wrong?