creating an MA plot with two single channel agilent arrays
1
0
Entering edit mode
yifang tan ▴ 20
@yifang-tan-4739
Last seen 9.6 years ago
Hi, Gordon! Related to your last message of this thread, I have a question about MA-plot the mean values of two treatments. Say: I have RG$G as EList, RG$G[, c(1,5,9,13)] as condition-1, RG$G[, c(2,6,10,14)] as condition-2, I want to MA-plot of the mean values for each condition. The reason I do this is that my platform is single channel microarray, and the individual array looks fine but I thought checking the mean value would be another angle to look at the data, which seems reasonable too. (I am not sure, though!) I tried the regular plotting, which works fine: > plot(apply(RG$G[, c(1,5,9,13)], 1, mean), apply(RG$G[, c(2,6,10,14)], 1, mean)) How could I accomplish the plotMA of the two means? The trick maybe to create the EList of the two mean values, and how? Thanks! Yifang Yifang Tan > Date: Mon, 27 Jun 2011 08:39:14 +1000 > From: smyth@wehi.EDU.AU > To: greener@uw.edu > CC: bioconductor@r-project.org > Subject: Re: [BioC] creating an MA plot with two single channel agilent arrays > > Richard, > > If x is an EList and you want an mdplot of arrays 1 and 3: > > mdplot(x$E[,c(1,3)]) > > Gordon > > --------------------------------------------- > Professor Gordon K Smyth, > Bioinformatics Division, > Walter and Eliza Hall Institute of Medical Research, > 1G Royal Parade, Parkville, Vic 3052, Australia. > Tel: (03) 9345 2326, Fax (03) 9347 0852, > smyth@wehi.edu.au > http://www.wehi.edu.au > http://www.statsci.org/smyth > > On Sun, 26 Jun 2011, Richard Green wrote: > > > Wow Gordon, thank you so much. This was extremely helpful. I was able to > > generate some new figures. I couldn't find a lot of info on mdplots() . > > I was able to generate a figure with my whole set of arrays but wasn't > > able to load two individual arrays into mdplots. > > > My plan was to just have two overlaying MA plots from two different > > arrays in different colors. Any suggestions you have on the simplest way > > to achieve this I would be grateful. Again Thank you Gordon. I really > > appreciate it! > > > -Rich > > > > > > > > On Jun 25, 2011, at 6:45 PM, Gordon K Smyth <smyth@wehi.edu.au> wrote: > > > >> Hi Richard, > >> > >> The function plotMA() only makes a single plot. As the help page > >> explains, the argument 'array' is an integer rather than a vector. To > >> see a number of plots side by side, you might try mfrow(). For > >> example, to see 2 plots side by side: > >> > >> par(mfrow=c(1,2)) > >> plotMA(x,array=1) > >> plotMA(x,array=2) > >> > >> To see 4 plots: > >> > >> par(mfrow=c(2,2)) > >> plotMA(x,array=1) > >> etc > >> > >> If you have a set of 24 arrays, plotMA() will compare each individual > >> array to the median-array constructed from all the arrays. > >> > >> If you want to compare just two arrays, mdplot() is another convenient > >> alternative. It gives the same results as plotMA() with just two > >> arrays. > >> > >> Best wishes > >> Gordon > >> > >>> Date: Fri, 24 Jun 2011 16:01:02 -0700 > >>> From: Richard Green <greener@uw.edu> > >>> To: bioconductor@r-project.org > >>> Subject: [BioC] creating an MA plot with two single channel agilent > >>> arrays > >>> > >>> Howdy, > >>> > >>> I've been generating some individual MA plots but would now like to generate > >>> an MA plot with two different arrays to compare them. Ideally I'd like the > >>> two arrays to be different colors so > >>> I can see how they differ > >>> Pasted below is my R session. Any suggestions folks have is appreciated. > >>> -Rich > >>> > >>> library(limma) > >>> > >>> setwd("/vol04/microarray/") > >>> > >>> RG <- > >>> read.maimages(files=dir(),source="agilent",columns=list(G="gMean Signal",Gb="gBGMedianSignal",R="gMeanSignal",Rb="gBGMedianSignal")) > >>> > >>> RG <- backgroundCorrect(RG, method="normexp", offset=50) > >>> > >>> RG <- normalizeBetweenArrays(RG$R, method="quantile") > >>> > >>> RG <- log2(RG) > >>> > >>> for (i in 1:24) { > >>> > >>> fname<-paste("/vol04/microarray/ma_plot",i,".png",sep="") > >>> > >>> png(fname,300,300) > >>> > >>> print(plotMA(RG, array=i, cex=.2, ylim=c(-1.5,1.5))) > >>> > >>> dev.off() > >>> } > >>> > >>> The above works no problem but when I try to add more than one array I get > >>> > >>>> print(plotMA(RG, array=(1:3,13:16), cex=.2, ylim=c(-1.5,1.5))) > >>> Error: unexpected ',' in "print(plotMA(RG, array=(1:3," > >>>> print(plotMA(RG, array=1:13, cex=.2, ylim=c(-1.5,1.5))) > >>> Error in xy.coords(x, y, xlabel, ylabel, log) : > >>> 'x' and 'y' lengths differ > > ______________________________________________________________________ > The information in this email is confidential and intend...{{dropped:4}} > > _______________________________________________ > Bioconductor mailing list > Bioconductor@r-project.org > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor [[alternative HTML version deleted]]
Microarray Microarray • 1.1k views
ADD COMMENT
0
Entering edit mode
@gordon-smyth
Last seen 13 minutes ago
WEHI, Melbourne, Australia
Dear Yifang, Firstly, if you have single channel data, please read it into limma as an EList, not as an RGList object. The plot you are trying to create is called a fitted model MA-plot in limma. You get it by first fitting the linear model to compare your two treatments, then making the MA-plot. Suppose that y is your EList object. You might use: design <- model.matrix(~condition) fit <- lmFit(y, design) plotMA(fit,array=2) If condition has two levels, then this will plot the logFC between your two treatments versus the mean A-value of your arrays. If you have two groups with equal numbers of arrays, then this is the same as the MA plot of mean-values that you proposed. The fitted model MA-plot however is much more general, and can plot any treatment comparison. The 'array' argument specifies in this context which coefficient of the linear model you want to plot. Best wishes Gordon --------------------------------------------- Professor Gordon K Smyth, Bioinformatics Division, Walter and Eliza Hall Institute of Medical Research, 1G Royal Parade, Parkville, Vic 3052, Australia. Tel: (03) 9345 2326, Fax (03) 9347 0852, smyth at wehi.edu.au http://www.wehi.edu.au http://www.statsci.org/smyth On Tue, 5 Jul 2011, yifang tan wrote: > > Hi, Gordon! > > Related to your last message of this thread, I have a question about > MA-plot the mean values of two treatments. Say: I have RG$G as EList, > RG$G[, c(1,5,9,13)] as condition-1, RG$G[, c(2,6,10,14)] as condition-2, > I want to MA-plot of the mean values for each condition. The reason I do > this is that my platform is single channel microarray, and the > individual array looks fine but I thought checking the mean value would > be another angle to look at the data, which seems reasonable too. (I am > not sure, though!) > I tried the regular plotting, which works fine: > plot(apply(RG$G[, c(1,5,9,13)], 1, mean), apply(RG$G[, c(2,6,10,14)], 1, mean)) > > How could I accomplish the plotMA of the two means? The trick maybe to create the EList of the two mean values, and how? > > Thanks! > > Yifang > > > Yifang Tan ______________________________________________________________________ The information in this email is confidential and intend...{{dropped:4}}
ADD COMMENT

Login before adding your answer.

Traffic: 818 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6