Description Usage Arguments Details Value Author(s) See Also Examples
Performs principal component analysis by spectral decomposition of a covariance or correlation matrix
1 |
sce |
|
do_scaling |
FALSE = covariance matrix, TRUE = correlation matrix |
design |
A numeric matrix describing the factors that should be blocked |
The calculation is done by a spectral decomposition of the
(scaled) covariance matrix of the trajectory features
as defined in the SingleCellExperiment
object.
Features with zero variance get automatically removed.
Please note that this methods only uses the set of defined trajectory
features in a SingleCellExperiment
object; spike-in controls are
ignored and are not listed as trajectory features.
To account for systematic bias in the expression data
(e.g., cell cycle effects), a
design matrix can be provided for the learning process. It should list
the factors that should be blocked and
their values per sample. It is suggested to construct a design matrix with
model.matrix
.
A list
object containing the following components:
|
Principal components |
|
Variance per component |
|
Fraction of variance explained by each component |
|
Loading score for each feature |
Daniel C. Ellwanger
SingleCellExperiment
model.matrix
1 2 3 4 5 6 7 8 9 10 11 12 | # Example data
data(exSCE)
# Principal component analysis
res <- pca(exSCE)
# Find relevant number of principal components
d <- findSpectrum(res$eigenvalues, frac=20)
barplot(res$variance[d] * 100, ylab="Variance (%)",
names.arg=colnames(res$components)[d], las=2)
plot(res$component, xlab="PC1", ylab="PC2")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.