R/getAllProteins.R

Defines functions getALLProteins

Documented in getALLProteins

#' Returns vector of proteins annotated to given GO term
#'
#' @param GOterm GOterm
#' @param annotationDB list of protein annotations
#' @param return should vector be returned
#' @param save save?
#' @param name name
#' @param destination destination to save
#'
#' @return
#' @export
#'
#'
getALLProteins <- function(GOterm, annotationDB = info[["annotations"]], return = T, save = F, name, destination) {

  proteins <- c()

  for(i in 1:length(annotationDB)) {
    if(GOterm %in% annotationDB[[i]]) {
      proteins <- c(proteins, names(annotationDB)[i])
    }
  }

  if(save) {
    saveThis(proteins, name = name, destination = destination)
  }

  if(return) {
    proteins
  }

}
nicohuttmann/htmnanalysis documentation built on Dec. 6, 2020, 3:02 a.m.