File: ArrayExpress.r

package info (click to toggle)
r-bioc-arrayexpress 1.66.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 460 kB
  • sloc: makefile: 2
file content (25 lines) | stat: -rw-r--r-- 686 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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)
}