[BioC] Error setting boxplot title in Affy

James MacDonald jmacdon at med.umich.edu
Mon Dec 27 14:43:12 CET 2004


If you want to see the code for the boxplot() method, you have two
choices. Since Bioconductor functions are in general written using S4
methods, you can use getMethods(). In this case, getMethods("boxplot")
returns the following:

> getMethods("boxplot")
x = "ANY":
structure(function (x, ...) 
UseMethod("boxplot"), class = structure("derivedDefaultMethod", package
= "methods"), target = structure(character(0), .Names = character(0),
class = structure("signature", package = "methods")), defined =
structure(character(0), .Names = character(0), class =
structure("signature", package = "methods")))

x = "AffyBatch":
structure(function (x, ...) 
{
    .local <- function (x, which = "both", range = 0, ...) 
    {
        tmp <- description(x)
        if (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, ...)
}, class = structure("MethodDefinition", package = "methods"), target =
structure("AffyBatch", .Names = "x", class = structure("signature",
package = "methods")), defined = structure("AffyBatch", .Names = "x",
class = structure("signature", package = "methods")))

x = "data.frame":
structure(function (x, ...) 
UseMethod("boxplot"), class = structure("derivedDefaultMethod", package
= "methods"), target = structure("data.frame", .Names = "x", class =
structure("signature", package = "methods")), defined = structure("ANY",
.Names = "x", class = structure("signature", package = "methods")))
##:    (inherited from x = "ANY")

Here you can see that the AffyBatch method is getting the main title
from the description slot of the AffyBatch, so if you explicitly set a
main title, there will be two to choose from. 

A simple patch would be to add a main=NULL to the call, and an
if(is.null(main)){ } that encloses the part of the function that sets
the main title.

Note you can also see this function in the source distribution, although
that may take some poking around to find it.

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
>>> "Paul Boutros" <Paul.Boutros at utoronto.ca> 12/27/04 2:20 AM >>>
Hi again,

I've been some troubles setting the title for boxplots of AffyBatch
objects.
The output is below.  I was hoping to suggest a patch but... I actually
couldn't find the source anywhere in my win32 distribution -- only a
compiled DLL and RDA files.  I'm using R 2.0.0 and Affy 1.5.8 on
windows.

Paul

> boxplot(eset, main="test");
Error in title(main = "", main = "test") :
        formal argument "main" matched by multiple actual arguments

> traceback();
9: title(main = "", main = "test")
8: do.call("title", pars[names(pars) %in% c("main", "cex.main",
       "col.main", "sub", "cex.sub", "col.sub", "xlab", "ylab",
       "cex.lab", "col.lab")])
7: bxp(z, width, varwidth = varwidth, notch = notch, log = log,
       border = border, col = col, pars = pars, outline = outline,
       horizontal = horizontal, add = add, at = at)
6: boxplot.default(data.frame(log2(intensity(x)[tmp, ])), main = main,
       range = range, ...)
5: boxplot(data.frame(log2(intensity(x)[tmp, ])), main = main, range =
range,
       ...)
4: boxplot(data.frame(log2(intensity(x)[tmp, ])), main = main, range =
range,
       ...)
3: .local(x, ...)
2: boxplot(eset, main = "test")
1: boxplot(eset, main = "test")

_______________________________________________
Bioconductor mailing list
Bioconductor at stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/bioconductor



**********************************************************
Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues.



More information about the Bioconductor mailing list