[BioC] Saving all AffyPLM residual plots to disk

Henrik Bengtsson hb at biostat.ucsf.edu
Wed Oct 2 03:00:40 CEST 2013


On Tue, Oct 1, 2013 at 10:56 AM, James W. MacDonald <jmacdon at uw.edu> wrote:
> Hi Leif,
>
> Here is some code I use to do this. Here I assume you have both an
> ExpressionSet called 'eset' and a PLMset called 'plm'. I usually use oligo,
> so in my case it is an oligoPLM object, but no matter.
>
> sn <- gsub("\\.CEL", "", sampleNames(eset))
> ## don't re-make existing plots
> if(!all(file.exists(paste(sn[length(sn)], "png", sep = ".")))) {
>    sn <- sn[!file.exists(paste(sn[length(sn)], "png", sep = "."))]
>    for(i in seq_len(length(sn))){
>        png(paste0(sn[i], "png"))
>        image(plm, type = "residuals", which = i)
>        dev.off()
>    }
> }

FYI, with the 'R.devices' package the above can be done as:

library("R.devices")
## don't re-make existing plots
options("devEval/args/force"=FALSE)

sn <- gsub("\\.CEL", "", sampleNames(eset))
for(i in seq_along(sn)) {
  toPNG(sn[i], {
    image(plm, type="residuals", which=i)
  })
}

Adjust aspect ratio by specifying argument 'aspectRatio' for toPNG().


A completely different path is to use aroma.affymetrix, e.g.

library("aroma.affymetrix")
csR <- AffymetrixCelSet$byName("GSE9890", chipType="HG-U133_Plus_2")
res <- doRMA(csR, drop=FALSE, verbose=TRUE)
rs <- calculateResidualSet(res$plm, verbose=TRUE)
ae <- ArrayExplorer(rs)
setColorMaps(ae, c("log2,log2neg,rainbow", "log2,log2pos,rainbow"))
process(ae, interleaved="auto", verbose=TRUE)
display(ae)

That will generate PNGs where each probe on the array occupies exactly
one pixel.  These PNGs can be navigated via the ArrayExplorer.  See
the residual ArrayExplorer example on http://aroma-project.org/demos/
for an example.

/Henrik

>
>
> Best,
>
> Jim
>
>
>
> On Tuesday, October 01, 2013 1:43:37 PM, Peterson, Leif wrote:
>>
>> We are interested in saving all the AffyPLM residual plots to disk (in a
>> single folder) but cannot find syntax in the user's guide or in forums on
>> how to do this.   Thx ahead of time, LP
>>
>> Houston Methodist. Leading Medicine.
>>
>> Ranked by U.S.News & World Report as one of America's "Best Hospitals" in
>> 13 specialties. Named to FORTUNE® Magazine's "100 Best Companies to Work
>> For®" list eight years in a row. Designated as a Magnet hospital for
>> excellence in nursing. Visit us at houstonmethodist.org. Follow us at
>> twitter.com/MethodistHosp and www.facebook.com/HoustonMethodist.
>>
>> ***CONFIDENTIALITY NOTICE*** This e-mail is the property of Houston
>> Methodist Hospital and/or its relevant affiliates and may contain restricted
>> and privileged material for the sole use of the intended recipient(s). Any
>> review, use, distribution or disclosure by others is strictly prohibited. If
>> you are not the intended recipient (or authorized to receive for the
>> recipient), please contact the sender and delete all copies of the message.
>> Thank you.
>>
>> _______________________________________________
>> Bioconductor mailing list
>> Bioconductor at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/bioconductor
>> Search the archives:
>> http://news.gmane.org/gmane.science.biology.informatics.conductor
>
>
> --
> James W. MacDonald, M.S.
> Biostatistician
> University of Washington
> Environmental and Occupational Health Sciences
> 4225 Roosevelt Way NE, # 100
> Seattle WA 98105-6099
>
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at r-project.org
> 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