a b/R/downloadAndProcessDLBCL.R
1
#' Download and process all curated DLBCL datasets
2
#'
3
#' Automatically download and process all support curated DLBCL datasets.
4
#' Simply loops over all datasets in \code{data(dlbcl_overview)}.
5
#'
6
#' @param \dots Arguments passed to \code{\link{downloadAndProcessGEO}}.
7
#' @return Saves a \code{list} of the processed datasets in the working
8
#'   directory named "dlbcl_data.Rds".
9
#'   Invisibly returns a \code{list} of the output of
10
#'   \code{\link{downloadAndProcessGEO}}.
11
#' @author
12
#'   Anders Ellern Bilgrau\cr
13
#'   Steffen Falgreen Larsen
14
#' @examples
15
#' listTargets("brainarray")
16
#' \dontrun{
17
#' # Warning, very long processing times if data is not downloaded.
18
#'
19
#' # Preprocess with brainarray "Entrez" gene ids
20
#' res <- downloadAndProcessDLBCL(cdf = "brainarray", target = "ENTREZG",
21
#'                                clean = FALSE)
22
#'
23
#' # Preprocess with brainarray "Ensembl" gene ids
24
#' res2 <- downloadAndProcessDLBCL(cdf = "brainarray", target = "ENSG",
25
#'                                 clean = TRUE)
26
#'
27
#' # Preprocess with affy's probesets
28
#' res3 <- downloadAndProcessDLBCL()  #= downloadAndProcessDLBCL(cdf = "affy")
29
#' }
30
#' @export
31
downloadAndProcessDLBCL <- function(...) {
32
  st <- proc.time()
33
  message("\nDownloading and processing all DLBCL datasets\n")
34
35
  res <- list()
36
  for (i in 1:nrow(DLBCLdata::DLBCL_overview)) {
37
    geo_nbr <- as.character(DLBCLdata::DLBCL_overview$GSE[i])
38
    stdy    <- as.character(DLBCLdata::DLBCL_overview$Study[i])
39
40
    message(sprintf("\n\n\n\n #### %s (%s) ####\n\n\n", geo_nbr, stdy))
41
42
    t <- system.time({
43
      res[[i]] <- downloadAndProcessGEO(geo_nbr = geo_nbr, ...)
44
    })
45
46
    message(sprintf("\n %s finished successfully in %s minutes.\n",
47
                    geo_nbr, t[3] %/% 60))
48
  }
49
50
  names(res) <- as.character(DLBCLdata::DLBCL_overview$GSE)
51
52
  message("Saving all processed DLBCL data")
53
  saveRDS(res, file = file.path(getwd(), "dlbcl_data.Rds"))
54
55
  message("\nFinished  in ", (proc.time()-st)[3] %/% 60, " minutes.\n")
56
  return(invisible(res))
57
}