creating an MA plot with two single channel agilent arrays
1
0
Entering edit mode
@richard-green-4701
Last seen 9.6 years ago
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 source("http://www.bioconductor.org/biocLite.R") library(limma) setwd("/vol04/microarray/") RG <- read.maimages(files=dir(),source="agilent",columns=list(G="gMeanSignal ",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 > [[alternative HTML version deleted]]
• 1.5k views
ADD COMMENT
0
Entering edit mode
@gordon-smyth
Last seen 1 hour ago
WEHI, Melbourne, Australia

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

ADD COMMENT
0
Entering edit mode
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 at="" 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 at="" uw.edu=""> >> To: bioconductor at 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="gMeanSig nal",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 inte...{{dropped:6}}
ADD REPLY
0
Entering edit mode

Richard,

If x is an EList and you want an mdplot of arrays 1 and 3:

mdplot(x$E[,c(1,3)])

Gordon

ADD REPLY
0
Entering edit mode
Gordon Thanks you so much!!! you are awesome! -Rich On Sun, Jun 26, 2011 at 3:39 PM, Gordon K Smyth <smyth@wehi.edu.au> wrote: > 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="gMeanSignal",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 inte...{{dropped:10}}
ADD REPLY

Login before adding your answer.

Traffic: 506 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