A MSnSet with spectral counts in the expression matrix.
do.plot
A logical indicating whether to plot the PCA PC1/PC2 map.
facs
NULL or a data frame with factors. See details below.
snms
Character vector with sample short names to be plotted. If NULL then 'Xnn' is plotted where 'nn' is the column number in the datset.
wait
This function may draw different plots, one by given factor in
facs. When in interactive mode the default is to wait for confirmation
before proceeding to the next plot. When wait is FALSE and R in
interactive mode, instructs not to wait for confirmation.
Value
Invisibly returns a list with values:
pca
The return value obtained from prcomp.
pc.vars
The percentage of variability corresponding to each principal component.
Details
The spectral counts matrix is decomposed by means of prcomp.
If do.plot is TRUE, a plot is generated for each factor showing the PC1/PC2 samples map, with samples colored as per factor level. If facs is NULL
then the factors are taken from pData(msnset).