[R] Using R for microarrays datas analysis by Mixed model ANOVA. lme function.

Laurent Gautier laurent at cbs.dtu.dk
Fri Sep 12 13:21:46 CEST 2003


Just a note about linear model fitting in Bioconductor. Biobase
(in the devel section) has a feature to cast an exprSet to
a data.frame. Althought this cannot compare with the very nice 'user-friendly' 
features in the pack 'limma', it lets one with experience and habits with data.frames
 (use of formulae and all the goodies in nlme) remain on known
ground.

L.

PS: Biobase-devel needs R-devel since a recent time. The following
R code does the cast (just copy/paste it). 

as.data.frame.exprSet <- function(x, row.names=NA, optional=NA) {
  nc.eset <- ncol(exprs(x))
  nr.eset <- nrow(exprs(x))
  gn.eset <- geneNames(x)

  if (is.null(gn.eset))
    gn.eset <- rep(NA, nr.eset)
  i.pdata <- rep(seq(1, nc.eset), rep(nr.eset, nc.eset))

  pexp <- c(exprs(x))
  
  
  rv <- do.call("data.frame", c(list(exprs=pexp, genenames=rep(gn.eset, nc.eset)),
                                lapply(pData(x), function(y, i.pdata) y[i.pdata], i.pdata))
                )
  
  return(rv)
}

 

-- 
--------------------------------------------------------------
Laurent Gautier			CBS, Building 208, DTU
PhD. Student			DK-2800 Lyngby,Denmark	
tel: +45 45 25 24 89		http://www.cbs.dtu.dk/laurent




More information about the R-help mailing list