R/geneES.R

Defines functions geneES

Documented in geneES

#' Function "geneES"
#'
#' This function constructs expression set for given matrix and pdata information
#' @importFrom stats aggregate
#' @importFrom Biobase ExpressionSet
#' @importFrom methods new
#' @param matrix a matrix for constructing the ExpressionSet object.
#' @param pdata a data frame for the pData.
#' @return an ExpressionSet obejct.
#' @export

geneES <- function(matrix, pdata) {
  # create phenotype file
  meta_phe <- data.frame(labelDescription=c('SampleID', 'Group'),
                         row.names=c('SampleID', 'Group'))
  gene_phe <- new("AnnotatedDataFrame", data=pdata, varMetadata=meta_phe)
  
  # construct ExpressionSet object from gene.exp and gene.phe
  gene.es <- ExpressionSet(assayData=matrix, phenoData=gene_phe, annotation="hgu95av2")
  
  # return result
  return(gene.es)
}
Coraline66/RNASeqAnalysis documentation built on Nov. 25, 2019, 8:03 a.m.