[BioC] PCA-prcomp() versus plotPCA

James W. MacDonald jmacdon at med.umich.edu
Tue Nov 14 16:27:12 CET 2006


Hi Marco,

marco fabbri wrote:
> Two question on PCA:
> 
> 1. I like plotPCA from affycoretools package, but I was not able to
> plot the third component.
> Am I wrong?

No you are not wrong. By default plotPCA() only does the first two 
principal components. If there is interest I could easily add the 
capability to do the first three PCs and plot using scatterplot3D.

> 
> 2.I try the prcomp() function and  I compared it to plotPCA.
> 
> TesetA=t(exprs(esetA))
> pca=prcomp(TAM,  retx=TRUE,center=TRUE, scale= TRUE)
> plot(pca$x[,1:2])
> --------
> plotPCA(esetA,groups=c(1:10))
> 
> I had different plots.
> Can please help me to understand better what  plotPCA is doing?

plotPCA() is using the default arguments to prcomp(), which includes 
scale.=FALSE. Usually one wants to scale data prior to performing the 
PCA if the data are on different scales. However, most Affy data are 
normalized which should put the data on similar scales, so I just stick 
with the default.


HTH,

Jim


> 
> 
> Thank you
> MArco
> 


-- 
James W. MacDonald, M.S.
Biostatistician
Affymetrix and cDNA Microarray Core
University of Michigan Cancer Center
1500 E. Medical Center Drive
7410 CCGC
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