[BioC] how to analyse a matrix of genes vs samples with limma

Ido M. Tamir tamir at imp.univie.ac.at
Thu Dec 13 10:04:07 CET 2007


On Thursday 13 December 2007 09:38:02 Federico Abascal wrote:
> Estimated colleagues,

> I have a matrix with columns corresponding to different experiments or
> samples, and rows corresponding to genes. In a separate vector of
> factors I have a label indicating to which class each sample belongs to
> (it could be mutant or WT, for instance). I read that, in order to load
> data with limma, you have to create a design matrix in which a filename
> for each experiment (or sample) is given... but I have all the
> experiments in the same matrix, not in separate files. So, my  (simple)
> question is: is there a way to go from my matrix to limma?

lmFit can deal with a matrix of background corrected normalized M values. 
An example is given in the examples.
The difficult part is constructing the design matrix correctly, and this only 
needs the column names.

 # Simulate gene expression data for 100 probes and 6 microarrays
  # Microarray are in two groups
  # First two probes are differentially expressed in second group
  # Std deviations vary between genes with prior df=4
  sd <- 0.3*sqrt(4/rchisq(100,df=4))
  y <- matrix(rnorm(100*6,sd=sd),100,6)
   rownames(y) <- paste("Gene",1:100)
  y[1:2,4:6] <- y[1:2,4:6] + 2
   design <- cbind(Grp1=1,Grp2vs1=c(0,0,0,1,1,1))
   options(digit=3)

 fit <- lmFit(y,design)
     fit <- eBayes(fit)
     fit
     as.data.frame(fit[1:10,2])



etc...

best wishes,

ido



More information about the Bioconductor mailing list