[BioC] Trouble with maQualityPlots

James W. MacDonald jmacdon at med.umich.edu
Tue Jun 8 15:53:05 CEST 2010

Hi Jason,

First off, you should always cc the package maintainer in case she 
doesn't subscribe to the list, or on the off-chance she misses this 
email (cc'ed now).

Zoller,Jason R wrote:
> Hello,
> I'm new to R and Bioconductor, and I was going through the tutorial in the "Quick start guide for marray".  When I entered the line "> maQualityPlots(mraw)", I got this error message:  "Error in baseViewports() : could not find function "viewport".  My code follows the tutorial, exactly, which is:
>> library(marray)
> Loading required package: limma
>> dir(system.file("swirldata", package = "marray"))
> [1] "fish.gal"        "swirl.1.spot"    "swirl.2.spot"    "swirl.3.spot"  
> [5] "swirl.4.spot"    "SwirlSample.txt"
>> datadir <- system.file("swirldata", package = "marray")
>> swirlTargets <- read.marrayInfo(file.path(datadir, "SwirlSample.txt"))
>> mraw <- read.Spot(targets = swirlTargets, path = datadir)
> Reading ...  C:/PROGRA~1/R/R-211~1.0/library/marray/swirldata/swirl.1.spot
> Reading ...  C:/PROGRA~1/R/R-211~1.0/library/marray/swirldata/swirl.2.spot
> Reading ...  C:/PROGRA~1/R/R-211~1.0/library/marray/swirldata/swirl.3.spot
> Reading ...  C:/PROGRA~1/R/R-211~1.0/library/marray/swirldata/swirl.4.spot
>> galinfo <- read.Galfile("fish.gal", path = datadir)
>> mraw at maLayout <- galinfo$layout
>> mraw at maGnames <- galinfo$gnames
>> library(arrayQuality)
>> maQualityPlots(mraw)
> Error in baseViewports() : could not find function "viewport"

I see two problems here.

1.) The viewport() function isn't being imported to arrayQuality. You 
can get around that by loading the gridBase package yourself.

2.) Somehow the dispatch on plot() is being messed up. If you load 
gridBase and then call maQualityPlots, you will get an error stating that

Error in as.double(y) :
   cannot coerce type 'S4' to vector of type 'double'

However, if you debug(arrayQuality:::qpHexbin), directly load the hexbin 
package, specifically initialize a plotting window using x11(), and then 

gplot.hexbin(bin, xlab="A", ylab="M", main=main, colramp=col, 
colorcut=colorcut,maxcnt=maxcnt, legend=1, lcex=1, newpage=F)


plot(bin, xlab = "A", ylab = "M", main = main, colramp = col,
     colorcut = colorcut, maxcnt = maxcnt, legend = 1, lcex = 1,
     newpage = FALSE)

then you will get the plot you are looking for.



> I am running R 2.11.0, and Bioconductor 2.6.  Please let me know If I need to provide any more information.
> Greatly appreciated,
> Jason Zoller
> UT MD Anderson Cancer Center
> Experimental Therapeutics
> Research Assistant 2
> _______________________________________________
> 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.
Douglas Lab
University of Michigan
Department of Human Genetics
5912 Buhl
1241 E. Catherine St.
Ann Arbor MI 48109-5618
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