[28aa3b]: / R / readDACData.R

Download this file

38 lines (37 with data), 1.5 kB

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