Revision 6a80938221db42de7ada247daeed186559d3a866 authored by Alexey Sergushichev on 01 August 2018, 15:46:46 UTC, committed by Alexey Sergushichev on 01 August 2018, 15:46:46 UTC
1 parent 4e1551c
createES.R
#' Create ExpressionSet.
#'
#' \code{createES} function produces an ExpressionSet object from given data,
#' and exports it to global scope.
#'
#' @param data Gene expression matrix.
#'
#' @param pData Matrix with phenotypical data.
#'
#' @param varLabels Names of phenoData columns.
#'
#' @param fData Matrix with feature data.
#'
#' @param fvarLabels Names of featureData columns.
#'
#' @return produced ExpressionSet object
#'
#' @import Biobase
#'
#' @examples
#' \dontrun{
#' data <- matrix(1:15, 5, 3)
#' pData <- c("A", "B", "C")
#' varLabels <- "cat"
#' fData <- c("p", "r", "s", "t", "u")
#' fvarLabels <- "id"
#' createES(data, pData, varLabels, fData, fvarLabels)
#' }
#'
createES <- function(data, pData, varLabels, fData, fvarLabels) {
phenoData <- AnnotatedDataFrame(data.frame(pData, stringsAsFactors = FALSE))
varLabels(phenoData) <- varLabels
featureData <- AnnotatedDataFrame(data.frame(fData, stringsAsFactors = FALSE))
varLabels(featureData) <- fvarLabels
es <- ExpressionSet(assayData = data,
phenoData = phenoData,
featureData = featureData)
assign("es", es, envir = parent.frame())
es
}
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...