[BioC] AffyBatch boxplot and histograms

Nathan.Watson-Haigh at csiro.au Nathan.Watson-Haigh at csiro.au
Fri Jun 27 00:39:54 CEST 2008


I'm still pretty new to R, so your "working's out" are really helpful
for when I have a similar question. I think I've come across other
places that don't make it clear whether PM, MM, or both probe
intensities are being used. Should I report these to the list as and
when I come across them?

Thanks for the help!
Nathan

-----Original Message-----
From: James W. MacDonald [mailto:jmacdon at med.umich.edu] 
Sent: Thursday, 26 June 2008 11:51 PM
To: Watson-Haigh, Nathan (LI, Rockhampton)
Cc: bioconductor at stat.math.ethz.ch
Subject: Re: [BioC] AffyBatch boxplot and histograms

Hi Nathan,

Nathan.Watson-Haigh at csiro.au wrote:
> I'm a little confused what values are actually being plotted for
> boxplot() and hist() when an AffyBatch object is passed. Do they just
> plot the PM probe intensities or the MM probes as well?
>  
> Can anyone clarify?

I see why you are confused - the help pages for S4 methods/classes are 
IMO not very clear. You can RTFM all you want and still not know what is

going on, and to a certain extent this is a good example.

So, from ?AffyBatch-class:

  boxplot 'signature(x = "AffyBatch")':  creates a 'boxplots of log
           base 2 intensities. '

      hist 'signature(x = "AffyBatch")':  creates a plot showing all the
           histograms of the pm,mm or both data. See 'plot.density'

Boxplot remains opaque, whereas hist gives a hint. From ?plot.density:

plot.density              package:stats              R Documentation

Plot Method for Kernel Density Estimation

Hmm, that's still really opaque, since we have been routed wrong (I will

fix this man page btw...).

How about ?plotDensity:

Usage:

      plotDensity(mat, ylab = "density", xlab="x", type="l", col=1:6,
                  na.rm = TRUE, ...)

      plotDensity.AffyBatch(x, col = 1:6, log = TRUE,
                            which=c("pm","mm","both"),
                            ylab = "density",
                            xlab = NULL, ...)

Aha! So the default is to plot the pm probes, but you can do mm or both 
if you want.

Now for boxplot. How about looking at the method definition directly?

 > showMethods(boxplot, class = "AffyBatch", includeDefs = TRUE)
Function: boxplot (package graphics)
x="AffyBatch"
function (x, ...)
{
     .local <- function (x, which = "both", range = 0, main, ...)
     {
         tmp <- description(x)
         if (missing(main) && (is(tmp, "MIAME")))
             main <- tmp at title
         tmp <- unlist(indexProbes(x, which))
         tmp <- tmp[seq(1, length(tmp), len = 5000)]
         boxplot(data.frame(log2(intensity(x)[tmp, ])), main = main,
             range = range, ...)
     }
     .local(x, ...)
}

So here the default is to plot both pm and mm probes, but you can choose

pm, mm or both as well.

Best,

Jim



>  
> Cheers,
> Nathan
>  
> -------------------------------------------------------------
> Dr. Nathan S. Watson-Haigh        (publish under Haigh, N.S.)
> OCE Post Doctoral Fellow
> CSIRO Livestock Industries
> J M Rendel Laboratory 
> Rockhampton
> QLD 4701                              Tel: +61 (0)7 4923 8121
> Australia                             Fax: +61 (0)7 4923 8222
> -------------------------------------------------------------
> 
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> 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
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