[BioC] Limma script - Opinions requested

Gordon K Smyth smyth at wehi.EDU.AU
Mon Aug 30 01:39:28 CEST 2010


A couple of corrections.  Background correct is yet doing everything it 
should with EList objects, so the background subtraction has to be done 
manually.  And I now see why you're not getting gene names in your 
toptable.  You can use

  x <- read.maimages(targets,columns=list(G="Median",Gb="MedBackground"),green.only=TRUE)
  x$genes <- read.delim("Annotation file.txt",stringsAsFactors=FALSE)
  x$E <- x$E-x$Eb
  x <- backgroundCorrect(x, method="normexp", offset=50)
  y <- normalizeBetweenArrays(x, method="quantile")

Then lmFit(y,design,) etc and you'll have annotation in your toptable.

Gordon

On Mon, 30 Aug 2010, Gordon K Smyth wrote:

> Dear Lisa,
>
> limma now has a representation for single colour arrays (ELists), so you can 
> simplify your pre-processing code somewhat:
>
> E <- 
> read.maimages(targets,columns=list(G="Median",Gb="MedBackground"),green.only=TRUE)
> E$genes <- read.delim("Annotation file.txt",stringsAsFactors=FALSE)
> E <- backgroundCorrect(E, method="subtract")
> E <- backgroundCorrect(E, method="normexp", offset=50)
> NormE <- normalizeBetweenArrays(E, method="quantile")
>
> I don't understand you question about getting gene names in the toptable, as 
> this should happen automatically.
>
> Best wishes
> Gordon
>
>
>> Date: Fri, 27 Aug 2010 10:59:10 -0700
>> From: "Orfe, Lisa" <lorfe at vetmed.wsu.edu>
>> To: "'bioconductor at stat.math.ethz.ch'"
>> 	<bioconductor at stat.math.ethz.ch>
>> Subject: [BioC] Limma script - Opinions requested
>> Message-ID:
>> 	<44F1D6D7EB8CC84F92859EE5C4E6ECB4011374445539 at CVMMBX.vetmed.wsu.edu>
>> Content-Type: text/plain; charset="us-ascii"
>> 
>> 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.
>> 
>> 
>>> library(limma)
>>> 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
>> Lisa Orfe
>> Bustad 405
>> 509-335-6320
>> "Science is a wonderful thing when one does not have to earn one's living 
>> at it."  Albert Einstein
>

______________________________________________________________________
The information in this email is confidential and intend...{{dropped:4}}



More information about the Bioconductor mailing list