screeplot in package pcaMethods fails
0
Entering edit mode
Yury Bukhman • 20
@yury-bukhman-3186
Last seen 4.3 years ago
Hi, I have created a pcaRes object using pcaMethods. slplot works OK, but screeplot fails with this error: R> screeplot(kubo1.pca) Error in x$sdev : $ operator not defined for this S4 class More info below. R> class(kubo1.pca) [1] "pcaRes" attr(,"package") [1] "pcaMethods" R> print(kubo1.pca) svd calculated PCA Importance of component(s): PC1 PC2 PC3 PC4 R2 0.4585 0.2713 0.1381 0.04216 Cumulative R2 0.4585 0.7299 0.8680 0.91014 11405 Variables 12 Samples 0 NA's 4 Calculated component(s) Data was mean centered before running PCA Scores structure: [1] 12 4 Loadings structure: [1] 11405 4 R> sessionInfo() R version 2.8.0 (2008-10-20) x86_64-redhat-linux-gnu locale: LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8; LC_COLLATE=en_US.UTF-8;LC_MONETARY=en_US.UTF-8; LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8; LC_NAME=en_US.UTF-8;LC_ADDRESS=en_US.UTF-8; LC_TELEPHONE=en_US.UTF-8;LC_MEASUREMENT=en_US.UTF-8; LC_IDENTIFICATION=en_US.UTF-8 attached base packages: [1] splines tools stats graphics grDevices utils datasets [8] methods base other attached packages: [1] simpleaffy_2.16.1 genefilter_1.20.1 survival_2.34-1 [4] pcaMethods_1.18.0 pls_2.1-0 MASS_7.2-44 [7] affyPLM_1.16.0 gcrma_2.12.1 matchprobes_1.14.0 [10] affy_1.18.2 preprocessCore_1.2.1 affyio_1.8.1 [13] Biobase_2.0.1 rkward_0.4.9 loaded via a namespace (and not attached): [1] annotate_1.18.0 AnnotationDbi_1.4.2 DBI_0.2-4 [4] grid_2.8.0 lattice_0.17-15 latticeExtra_0.5-4 [7] RSQLite_0.7-0 Thanks. Yury
pcaMethods pcaMethods • 971 views
ADD COMMENTlink
0
Entering edit mode
@wolfgang-huber-3550
Last seen 11 days ago
EMBL European Molecular Biology Laborat…
Hi Yury, thank you. As far as I can tell, no "screeplot" method is defined by the pcaMethods package, so you would be falling back on stats:::screeplot.default, whose implementation indeed asks for x$sdev and probably is what throws the error that you report (remember next time to add the output of "traceback()" to your error message). Perhaps the pcaMethods package documentation could be clarified regarding the existence and/or usage of a "screeplot" method. (Typing "class ? pcaRes" currently tells you that such a method exists.) Best wishes Wolfgang ---------------------------------------------------- Wolfgang Huber, EMBL-EBI, http://www.ebi.ac.uk/huber Yury Bukhman ha scritto: > Hi, > > I have created a pcaRes object using pcaMethods. slplot works OK, but > screeplot fails with this error: > > R> screeplot(kubo1.pca) > Error in x$sdev : $ operator not defined for this S4 class > > More info below. > > R> class(kubo1.pca) > [1] "pcaRes" > attr(,"package") > [1] "pcaMethods" > > R> print(kubo1.pca) > svd calculated PCA > Importance of component(s): > PC1 PC2 PC3 PC4 > R2 0.4585 0.2713 0.1381 0.04216 > Cumulative R2 0.4585 0.7299 0.8680 0.91014 > 11405 Variables > 12 Samples > 0 NA's > 4 Calculated component(s) > Data was mean centered before running PCA > Scores structure: > [1] 12 4 > Loadings structure: > [1] 11405 4 > > R> sessionInfo() > R version 2.8.0 (2008-10-20) > x86_64-redhat-linux-gnu > > locale: > LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8; > LC_COLLATE=en_US.UTF-8;LC_MONETARY=en_US.UTF-8; > LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8; > LC_NAME=en_US.UTF-8;LC_ADDRESS=en_US.UTF-8; > LC_TELEPHONE=en_US.UTF-8;LC_MEASUREMENT=en_US.UTF-8; > LC_IDENTIFICATION=en_US.UTF-8 > > attached base packages: > [1] splines tools stats graphics grDevices utils datasets > [8] methods base > > other attached packages: > [1] simpleaffy_2.16.1 genefilter_1.20.1 survival_2.34-1 > [4] pcaMethods_1.18.0 pls_2.1-0 MASS_7.2-44 > [7] affyPLM_1.16.0 gcrma_2.12.1 matchprobes_1.14.0 > [10] affy_1.18.2 preprocessCore_1.2.1 affyio_1.8.1 > [13] Biobase_2.0.1 rkward_0.4.9 > > loaded via a namespace (and not attached): > [1] annotate_1.18.0 AnnotationDbi_1.4.2 DBI_0.2-4 > [4] grid_2.8.0 lattice_0.17-15 latticeExtra_0.5-4 > [7] RSQLite_0.7-0 > > Thanks. > > Yury
ADD COMMENTlink
0
Entering edit mode
Yes, I guess you're expected to use the following instead pcaMethods::plotR2 On Dec 12, 2008, at 0:41 , Wolfgang Huber wrote: > > Hi Yury, > > thank you. As far as I can tell, no "screeplot" method is defined > by the pcaMethods package, so you would be falling back on > stats:::screeplot.default, whose implementation indeed asks for x > $sdev and probably is what throws the error that you report > (remember next time to add the output of "traceback()" to your > error message). > > Perhaps the pcaMethods package documentation could be clarified > regarding the existence and/or usage of a "screeplot" method. > (Typing "class ? pcaRes" currently tells you that such a method > exists.) > > Best wishes > Wolfgang > > ---------------------------------------------------- > Wolfgang Huber, EMBL-EBI, http://www.ebi.ac.uk/huber > > > Yury Bukhman ha scritto: >> Hi, I have created a pcaRes object using pcaMethods. slplot >> works OK, but screeplot fails with this error: >> R> screeplot(kubo1.pca) >> Error in x$sdev : $ operator not defined for this S4 class >> More info below. >> R> class(kubo1.pca) >> [1] "pcaRes" >> attr(,"package") >> [1] "pcaMethods" >> R> print(kubo1.pca) >> svd calculated PCA >> Importance of component(s): >> PC1 PC2 PC3 PC4 >> R2 0.4585 0.2713 0.1381 0.04216 >> Cumulative R2 0.4585 0.7299 0.8680 0.91014 >> 11405 Variables >> 12 Samples >> 0 NA's >> 4 Calculated component(s) >> Data was mean centered before running PCA Scores structure: >> [1] 12 4 >> Loadings structure: >> [1] 11405 4 >> R> sessionInfo() >> R version 2.8.0 (2008-10-20) x86_64-redhat-linux-gnu locale: >> LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8; >> LC_COLLATE=en_US.UTF-8;LC_MONETARY=en_US.UTF-8; >> LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8; >> LC_NAME=en_US.UTF-8;LC_ADDRESS=en_US.UTF-8; >> LC_TELEPHONE=en_US.UTF-8;LC_MEASUREMENT=en_US.UTF-8; >> LC_IDENTIFICATION=en_US.UTF-8 >> attached base packages: >> [1] splines tools stats graphics grDevices utils >> datasets [8] methods base other attached packages: >> [1] simpleaffy_2.16.1 genefilter_1.20.1 >> survival_2.34-1 [4] pcaMethods_1.18.0 pls_2.1-0 >> MASS_7.2-44 [7] affyPLM_1.16.0 gcrma_2.12.1 >> matchprobes_1.14.0 [10] affy_1.18.2 preprocessCore_1.2.1 >> affyio_1.8.1 [13] Biobase_2.0.1 rkward_0.4.9 >> loaded via a namespace (and not attached): >> [1] annotate_1.18.0 AnnotationDbi_1.4.2 DBI_0.2-4 [4] >> grid_2.8.0 lattice_0.17-15 latticeExtra_0.5-4 [7] >> RSQLite_0.7-0 Thanks. >> Yury > > _______________________________________________ > 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
ADD REPLYlink

Login before adding your answer.

Similar Posts
Loading Similar Posts
Traffic: 196 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.4