\name{mae.simplePCAanalysis} \alias{mae.simplePCAanalysis} \title{ A function to compute PCA on data and generate plots in a PDF file } \description{It computes PCA on data and generate plots in a PDF file. For using the color based plotting function, the (uniqGroups, group) are required. It creates one PDF file with 7 plots: Variance X Components, three plots: (PC1 vs PC2, PC2 vs PC3, PC1 vs PC3) for "arrays" or "genes", three sorted Loadings plots for PC1, PC2 and PC3. } \usage{ mae.simplePCAanalysis(data, plotFile="simplePCA", mode="arrays", scale.data= TRUE, uniqGroups, group, allowableEigenVectors=6 ) } \arguments{ \item{ sPCA }{The simplePCAanalysis() computed PCA data frame} \item{ data }{ The horizontally stacked array data (genes X array samples) \item{ plotFile }{ The optional name of the PDF file \item{ mode) { Defines how the data is to be analyzed for computing PCA: "arrays" - analyzed by gene components (Gene Principal Components) "genes" - analyzed by array components (Array Principal Components) } \item{ scale.data}{ Apply scaling in prcomp, else do not scale } \item{ uniqGroups}{ The unique condition names } \item{ group}{ The condition names/sample. This vector size = number samples} \item{ allowableEigenVectors}{ The number of allowable EigenVectors (default 6)} } \details{ \code{mae.simplePCAanalysis} { Notes: 1. This routine does the Principal components analysis(mva) for data either [Genes(rows), Arrays(columns)] or vice versa. This makes use of the PCA algorithm in the "mva" package of "R". We use the prcomp as the preferred as the performance is better than the princomp method. The eigen vectors of of the first two components may have a "-1" difference. This does not affect the analysis, it is just the coordinate that will have the shift amongst the two methods. 2. Generation of the detailed information about the PCA including an analysis file with more details, pdf file with the plots File that will contain the 3D data points that can be used by a 3D viewer program. 3. Experimenting with the plotting of the coefficients of the variables across the components. 4. Also added to the code is the sorting of returned eigen vector(loading) values, so that for the first three components we know the effect of the original variable. 5. When the matrix(rows,columns) based on the mode ( genes/arrays) has the the condition of the NumberOfRows < NumberOfColumns, the Eigen values upto NumberOfRows will be non-zero values and the remainder will have zero/singular values. Please read the following reference for more information. Numerical recipes(SVD): http://www.library.cornell.edu/nr/bookcpdf/c2-6.pdf 6. Noticed that the number of printable eigen vectors were restricted to the first 6 but in cases when we have less than 6 we need to handle likewise. 7. This code is also used in the mAdb system (http://nciarray.nci.nih.gov/) from which it has been adapted. } \value{ \item{ pca } {} \item{ eigenVals } {} \item{ eigenVec } {} \item{ points3D } {} \item{ loadings } {} } \references{ } \author{ Shyam Sundaram, Peter Lemkin} \date{ 07/18/2002 } \examples{ ... } \keyword{ }