counts.pca {msmsEDA} | R Documentation |
A summary and different plots are given as a result of principal components analysis of an spectral counts matrix.
counts.pca(msnset, facs = NULL, do.plot = TRUE, snms = NULL, wait = TRUE)
msnset |
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
|
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)
.
Invisibly returns a list with values:
pca |
The return value obtained from |
pc.vars |
The percentage of variability corresponding to each principal component. |
Josep Gregori
data(msms.dataset) msnset <- pp.msms.data(msms.dataset) lst <- counts.pca(msnset) str(lst) print(lst$pc.vars[,1:4])