R/ArrayExpress.r

Defines functions ArrayExpress

Documented in ArrayExpress

ArrayExpress = function(accession, path = tempdir(), save = FALSE, dataCols = NULL, drop = TRUE){
  
  expFiles = getAE(accession, path = path, type = "full")
  
  raweset = try(ae2bioc(mageFiles = expFiles, dataCols = dataCols, drop=drop))
  
  if(inherits(raweset, 'try-error')){
    save = TRUE
    raweset = NULL
  }
  else{
    if(!is.list(raweset)){
      message(paste("\n",accession," was successfully loaded into ",class(raweset),"\n"))
    }
    else {
      message(paste("\n",accession," was successfully loaded into ",length(raweset)," ",unlist(lapply(raweset,function(x){class(x)})),"\n"))
    }
  }
  
  
  if(!save) 
    on.exit(cleanupAE(expFiles))

  return(raweset)
}
ebi-gene-expression-group/bioconductor-ArrayExpress documentation built on April 9, 2023, 6:39 a.m.