The function performs a weighted principal component analysis (PCA) as suggested by Specht et al. The PCA is performed on the correlation matrix where the rows (features) are weighted according to the sum of the correlation with the other rows.

pcaSCoPE2(object, scale = FALSE, center = FALSE)

Arguments

object

A SingleCellExperiment object

scale

A logical(1) indicating whether the columns of the weighted input matrix should be scaled to unit variance.

center

A logical(1) indicating whether the columns of the weighted input matrix should be mean centered.

Value

An object of class eigen containing the computed eigenvector and eigenvalues.

References

Specht, Harrison, Edward Emmott, Aleksandra A. Petelski, R. Gray Huffman, David H. Perlman, Marco Serra, Peter Kharchenko, Antonius Koller, and Nikolai Slavov. 2021. "Single-Cell Proteomic and Transcriptomic Analysis of Macrophage Heterogeneity Using SCoPE2.” Genome Biology 22 (1): 50. link to article, link to preprint

Examples

data("feat2")
sce <- as(feat2[[3]], "SingleCellExperiment")
pcaSCoPE2(sce)
#> eigen() decomposition
#> $values
#> [1]  4.000000e+00  1.776357e-15 -1.232595e-32 -4.440892e-16
#> 
#> $vectors
#>      [,1]       [,2]          [,3]       [,4]
#> [1,] -0.5  0.8660254  0.000000e+00  0.0000000
#> [2,] -0.5 -0.2886751 -8.756053e-17  0.8164966
#> [3,] -0.5 -0.2886751 -7.071068e-01 -0.4082483
#> [4,] -0.5 -0.2886751  7.071068e-01 -0.4082483
#>