R/validate.pathway.definition.R

validate.pathway.definition <- function(pathway){
  
  # validate pathway
  if(is.character(pathway)){
    if(length(pathway) > 1){
      msg <- "pathway should be either an external file name or a data.frame"
      stop(msg)
    }
    
    if(!file.exists(pathway)){
      msg <- paste0("File below was not found: \n", pathway)
      stop(msg)
    }
  }else{
    tmp <- (c("data.frame", "matrix") %in% class(pathway))
    if(!any(tmp)){
      msg <- "pathway should be either an external file name or a data.frame"
      stop(msg)
    }
  }
  
}

Try the ARTP2 package in your browser

Any scripts or data that you put into this service are public.

ARTP2 documentation built on May 2, 2019, 3:38 p.m.