[BioC] AffyBatch boxplot and histograms

James W. MacDonald jmacdon at med.umich.edu
Thu Jun 26 15:51:13 CEST 2008


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