R/check_bioc_dependencies.R

Defines functions check_bioc_dependencies

check_bioc_dependencies <- function(...) {
  # Check if bioconductor dependencies are installed
  pkgs <- c("AnnotationDbi", "KEGGREST", "GO.db")
  x <- rownames(utils::installed.packages())
  idx  <- which(!pkgs %in% x)
  
  if (length(idx) > 0){
    msg <- paste0("\nCALANGO: ",
                  "Comparative AnaLysis with ANnotation-based Genomic cOmponentes")
    for (i in seq_along(idx)){
      msg <- paste0(msg, "\n* NOTE: Missing BioConductor dependency: ", pkgs[idx[i]])
    }
    msg <- paste0(msg, 
                  "\nPlease run install_bioc_dependencies() before using run_CALANGO()")
    message(msg)
    return(FALSE)
  } else {
    return(TRUE)
  }
}

Try the CALANGO package in your browser

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

CALANGO documentation built on April 26, 2023, 5:13 p.m.