[BioC] Limma script - Opinions requested

Orfe, Lisa lorfe at vetmed.wsu.edu
Fri Aug 27 19:59:10 CEST 2010

I am VERY new to R/Bioconductor and over the past two weeks have managed, I hope, to put together a limma script to process my single color generic arrays.  I was hoping that some of the experts that read these posts could comment on it - specifically, is it valid?  Is there something I could be doing that is easier/more appropriate?  I know it works as I have been getting the genelists back out at the end, so, my question is very general...is this how you would process a home-made single color array?  If not, I would LOVE some pointers.

>targets <- readTargets("targets.txt")
>RG <- read.maimages(targets,source="generic" +columns=list(R="Median",G="Median",Rb="MedBackground",Gb="MedBackground"))
>RG$genes <- read.delim("Annotation file.txt")
>BsubRG <- backgroundCorrect(RG, method="normexp", offset=50)
>NormRG <- normalizeBetweenArrays(BSubRG$G, method="quantile")
>MA <- log2(NormRG)

---Now - if I have a single factor I would set up my design as such:
>design <- model.matrix(~0+factor(c(1,2,3,4,1,2,3,4,1,2,3,4)))
>colnames(design) <- c("A", "B", "C", "D")
>corfit <- duplicateCorrelation(MA, design, ndups=4)
>fit <- lmFit(MA, design, ndups=4, correlation=corfit$consensus)
>fit <- eBayes(fit)
>cont.matrix <- makeContrasts(AvsB=A-B, levels=design)
>fit2 <- contrasts.fit(fit, cont.matrix)
>fit2 <- eBayes(fit2)
>GeneList <- topTable(fit2, "AvsB", n=20, adjust="BH", lfc=1)
>write.table(GeneList, file = "file name.txt", quote = FALSE, sep = "\t")	

---however, if I have multiple factors, then I set up the design as...
>TS <- paste(targets$columnname, targets$columnname, sep=".")
>TS <- factor(TS, levels=c("xx.xx", "xx.xx", "xx.xx"))
>design <- model.matrix(~0+TS)
>colnames(design) <- levels(TS)

Everything after is the same as above...in pasting this in I do have a couple of questions.

1.  Is it recommended/necessary to apply a Bayesian smoothing to both fits?
2.  How do I get back out my gene names *in* the topTable?

Thanks for your time and I apologize if the answers seem remarkably obvious.

Lisa Orfe
Bustad 405
"Science is a wonderful thing when one does not have to earn one's living at it."  Albert Einstein

More information about the Bioconductor mailing list