Single-sample GSEA (ssGSEA) is a rank-based, non-parametric method that projects a single gene expression profile onto a space of gene set enrichment scores, producing a pathway activity score for each individual sample without requiring a comparative phenotype. Unlike canonical GSEA, which computes an enrichment score relative to a two-class phenotype contrast, ssGSEA computes a separate enrichment score (ES) for each sample–gene set pair by ordering genes by absolute expression within that sample and evaluating the empirical cumulative distribution functions of the genes in the set versus those outside it.
Glossary
Single-Sample GSEA (ssGSEA)

What is Single-Sample GSEA (ssGSEA)?
An extension of Gene Set Enrichment Analysis that calculates separate enrichment scores for each pairing of a sample and gene set, enabling pathway activity inference for individual samples.
The algorithm generates a normalized enrichment score per sample, enabling downstream analyses such as clustering, survival modeling, or differential pathway activity comparisons across heterogeneous cohorts. By decoupling enrichment from group-level contrasts, ssGSEA is particularly suited for patient stratification, single-cell transcriptomics, and studies where biological variation within a condition is the primary object of investigation rather than a nuisance variable.
Key Features of ssGSEA
Single-Sample GSEA (ssGSEA) extends traditional GSEA by calculating independent enrichment scores for each sample-gene set pair, enabling pathway activity inference without requiring defined phenotypic groups.
Sample-Wise Normalization
ssGSEA ranks genes within a single sample by absolute expression and compares the empirical cumulative distribution functions (ECDFs) of genes inside and outside the gene set. This produces a Normalized Enrichment Score (NES) per sample, independent of other samples in the cohort. Unlike traditional GSEA, which requires phenotype labels to rank genes by differential expression, ssGSEA uses the sample's own expression profile as the ranking metric.
- Input: A single sample's expression vector and a gene set
- Output: One enrichment score per sample-gene set pair
- Key distinction: No phenotype permutation required; null distributions are built from gene-level randomization
Rank-Based ECDF Calculation
The core algorithm walks down a gene list ranked by expression values within a single sample. It computes two empirical cumulative distribution functions: one for genes in the target gene set and one for genes outside it. The enrichment score is the sum of differences between these ECDFs, weighted by the rank position.
- Genes are ranked from highest to lowest expression
- A running sum statistic increases when encountering a gene set member and decreases for non-members
- The maximum deviation from zero becomes the raw enrichment score
- This approach captures coordinated upregulation or downregulation of pathway members within a single sample
Phenotype-Free Analysis
ssGSEA eliminates the requirement for predefined class labels (e.g., tumor vs. normal). This makes it ideal for exploratory analyses where phenotypes are unknown, heterogeneous, or continuous. Each sample becomes its own analytical unit, enabling pathway-level comparisons across large cohorts without binary grouping.
- Use cases: Tumor subtype discovery, drug response prediction, single-cell pathway analysis
- Advantage: Detects pathway activity gradients rather than just on/off states
- Integration: Resulting sample-by-pathway matrices can feed into clustering algorithms or machine learning classifiers
Gene Set Variation Analysis (GSVA) Comparison
ssGSEA and GSVA are both single-sample methods but differ in their statistical frameworks. ssGSEA uses a rank-based ECDF approach, while GSVA employs a non-parametric kernel estimation of the cumulative density function. GSVA applies a Kolmogorov-Smirnov-like random walk, whereas ssGSEA uses a weighted running sum.
- ssGSEA: Weighted ECDF difference, sensitive to the extremes of the ranked list
- GSVA: Kernel-smoothed CDF estimation, more robust to outliers
- Both produce: Sample-level pathway enrichment scores suitable for downstream modeling
- Selection criteria: ssGSEA for detecting strong pathway activation; GSVA for noisy or sparse data
Downstream Machine Learning Integration
The sample-by-pathway matrix generated by ssGSEA serves as a feature matrix for predictive modeling. Each column represents a biological pathway, and each row represents a sample. This transforms high-dimensional gene expression data (~20,000 genes) into a biologically interpretable feature space (~50–5,000 pathways).
- Classification: Train models to predict drug response or disease subtype using pathway scores as features
- Clustering: Apply hierarchical clustering or t-SNE to pathway enrichment profiles for patient stratification
- Survival analysis: Use pathway scores as continuous covariates in Cox proportional hazards models
- Biomarker discovery: Identify pathways whose ssGSEA scores significantly differ between outcome groups
Leading-Edge Analysis per Sample
ssGSEA identifies the leading-edge subset—the core genes driving the enrichment signal—within each individual sample. This reveals which specific pathway members are most responsible for the observed activity, enabling fine-grained mechanistic interpretation. Unlike traditional GSEA where the leading edge is defined across a phenotype contrast, ssGSEA pinpoints sample-specific pathway drivers.
- Output: A binary mask indicating which genes in the set contribute to the maximum enrichment score
- Application: Identifying patient-specific therapeutic targets within activated oncogenic pathways
- Visualization: Heatmaps of leading-edge membership across samples reveal heterogeneity in pathway utilization
ssGSEA vs. Traditional GSEA vs. GSVA
Comparison of enrichment analysis methodologies for gene set activity inference
| Feature | ssGSEA | Traditional GSEA | GSVA |
|---|---|---|---|
Sample resolution | Single-sample | Group comparison | Single-sample |
Requires phenotype labels | |||
Output per sample | Enrichment score per sample-gene set pair | Enrichment score per phenotype contrast | Enrichment score per sample-gene set pair |
Ranking method | Empirical CDF of gene expression within sample | Signal-to-noise ratio across phenotype groups | Kernel estimation of CDF across samples |
Null distribution estimation | Gene set permutation | Phenotype permutation | Gene set permutation |
Handles small sample sizes | |||
Suitable for unsupervised analysis | |||
Computational complexity | O(n × m × k) | O(n × m) | O(n × m × k) |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Frequently Asked Questions
Clear, technically precise answers to the most common questions about the ssGSEA algorithm, its interpretation, and its application in precision medicine.
Single-sample Gene Set Enrichment Analysis (ssGSEA) is a projection-based extension of the original GSEA algorithm that calculates a separate enrichment score for each individual sample-gene set pairing, rather than requiring a comparison between two distinct biological phenotypes. While standard GSEA ranks genes by a differential expression metric (e.g., signal-to-noise ratio) derived from a class comparison and produces a single enrichment result per gene set for the entire experiment, ssGSEA ranks genes within a single sample based on their absolute expression values. This fundamental difference enables pathway activity inference on a per-sample basis, making it suitable for unsupervised analyses, patient stratification, and correlating pathway activity with clinical outcomes without pre-defined group labels. The method treats each sample as an independent observation, generating a matrix of enrichment scores (samples × gene sets) that can be directly used as input for machine learning classifiers or survival models.
Related Terms
Single-Sample GSEA exists within a broader computational framework for interpreting transcriptomic data. These related concepts define the statistical foundations, alternative methodologies, and visualization techniques essential for robust pathway inference.
Gene Set Enrichment Analysis (GSEA)
The foundational method from which ssGSEA was derived. Unlike the single-sample variant, classical GSEA requires a phenotype-defined contrast between two biological states (e.g., tumor vs. normal). It computes an Enrichment Score (ES) by walking down a gene list ranked by differential expression, detecting whether a priori defined gene sets cluster at the extremes. The significance is assessed via phenotype permutation, preserving gene-gene correlations within the dataset.
Enrichment Score (ES) Normalization
ssGSEA produces raw Enrichment Scores that are not directly comparable across gene sets of different sizes. The Normalized Enrichment Score (NES) corrects for this by accounting for gene set size and the correlation structure of the dataset. In ssGSEA, normalization is achieved by dividing the raw ES by the range of scores obtained from gene-level permutation, producing a score bounded between -1 and 1 that represents the degree of absolute enrichment.
Leading-Edge Subset Analysis
Within an ssGSEA result, the leading-edge subset identifies the core genes driving the enrichment signal. These are the genes that appear at the extreme ends of the ranked expression profile and contribute most to the running sum statistic. For single-sample interpretation, the leading edge reveals which specific members of a pathway are most activated or suppressed in that individual, enabling mechanistic hypothesis generation about the molecular drivers of a patient's disease state.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us