Diff of /R/readDACData.R [000000] .. [28aa3b]

Switch to unified view

a b/R/readDACData.R
1
#' Read DLBCL class files
2
#'
3
#' Functions to read the internal data files of classified CEL files using
4
#' the DLBCL Automatic Classifier (DAC) [1]. These were manually supplied to the
5
#' DAC Windows interface.
6
#'
7
#' @param geo_nbr A \code{character} string giving the GSE number.
8
#' @return A \code{data.frame} of the predicted classes and the class
9
#'   probabilities. Returns \code{NULL} if \code{geo_nbr} is not found.
10
#' @author
11
#'   Anders Ellern Bilgrau \cr
12
#'   Steffen Falgreen
13
#' @references
14
#'   [1] Care, M. A., Barrans, S., Worrillow, L., Jack, A., Westhead, D. R., &
15
#'       Tooze, R. M. (2013). A microarray platform-independent classification
16
#'       tool for cell of origin class allows comparative analysis of gene
17
#'       expression in diffuse large B-cell lymphoma.
18
#'       PloS One, 8(2), e55895. doi:10.1371/journal.pone.0055895
19
#' @note
20
#' The GSE11318 dataset was not classified using the DAC.
21
#' @examples
22
#' head(DLBCL_overview[, -c(3,4,6)])
23
#'
24
#' head(readDACData("GSE19246"))
25
#'
26
#' readDACData("UNSUPPORTED_STUDY")
27
#' @export
28
readDACData <- function(geo_nbr) {
29
  extdir <- system.file("extdata", package = "DLBCLdata")
30
  files <- list.files(extdir, pattern = "^predictions-.+\\.txt$",
31
                      full.names = TRUE)
32
  file <- grep(geo_nbr, files, value = TRUE)
33
  dat <- lapply(file, read.table, header = TRUE)
34
  names(dat) <- gsub("predictions-|\\.txt$", "", basename(file))
35
  ans <- do.call(rbind, dat)
36
  return(ans)
37
}