pamr / R graphics recording
2
0
Entering edit mode
@katleen-de-preter-1070
Last seen 8.8 years ago
Belgium
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??? > 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' > 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 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) pamr.confusion(mData.results, threshold=4.0) pamr.plotcvprob(mData.results, mData.data, threshold=4.0) 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 -- No virus found in this outgoing message. Checked by AVG Anti-Virus.
pamr pamr • 1.5k views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 11 hours ago
United States
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.
ADD COMMENT
0
Entering edit mode
Min-Han Tan ▴ 40
@min-han-tan-1063
Last seen 9.6 years ago
Hi Katleen, I think I know why. You have to specify values for geneids and genenames in your initial train.data, otherwise you get the error message you reported for both pamr.plotcen and pamr.listgenes. See following output as illustration: > train.data<-list(x=exprData.clean,y=dx) > pam.trained<-pamr.train(train.data) 123456789101112131415161718192021222324252627282930 > pamr.plotcen(pam.trained,train.data,threshold=5) Error in text(xy.coords(x, y, recycle = TRUE), labels, adj, pos, offset, : zero length 'labels' train.data<-list(x=exprData.clean,y=dx,geneids=rownames(exprData.clean ),genenames=rownames(exprData.clean)) > pam.trained<-pamr.train(train.data) 123456789101112131415161718192021222324252627282930 > pamr.plotcen(pam.trained,train.data,threshold=5) NULL Regards, Min-Han Tan Van Andel Institute On Sat, 15 Jan 2005 18:33:39 +0100, Katleen De Preter <katleen.depreter@ugent.be> 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??? > > > 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' > > > 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 > > 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) > pamr.confusion(mData.results, threshold=4.0) > pamr.plotcvprob(mData.results, mData.data, threshold=4.0) > 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 > > -- > No virus found in this outgoing message. > Checked by AVG Anti-Virus. > > _______________________________________________ > Bioconductor mailing list > Bioconductor@stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor >
ADD COMMENT

Login before adding your answer.

Traffic: 653 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6