R/applyCoeffs.R

Defines functions applyCoeffs

applyCoeffs <- function(data, coeffs){
  ## Normalize fold changes stored in an ExpressionSet object using a given 
  ## vector of coefficients.
  fcOld <- exprs(data)
  fcNorm <- t(apply(X=fcOld, MARGIN=1, function(x) x*coeffs))

  exprs(data)    <- fcNorm
  data$normCoeff <- coeffs

  return(data)
}
Bioconductor-mirror/TPP documentation built on July 7, 2017, 11:01 p.m.