How to create a PCA plot of microarray data
Go to parent Analyze your own microarray data in R/Bioconductor
The code on this page works for both affy and oligo
PCA performs a transformation of the data into principal components. Principal components (PCs) are linear combinations of probe sets (or genes), ranked in such a way that the first PC is the linear combination of probe sets that captures the direction of the largest variation in the data set. The second PC captures the second largest variation in the data set and so on…
The first PC is an axis in space, so you can project each sample on this axis and the variance between the projected samples will be the highest among all possible choices of first axis. The second PC is another axis in space, perpendicular to the first. Projecting the samples on these two axes generates the plot that you see below in which the variation between the samples is as large as possible.
How to create a PCA plot ? |
---|
To create a PCA plot you can use the prcomp() method. Input is the matrix containing the normalized expression levels obtained by applying the exprs() method on data.rma. So for an experiment of 3 groups of 3 samples:
color=c('green','green','green','red','red','red','blue','blue','blue') data.PC = prcomp(t(data.matrix),scale.=TRUE) plot(data.PC$x[1:2],col=color) |
When you have groups in your data this should lead to a clear distinction between the groups.
Extra information:
Clear explanation of PCA