[BioC] RG.MA in limma
Wang, Jixin
jixinwang at tamu.edu
Fri Mar 13 04:19:13 CET 2009
Hi Peder,
Thanks a lot for the explanation. The code ran well now and the problem has been solved. Again, I appreciate your kind help!
Best Regards,
Wang
----- Original Message -----
From: "Peder Worning" <pwo at exiqon.com>
To: "Jixin Wang" <jixinwang at tamu.edu>
Cc: bioconductor at stat.math.ethz.ch
Sent: Tuesday, March 10, 2009 2:41:48 AM GMT -06:00 US/Canada Central
Subject: RE: [BioC] RG.MA in limma
Dear Wang,
The cy3.channel.norm and cy5.channel.norm are the normalized data you
are looking for. The Cy3.norm and Cy5.norm are only relevant if each
probe is spotted several times on the array and you then want to use the
median (or mean) of these replicates. The apply function in my code sums
over all spots with the same name (probeId), on our array every probe is
spotted four times. There was two of missing line shifts in my mail,
which may explain some of your troubles. Below is shown the code lines
with the right line shift (if Outlook doesn't fool me again).
I Hope it may help you
Peder
rownames(RG) <- RG$genes[,6] #I use that to sum over spot replicates
RGb = backgroundCorrect(RG, method="normexp", offset=50)
MA = normalizeWithinArrays(RGb, method="loess", weights=RGb$weights)
log.ratio <- MA$M # this is the Ratio data with four spots per probe
Best regards
Exiqon A/S
Peder Worning, Ph.D.
-----Original Message-----
From: Wang, Jixin [mailto:jixinwang at tamu.edu]
Sent: Monday, March 09, 2009 7:38 PM
To: Peder Worning
Cc: Jixin Wang; bioconductor at stat.math.ethz.ch
Subject: Re: [BioC] RG.MA in limma
Dear Peder,
Many thanks for the kind help. Is the cy3.channel.norm and
cy5.channel.norm I want according to your code? I got error when I ran
your code. I don't understand the Cy3.norm and Cy5.norm object even
after I check the ?apply and ?tapply. Thanks.
> Cy3.norm <-
apply(cy3.channel,2,function(v){tapply(v,names(v),function(x){median(x,n
a.rm=TRUE)})})
Error in as.vector(x, mode) : invalid 'mode' argument
> Cy5.norm <-
apply(cy5.channel,2,function(v){tapply(v,names(v),function(x){median(x,n
a.rm=TRUE)})})
Error in as.vector(x, mode) : invalid 'mode' argument
Here is the modified code following yours
library(limma)
setwd("C:/Documents and Settings/JWang/Desktop/la")
targets <- readTargets("norm vs dev.txt")
targets
RG <- read.maimages(targets$FileName, source="genepix")
RG
RG = backgroundCorrect(RG, method="normexp", offset=50)
cy3.channel = RG$G
cy3.channel.norm =normalizeBetweenArrays(log2(cy3.channel),
method="scale")
cy5.channel = RG$R
cy5.channel.norm =normalizeBetweenArrays(log2(cy5.channel),
method="scale")
MA = normalizeWithinArrays(RG, method="printtiploess")
log.ratio <- MA$M
write.csv(log.ratio,file="Mvalues.csv")
write.table(cy3.channel.norm, file="cy3.channel.norm.txt")
write.table(cy5.channel.norm, file="cy5.channel.norm.txt")
Best Regards,
Wang
----- Original Message -----
From: "Peder Worning" <pwo at exiqon.com>
To: "Jixin Wang" <jixinwang at tamu.edu>, bioconductor at stat.math.ethz.ch
Sent: Monday, March 9, 2009 3:06:03 AM GMT -06:00 US/Canada Central
Subject: RE: [BioC] RG.MA in limma
Dear Jixin Wang,
I use limma to normalize both one channel data normalizeBetweenArrays()
and two channel data normalizeWithinArrays()
I'll paste some code below to show what I do starting with the RG
object. I am working with microRNA data and Exiqon arrays and you should
find the parameters, that fit your experiment. You should also check,
which channel is Cy3 and which is Cy5. My Cy3 is counter intuitively
called RG$R. The Cy3.norm and Cy5.norm should be what you are asking
for.
I hope it can help you.
Regards
Peder
rownames(RG) <- RG$genes[,6] #I use that to sum over spot replicates
RGb = backgroundCorrect(RG, method="normexp", offset=50)
cy3.channel = RGb$R
cy3.channel.norm =normalizeBetweenArrays(log2(cy3.channel),
method="quantile")
#this is the Logscaled Cy3 data with four spots per probe
cy5.channel = RGb$G
cy5.channel.norm =normalizeBetweenArrays(log2(cy5.channel),
method="quantile")
#this is the Logscaled Cy5 data with four spots per probe
MA = normalizeWithinArrays(RGb, method="loess", weights=RGb$weights)
log.ratio <- MA$M # this is the Ratio data with four spots per probe
#The median of the replicate probes:
Cy3.norm <-
apply(cy3.channel,2,function(v){tapply(v,names(v),function(x){median(x,n
a.rm=TRUE)})})
Cy5.norm <-
apply(cy5.channel,2,function(v){tapply(v,names(v),function(x){median(x,n
a.rm=TRUE)})})
LogRatio <-
apply(logratio,2,function(v){tapply(v,names(v),function(x){median(x,na.r
m=TRUE)})})
Best regards
Exiqon A/S
Peder Worning, Ph.D.
Senior Scientist, Biomarker Discovery
-----Original Message-----
From: bioconductor-bounces at stat.math.ethz.ch
[mailto:bioconductor-bounces at stat.math.ethz.ch] On Behalf Of Wang, Jixin
Sent: Monday, March 09, 2009 6:58 AM
To: bioconductor at stat.math.ethz.ch
Subject: [BioC] RG.MA in limma
Dear All,
I have one question that has perplexed me for a while. I use two color
arrays and I want to get the normalized log2 intensity values instead of
M values in MA$M (say, I have four arrays and I want to get eight
channels (red and green) of normalized expression data. How can I get
them? I have checked the RG.MA function in R and have confused about
this problem. I always got error messages whenever I try. Any help will
be greatly appreciated!
In R help for package limma, it said
MA.RG converts an unlogged RGList object into an MAList object.
MA.RG(object) is equivalent to
normalizeWithinArrays(object,method="none").
RG.MA(object) converts back from an MAList object to a RGList object
with unlogged intensities.
> RG.MA$R <- 2^(MA$A + MA$M/2)
Error in RG.MA$R <- 2^(MA$A + MA$M/2) :
object of type 'closure' is not subsettable
> RG.MA$G <- 2^(MA$A - MA$M/2)
Error in RG.MA$G <- 2^(MA$A - MA$M/2) :
object of type 'closure' is not subsettable
sessionInfo()
R version 2.8.1 (2008-12-22)
i386-pc-mingw32
locale:
LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
States.1252;LC_MONETARY=English_United
States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] limma_2.16.4
Best Regards,
Wang
_______________________________________________
Bioconductor mailing list
Bioconductor at stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/bioconductor
Search the archives:
http://news.gmane.org/gmane.science.biology.informatics.conductor
More information about the Bioconductor
mailing list