[BioC] how to use principal component analysis in R

James MacDonald jmacdon at med.umich.edu
Sun Jun 19 02:21:43 CEST 2005

Hi Weinong,

I would recommend using prcomp() for this. My general paradigm is as

pca <- prcomp(t(gene_matrix))


1.) In general, matrices of gene data are usually samples in columns and
genes in rows, which is the transpose of what prcomp() expects, so you
have to use t().

2.) Usually when I plot the results, I also use pch, col, xlab, ylab,
main, etc. to make the plotting symbols for each group different shapes
and colors, add reasonable axis labels, a main title, etc. See ?par for
other variables you can pass to plot.

3.) It is nice to follow up with legend() to add a nice legend to the
plot. People seem to like that stuff ;-D.

4.) The general recommendation is to set scale. = TRUE in the call to
prcomp. I'm not sure if it will make much difference with microarray
data because it is usually normalized anyway, so I usually don't bother.
However, it is worth a try.



James W. MacDonald
Affymetrix and cDNA Microarray Core
University of Michigan Cancer Center
1500 E. Medical Center Drive
7410 CCGC
Ann Arbor MI 48109
>>> weinong han <hanweinong at yahoo.com> 06/18/05 2:10 AM >>>
Dear All,
Wish you have a nice weekend.
I want to run the two-dimensional principal-components analysis of
patient group using 174-gene signature  set  from Welch-T test to
separate the patient group, at the same time, I want to the plots of PCA
Anyone tried or not? please tell me the functions and scripts.
Any advice and suggestions will be much appreciated.
Thanks in advance.

Best Regards
Han Weinong  
hanweinong at yahoo.com


 Rekindle the Rivalries. Sign up for Fantasy Football
	[[alternative HTML version deleted]]

Bioconductor mailing list
Bioconductor at stat.math.ethz.ch

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