[BioC] pamr / R graphics recording

James W. MacDonald jmacdon at med.umich.edu
Sun Jan 16 15:47:11 CET 2005


Katleen De Preter wrote:
> Hello,
> 
> I'm trying to use the pamr package on Affymetrix RMA normalised data. 
> Pamr.train-function works on the data. However, I got following errors 
> with pamr.plotcen and pamr.listgenes. Do anyone know what may be the 
> problem?
> And another (R-related) question: how can I automatically (before 
> starting a script) record all generated graphes???

By record do you mean 'save to disk' or do you mean 'record to the 
history buffer so I can scroll between them'?

If you want to save them to disk, there are at least two ways to do 
this. You can use either win.metafile() or pdf() to save the files as 
either .wmf or .pdf files.

pdf(onefile=FALSE)
[plot stuff]
dev.off()

This will result in several plots being dumped into your current 
directory. You may be able to pass a vector of names to this function also.

Another way would be to use savePlot(). See below.

If you want to simply record the plots so you can cycle through them, 
simply do:

x11()

and then go to History/Recording in the GUI menu. You can then cycle 
through your plots using the Page Up/ Page Down keys.
> 
>  > pamr.plotcen(mData.train, mData.data, threshold=4.0)
> Error in text(xy.coords(x, y, recycle = TRUE), labels, adj, pos, offset,  :
>        zero length 'labels'

I don't see anything in the current version of pamr that would cause 
this. What version are you using? You might want to update to 1.22.

> 
>  > pamr.listgenes(mData.train, mData.data, threshold=4.0)
> Error in pamr.listgenes(mData.train, mData.data, threshold = 4) :
>        length of dimnames [2] not equal to array extent

You need to give more help here. Try running traceback() after the error 
to see where the error occured.


> 
> used R-SCRIPT:
> library(pamr)
> library(affy)
> load("C:/Documents and Settings/Katleen/Mijn documenten/WERK/Analyse 
> affymetrix/analyse ALLE CEL FILES/R/nbNBdata.RData")
> NBselect<-nbNBdata[,nbNBdata$classnameb%in%c("NB1","NB2B","NB2A")]
> classname <- pData(phenoData(NBselect))$classnameb
> mData.data <- pamr.knnimpute(list(x = exprs(NBselect), y = classname))
> mData.train <- pamr.train(mData.data)
> mData.results<- pamr.cv(mData.train, mData.data)
> pamr.plotcv(mData.results)
savePlot("CV Plot", "wmf") ## see ?savePlot for the available formats 
for the saved plot
> pamr.confusion(mData.results, threshold=4.0)
savePlot("Confusion", "wmf")
> pamr.plotcvprob(mData.results, mData.data, threshold=4.0)
savePlot("blahblah", "pdf") ## you get the point
> pamr.plotcen(mData.train, mData.data, threshold=4.0)
> pamr.geneplot(mData.train, mData.data, threshold=5.3)
> pamr.listgenes(mData.train, mData.data, threshold=4.0)
> 
> Best regards,
> 
> Katleen
> 
> 


-- 
James W. MacDonald
University of Michigan
Affymetrix and cDNA Microarray Core
1500 E Medical Center Drive
Ann Arbor MI 48109
734-647-5623



**********************************************************
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