R/download_gse_data.R

Defines functions download_gse_data

Documented in download_gse_data

# Perhaps revisit what exactly this does... Might as well just use geoquery for this and not write a separate
#' Download a dataset from GEO via GEOquery
#'
#' @param geo_acc String with your datasets accession number (e.g. "GSE108000)
#'
#' @return gse, an ExpressionSet S4 object type with your dataset's expression data and metadata.
#' @export
#'
#' @examples
#' 
#' gse <- download_gse_data("GSE108000")
#' 
download_gse_data <- function(geo_acc = NULL){
  
  gse_dwnld <- GEOquery::getGEO(geo_acc)
  
  #Included this extra step because the download is placed into a list and we want the actual
  #ESet object
  gse <- gse_dwnld[[1]]
  
  on.exit(cat("Your dataset was successfully downloaded!"))
  
  return(gse)
}
jeffreyLbrabec/tinker documentation built on Nov. 4, 2019, 2:37 p.m.