[BioC] How to save jpegs of all MAplots of an affybatch

James W. MacDonald jmacdon at med.umich.edu
Wed Nov 23 17:56:54 CET 2005


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



More information about the Bioconductor mailing list