How to save jpegs of all MAplots of an affybatch
2
0
Entering edit mode
@giulio-di-giovanni-950
Last seen 10.2 years ago
Hi, hoping is not a stupid question, I would like to have a jpeg copy of all MAplots I created for my affybatch object. jpeg(file=paste(sampleNames(mysamples), anname,".jpeg", sep="")) MAplot(mysamples) dev.off() doesn't work, it writes on the same file all the plots and (ovbiously) for(i in 1:n){ jpeg(file=paste(sampleNames(mysamples[,i]),"MAplot.jpeg", sep="")) MAplot(mysamples[,i]) dev.off() } because to produce a MAplot on an affy chip, you need a median pseudo- chip (i.e. at least two chips) Does anyone have an idea/suggestion ? Thanks a lot in advance Giulio
affy affy • 905 views
ADD COMMENT
0
Entering edit mode
Ben Bolstad ★ 1.2k
@ben-bolstad-1494
Last seen 7.2 years ago
The easiest way is something like jpeg("MAplot%03d.jpeg") MAplot(mysamples) dev.off() which would write files MAplot001.jpeg, MAplot002.jpeg, ...... Alternatively, you could use the ref argument to MAplot (to make one of the arrays the reference) and generate n-1 MAplots using your loop structure. eg for(i in 2:n){ jpeg(file=paste(sampleNames(mysamples[,i]),"MAplot.jpeg", sep="")) MAplot(mysamples[,i],ref=1) dev.off() On Wed, 2005-11-23 at 16:09 +0000, Giulio Di Giovanni wrote: > Hi, > > hoping is not a stupid question, > I would like to have a jpeg copy of all MAplots I created for my affybatch > object. > > jpeg(file=paste(sampleNames(mysamples), anname,".jpeg", sep="")) > MAplot(mysamples) > dev.off() > > doesn't work, it writes on the same file all the plots > > and (ovbiously) > > for(i in 1:n){ > jpeg(file=paste(sampleNames(mysamples[,i]),"MAplot.jpeg", sep="")) > MAplot(mysamples[,i]) > dev.off() > } > > because to produce a MAplot on an affy chip, you need a median pseudo-chip > (i.e. at least two chips) > > Does anyone have an idea/suggestion ? > > Thanks a lot in advance > > Giulio > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor -- Ben Bolstad <bmb at="" bmbolstad.com=""> http://bmbolstad.com
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 40 minutes ago
United States
Giulio Di Giovanni wrote: > Hi, > > hoping is not a stupid question, > I would like to have a jpeg copy of all MAplots I created for my affybatch > object. Not a stupid question per se, but one that you *might* have been able to answer by a close reading of the relevant help files, or alternatively by RSiteSearch("jpeg multiple files") From ?jpeg: filename: the name of the output file, up to 511 characters. The page number is substituted if a C integer format is included in the character string, as in the default. (The result must be less than 600 characters long. See 'postscript' for further details.) From ?postscript: file: a character string giving the name of the file. If it is '""', the output is piped to the command given by the argument 'command'. For use with 'onefile=FALSE' give a 'printf' format such as '"Rplot%03d.ps"' (the default in that case). So if you simply did jpeg() MAplot(mysamples) dev.off() you would end up with n jpeg files in your working directory named Rplot001.jpg Rplot002.jpg ... Rplot00n.jpg If you really don't want these names, you could try your second attempt, but add these two lines after the call to jpeg() medchip <- rowMedians(log2(intensity(mysamples)[pms,])) MAplot(mysamples[,i], ref=medchip) Best, Jim > > jpeg(file=paste(sampleNames(mysamples), anname,".jpeg", sep="")) > MAplot(mysamples) > dev.off() > > doesn't work, it writes on the same file all the plots > > and (ovbiously) > > for(i in 1:n){ > jpeg(file=paste(sampleNames(mysamples[,i]),"MAplot.jpeg", sep="")) > MAplot(mysamples[,i]) > dev.off() > } > > because to produce a MAplot on an affy chip, you need a median pseudo-chip > (i.e. at least two chips) > > Does anyone have an idea/suggestion ? > > Thanks a lot in advance > > Giulio > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor -- James W. MacDonald Affymetrix and cDNA Microarray Core University of Michigan Cancer Center 1500 E. Medical Center Drive 7410 CCGC Ann Arbor MI 48109 734-647-5623
ADD COMMENT
0
Entering edit mode
James W. MacDonald wrote: > If you really don't want these names, you could try your second attempt, > but add these two lines after the call to jpeg() > > medchip <- rowMedians(log2(intensity(mysamples)[pms,])) > MAplot(mysamples[,i], ref=medchip) > Correction - this won't work - a closer reading of the code (or Ben's email) would have alerted me to the fact that the ref argument applies to the index of a reference chip rather than a set of reference data. Best, Jim -- James W. MacDonald Affymetrix and cDNA Microarray Core University of Michigan Cancer Center 1500 E. Medical Center Drive 7410 CCGC Ann Arbor MI 48109 734-647-5623
ADD REPLY
0
Entering edit mode
Thanks a lot, I've read the help files and the R and BioC manuals too (and googled too), apparently I didn't understand the suggestions...sorry...I don't' know what to say... Now everything is ok. Well, I discovered that characters following "%" in file name have special meanings...(adding spaces etc etc) There's somewhere a list of these characters and their meanings, others that "%3d" ? Sorry again if I'm bothering you all, that's just that I always like to fully know what I'm doing... thX again Giulio >From: "James W. MacDonald" <jmacdon at="" med.umich.edu=""> >To: bioconductor at stat.math.ethz.ch >Subject: Re: [BioC] How to save jpegs of all MAplots of an affybatch >Date: Wed, 23 Nov 2005 11:56:54 -0500 > >Giulio Di Giovanni wrote: > > Hi, > > > > hoping is not a stupid question, > > I would like to have a jpeg copy of all MAplots I created for my >affybatch > > object. > >Not a stupid question per se, but one that you *might* have been able to >answer by a close reading of the relevant help files, or alternatively >by RSiteSearch("jpeg multiple files") > > From ?jpeg: > >filename: the name of the output file, up to 511 characters. The page > number is substituted if a C integer format is included in > the character string, as in the default. (The result must be > less than 600 characters long. See 'postscript' for further > details.) > > From ?postscript: > > file: a character string giving the name of the file. If it is > '""', the output is piped to the command given by the > argument 'command'. > > For use with 'onefile=FALSE' give a 'printf' format such as > '"Rplot%03d.ps"' (the default in that case). > >So if you simply did > >jpeg() >MAplot(mysamples) >dev.off() > >you would end up with n jpeg files in your working directory named >Rplot001.jpg >Rplot002.jpg >... >Rplot00n.jpg > >If you really don't want these names, you could try your second attempt, >but add these two lines after the call to jpeg() > >medchip <- rowMedians(log2(intensity(mysamples)[pms,])) >MAplot(mysamples[,i], ref=medchip) > >Best, > >Jim > > > > > > > > jpeg(file=paste(sampleNames(mysamples), anname,".jpeg", sep="")) > > MAplot(mysamples) > > dev.off() > > > > doesn't work, it writes on the same file all the plots > > > > and (ovbiously) > > > > for(i in 1:n){ > > jpeg(file=paste(sampleNames(mysamples[,i]),"MAplot.jpeg", sep="")) > > MAplot(mysamples[,i]) > > dev.off() > > } > > > > because to produce a MAplot on an affy chip, you need a median >pseudo-chip > > (i.e. at least two chips) > > > > Does anyone have an idea/suggestion ? > > > > Thanks a lot in advance > > > > Giulio > > > > _______________________________________________ > > Bioconductor mailing list > > Bioconductor at stat.math.ethz.ch > > https://stat.ethz.ch/mailman/listinfo/bioconductor > > >-- >James W. MacDonald >Affymetrix and cDNA Microarray Core >University of Michigan Cancer Center >1500 E. Medical Center Drive >7410 CCGC >Ann Arbor MI 48109 >734-647-5623 > >_______________________________________________ >Bioconductor mailing list >Bioconductor at stat.math.ethz.ch >https://stat.ethz.ch/mailman/listinfo/bioconductor
ADD REPLY

Login before adding your answer.

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