This function performs principal component analyses (PCA).
perform.PCA(
DEprot.object,
sample.subset = NULL,
which.data = "imputed",
n.PCs = 50,
center.data = TRUE,
scale.data = TRUE
)An object of class DEprot or DEprot.analyses.
String vector indicating the column names (samples) to keep in the counts table (the 'column.id' in the metadata table). Default: NULL (no subsetting).
String indicating which type of counts should be used. One among: 'raw', 'normalized', 'norm', 'randomized', 'random', 'imputed', 'imp'. Default: "imputed".
Integer number indicating the number of PCs to be computed. This is used only when NAs are present in the the data set. Default: 50.
Logical value indicating whether the data should be centered. Default: TRUE.
Logical value indicating whether the data should be scaled. Default: TRUE.
A DEprot.PCA, containing the PC values (PCs) and the importance summary (importance).
The proteins that carry no information for the samples analyzed are excluded from the projection: the
ones quantified in none of the samples (only NAs), and, when scale.data = TRUE, the ones showing
the same value in every sample. A constant protein cannot be rescaled to unit variance and would make
stats::prcomp stop: this happens easily on a subset of samples, for instance after
filter.samples, even when the full dataset was perfectly usable.
pca <- perform.PCA(DEprot.object = DEprot::test.toolbox$dpo.imp)