dimensionality-reduction-via-reverse-pca
Summary
Reverse PCA extracts gene (feature) loadings from a normalized expression matrix to reduce dimensionality for downstream pathway analysis in single-cell RNA-seq workflows. Unlike standard PCA which projects cells into reduced space, reverse PCA produces a feature-space embedding suitable for GESECA and other coregulation-based enrichment methods.
When to use
You have a normalized single-cell expression matrix (e.g., after SCTransform) and need to compute gene-level covariance structure for pathway enrichment analysis (e.g., GESECA) rather than cell-level dimensionality reduction. Reverse PCA is specifically indicated when you want to identify pathways whose member genes co-vary together across the normalized feature space.
When NOT to use
- You need to project cells into reduced space for clustering or visualization—use standard PCA (rev.pca=FALSE) instead.
- Input is already a feature loadings matrix or gene-level covariance matrix—reverse PCA will not add value.
- Your analysis goal is cell-type classification or quality control metrics (e.g., nCount, nFeature)—cell-space embeddings are more appropriate.
Inputs
- normalized expression matrix (SCTransform output, [n_genes × n_cells])
- Seurat object with SCTransform-normalized assay
- gene set pathways (MSigDB format, e.g., KEGG_LEGACY)
Outputs
- feature loadings matrix E ([n_genes × n_pcs])
- GESECA enrichment results (pathway scores, p-values, coregulation profiles)
- plotCoregulationProfileReduction visualization (tsne/umap reduction showing pathway scores per cell type)
How to apply
After applying SCTransform normalization with a fixed set of variable features (e.g., variable.features.n=10000), run PCA with rev.pca=TRUE and a moderate number of components (e.g., npcs=50). Extract the feature loadings matrix E from the PCA reduction object (typically obj@reductions$pca.rev@feature.loadings). This matrix has dimensions [n_genes × n_pcs] and encodes how each gene loads onto the principal components. Pass this loadings matrix directly to GESECA with eps=1e-100 (or lower for more precise p-values) to compute pathway enrichment scores based on coregulation patterns in the feature space.
Related tools
- Seurat (SCTransform normalization and PCA computation with rev.pca parameter)
- fgsea (GESECA function accepts feature loadings matrix to compute pathway enrichment and p-values) — https://github.com/ctlab/fgsea
- msigdbr (Retrieve KEGG_LEGACY and other pathway gene sets for input to GESECA)
- ggplot2 (Visualize pathway scores and coregulation profiles via plotCoregulationProfileReduction)
Examples
obj <- SCTransform(obj, verbose = FALSE, variable.features.n = 10000); obj <- RunPCA(obj, assay = "SCT", verbose = FALSE, rev.pca = TRUE, reduction.name = "pca.rev", npcs = 50); E <- obj@reductions$pca.rev@feature.loadings; gesecaRes <- geseca(pathways, E, minSize = 5, maxSize = 500, center = FALSE, eps = 1e-100)
Evaluation signals
- Feature loadings matrix E has correct dimensions [n_genes × n_pcs] with n_pcs ≤ 50 and matches the variable feature set.
- GESECA produces pathway p-values down to the specified eps threshold (e.g., eps=1e-100); p-values should be non-zero and ordered by enrichment strength.
- Top-ranked pathways are biologically coherent with cell type annotations (e.g., KEGG_LEISHMANIA_INFECTION in non-foamy macrophages, KEGG_LYSOSOME in foamy macrophages).
- plotCoregulationProfileReduction plots show clear separation of pathway scores across cell types or clusters, confirming pathway-cell-type association.
- Feature loadings are centered or scaled consistently with the choice of center=FALSE in GESECA call (verify consistency between SCTransform and GESECA parameters).
Limitations
- Reverse PCA assumes linear relationships among genes; highly nonlinear coregulation structures may be missed.
- Results are sensitive to the choice of variable.features.n and npcs; no universal default exists across tissues or conditions.
- GESECA p-value estimation uses Monte-Carlo sampling and remains stochastic; eps parameter trades off precision for computational cost.
- Reverse PCA feature loadings are orthogonal within the PCA space but do not directly represent biological correlation; interpretation requires downstream validation (e.g., co-expression checks).
Evidence
- [methods] Run reverse PCA on SCTransform-normalized matrix: "Run reverse PCA (rev.pca=TRUE) on SCTransform-normalized matrix with npcs=50, extracting feature loadings matrix E."
- [methods] GESECA input and parameter specification: "Run geseca(pathways, E, minSize=5, maxSize=500, center=FALSE, eps=1e-100) on reduced feature space, producing enrichment scores and p-values."
- [methods] Reverse PCA produces feature-space enrichment: "Extract top-ranked pathways and generate plotCoregulationProfileReduction plots (reduction='tsne') to visualize pathway scores by cell type, confirming KEGG_LEISHMANIA_INFECTION prominence in"
- [intro] P-value computation method via Monte-Carlo: "P-value estimation is based on an adaptive multi-level split Monte-Carlo scheme."
1---2name: dimensionality-reduction-via-reverse-pca3description: Use when you have a normalized single-cell expression matrix (e.g., after SCTransform) and need to compute gene-level covariance structure for pathway enrichment analysis (e.g., GESECA) rather than cell-level dimensionality reduction.4license: CC-BY-4.05---67# dimensionality-reduction-via-reverse-pca89## Summary1011Reverse PCA extracts gene (feature) loadings from a normalized expression matrix to reduce dimensionality for downstream pathway analysis in single-cell RNA-seq workflows. Unlike standard PCA which projects cells into reduced space, reverse PCA produces a feature-space embedding suitable for GESECA and other coregulation-based enrichment methods.1213## When to use1415You have a normalized single-cell expression matrix (e.g., after SCTransform) and need to compute gene-level covariance structure for pathway enrichment analysis (e.g., GESECA) rather than cell-level dimensionality reduction. Reverse PCA is specifically indicated when you want to identify pathways whose member genes co-vary together across the normalized feature space.1617## When NOT to use1819- You need to project cells into reduced space for clustering or visualization—use standard PCA (rev.pca=FALSE) instead.20- Input is already a feature loadings matrix or gene-level covariance matrix—reverse PCA will not add value.21- Your analysis goal is cell-type classification or quality control metrics (e.g., nCount, nFeature)—cell-space embeddings are more appropriate.2223## Inputs2425- normalized expression matrix (SCTransform output, [n_genes × n_cells])26- Seurat object with SCTransform-normalized assay27- gene set pathways (MSigDB format, e.g., KEGG_LEGACY)2829## Outputs3031- feature loadings matrix E ([n_genes × n_pcs])32- GESECA enrichment results (pathway scores, p-values, coregulation profiles)33- plotCoregulationProfileReduction visualization (tsne/umap reduction showing pathway scores per cell type)3435## How to apply3637After applying SCTransform normalization with a fixed set of variable features (e.g., variable.features.n=10000), run PCA with rev.pca=TRUE and a moderate number of components (e.g., npcs=50). Extract the feature loadings matrix E from the PCA reduction object (typically obj@reductions$pca.rev@feature.loadings). This matrix has dimensions [n_genes × n_pcs] and encodes how each gene loads onto the principal components. Pass this loadings matrix directly to GESECA with eps=1e-100 (or lower for more precise p-values) to compute pathway enrichment scores based on coregulation patterns in the feature space.3839## Related tools4041- **Seurat** (SCTransform normalization and PCA computation with rev.pca parameter)42- **fgsea** (GESECA function accepts feature loadings matrix to compute pathway enrichment and p-values) — https://github.com/ctlab/fgsea43- **msigdbr** (Retrieve KEGG_LEGACY and other pathway gene sets for input to GESECA)44- **ggplot2** (Visualize pathway scores and coregulation profiles via plotCoregulationProfileReduction)4546## Examples4748```49obj <- SCTransform(obj, verbose = FALSE, variable.features.n = 10000); obj <- RunPCA(obj, assay = "SCT", verbose = FALSE, rev.pca = TRUE, reduction.name = "pca.rev", npcs = 50); E <- obj@reductions$pca.rev@feature.loadings; gesecaRes <- geseca(pathways, E, minSize = 5, maxSize = 500, center = FALSE, eps = 1e-100)50```5152## Evaluation signals5354- Feature loadings matrix E has correct dimensions [n_genes × n_pcs] with n_pcs ≤ 50 and matches the variable feature set.55- GESECA produces pathway p-values down to the specified eps threshold (e.g., eps=1e-100); p-values should be non-zero and ordered by enrichment strength.56- Top-ranked pathways are biologically coherent with cell type annotations (e.g., KEGG_LEISHMANIA_INFECTION in non-foamy macrophages, KEGG_LYSOSOME in foamy macrophages).57- plotCoregulationProfileReduction plots show clear separation of pathway scores across cell types or clusters, confirming pathway-cell-type association.58- Feature loadings are centered or scaled consistently with the choice of center=FALSE in GESECA call (verify consistency between SCTransform and GESECA parameters).5960## Limitations6162- Reverse PCA assumes linear relationships among genes; highly nonlinear coregulation structures may be missed.63- Results are sensitive to the choice of variable.features.n and npcs; no universal default exists across tissues or conditions.64- GESECA p-value estimation uses Monte-Carlo sampling and remains stochastic; eps parameter trades off precision for computational cost.65- Reverse PCA feature loadings are orthogonal within the PCA space but do not directly represent biological correlation; interpretation requires downstream validation (e.g., co-expression checks).6667## Evidence6869- [methods] Run reverse PCA on SCTransform-normalized matrix: "Run reverse PCA (rev.pca=TRUE) on SCTransform-normalized matrix with npcs=50, extracting feature loadings matrix E."70- [methods] GESECA input and parameter specification: "Run geseca(pathways, E, minSize=5, maxSize=500, center=FALSE, eps=1e-100) on reduced feature space, producing enrichment scores and p-values."71- [methods] Reverse PCA produces feature-space enrichment: "Extract top-ranked pathways and generate plotCoregulationProfileReduction plots (reduction='tsne') to visualize pathway scores by cell type, confirming KEGG_LEISHMANIA_INFECTION prominence in"72- [intro] P-value computation method via Monte-Carlo: "P-value estimation is based on an adaptive multi-level split Monte-Carlo scheme."