GSVA
Dependencies & Environment
Package-intrinsic requirements from the Bioconductor landing page — reproduce in any R environment.
- Version: 2.6.2 · Bioconductor: 3.23 · R: ≥ 4.6
- Imports: BiocGenerics, MatrixGenerics, S4Vectors, S4Arrays, HDF5Array, SparseArray, DelayedArray, IRanges, Biobase, SummarizedExperiment, GSEABase, Matrix, DelayedMatrixStats, BiocParallel, SingleCellExperiment, BiocSingular, SpatialExperiment, sparseMatrixStats, cli, memuse
- Install:
BiocManager::install("GSVA")
When to Use
- Sample-Wise Pathway Scoring: Calculating sample-specific pathway enrichment scores from a gene expression matrix using
gsva. - Dimensionality Reduction: Transforming a high-dimensional gene-by-sample matrix into a lower-dimensional pathway-by-sample matrix for downstream analysis.
- Method-Specific Enrichment: Applying specific single-sample enrichment methods like PLAGE, z-score, or ssGSEA using
plageParam,zscoreParam, orssgseaParam.
When NOT to Use
- For Simple Differential Expression: For simple differential expression of individual genes, use
edgeRbecause it is designed for gene-level count data modeling rather than gene set enrichment. - For Purely Managing Gene Sets: For purely importing and managing gene set collections without analysis, use
GSEABasebecause it provides dedicated classes likeGeneSetCollectionand functions likegetGmt.
Data Requirements
- Expression Matrix: A normalized gene expression matrix, an
ExpressionSet, or aSummarizedExperimentobject. - Gene Sets: A
listobject of gene identifiers or aGeneSetCollectionobject.
Key Parameters
- kcdf ("auto"): Kernel consensus density estimation; use
"Gaussian"for continuous data or"Poisson"for integer counts. - kcdfNoneMinSampleSize (200): Minimum sample size at which the empirical cumulative distribution function is estimated directly without a kernel.
- tau (1): Exponent defining the weight of the tail in the random walk.
- maxDiff (TRUE): Logical flag specifying whether to calculate the enrichment score as the magnitude difference between the largest positive and negative random walk deviations.
- absRanking (FALSE): Logical flag implying whether a modified Kuiper statistic is used.
- sparse (FALSE): Logical flag used when the input expression data is stored in a sparse matrix.
- minSize (1): Minimum size of gene sets to be considered.
- maxSize (Inf): Maximum size of gene sets to be considered.
Best Practices
- Match Identifiers: Ensure gene identifiers between the expression data matrix and the gene sets belong to the same standard nomenclature to allow
mapIdentifiersto work. - Set the Correct Kernel: Use
kcdf="Poisson"when providing RNA-seq integer count data directly togsvaParam. - Import GMTs Safely: Use
readGMTto import gene sets from GMT files, as it handles duplicated gene set names better than base R functions.
Common Pitfalls
- Providing Raw Counts with Gaussian Kernel: Running GSVA on raw RNA-seq counts without changing the kernel. Fix: Set
kcdf="Poisson"ingsvaParamwhen using integer counts. - Identifier Mismatch: Gene identifiers do not match between the expression matrix and gene sets. Fix: Provide data using specialized containers (like
ExpressionSetorSummarizedExperiment) so GSVA can automatically map identifiers. - Duplicated Gene Set Names: Duplicated gene set names in GMT files causing errors with standard import functions. Fix: Use the
readGMTfunction which deduplicates gene set names by default.
Alternatives
GSEABase: For foundational gene set data structures and basic GMT file importing.qusage: Provides alternative functions likeread.gmtfor reading gene sets.edgeR: For gene-level differential expression analysis using log-CPM units.
Citations
- Hänzelmann S, Castelo R, Guinney J. "GSVA: gene set variation analysis for microarray and RNA-seq data." BMC Bioinformatics, 2013.
- Barbie et al. "Systematic RNA interference reveals that oncogenic KRAS-driven cancers require TBK1." Nature, 2009.
References
- Homepage: https://bioconductor.org/packages/GSVA
- Vignette: https://bioconductor.org/packages/release/bioc/vignettes/GSVA/inst/doc/GSVA.html
Run this on BioMate
This skill is the knowledge layer — when, why, and how to use gsva. To run this analysis on your own data with managed compute, automated QC, and reproducible outputs, use BioMate — free to start.