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 <- Biobase::exprs(data)
  fcNorm <- t(apply(X=fcOld, MARGIN=1, function(x) x*coeffs))

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

  return(data)
}

Try the TPP package in your browser

Any scripts or data that you put into this service are public.

TPP documentation built on Nov. 8, 2020, 5:55 p.m.