Machine Learning-Assisted Gene Set Enrichment Analysis

Research
Introduced by
Subramanian et al. (GSEA foundation, 2005); various ML extensions thereafter
Year
2005 (GSEA); ML integration from ~2015 onward
Type
Computational enrichment analysis with machine learning
Family
Bioinformatics / omics

What does it do?

Machine learning-assisted gene set enrichment analysis (ML-GSEA) extends classical gene set enrichment analysis (GSEA) by using supervised or unsupervised models, such as random forests, neural networks or other deep learning architectures, to help detect, rank and interpret enriched gene sets in high-throughput expression data.

It targets non-linear, multi-pathway relationships that per-gene-set statistics may not capture. Whether it adds value over classical GSEA depends on sample size, phenotype structure and validation.

The intuition behind the method

Classical GSEA asks whether a predefined gene set, such as genes involved in the cell cycle, is overrepresented near the top or bottom of a ranked gene list. It works well for signals that show up as a coherent shift within one set, but biological processes are often intertwined and context-dependent. ML-GSEA adds a model that learns patterns across many gene sets at once. For example, a model might find that several weakly enriched pathways jointly explain a phenotype better than any single pathway does. The result is a pathway-level pattern rather than a set of separate threshold tests.

History

Gene set enrichment analysis was formalised by Subramanian et al. in their 2005 PNAS paper. That paper describes GSEA as a knowledge-based method that scores predefined gene sets in genome-wide expression profiles, using the enrichment score and permutation-based significance testing that classical GSEA still relies on, and it was released as a freely available software package with an initial database of 1,325 gene sets. Machine learning extensions followed as neural networks were applied to biological data. Ma et al. (2018) used deep learning to model the hierarchical structure and function of a cell (DCell), an early example of using known cellular organisation as the architecture of a learned model. Other pathway-informed approaches have since been proposed.

When to use it

Consider ML-GSEA when classical enrichment gives sparse or inconsistent results and the phenotype is complex, for example multi-class or continuous, or when several co-regulated pathways may jointly explain the signal. It needs a reasonably large labelled dataset so that supervised models can be trained and evaluated without overfitting. Do not use it as a drop-in replacement for classical GSEA in small studies, where ML models are likely to overfit and their enrichment scores become unreliable. Avoid it when a transparent, easily audited result is required, for example in regulatory settings; classical GSEA with FDR control is then the more defensible choice.

Limitations and considerations

  • Needs considerably more labelled samples than classical GSEA; with small cohorts the models and their enrichment scores are unreliable.
  • Computationally demanding: training and cross-validating deep models on pathway-structured data requires substantial compute.
  • ML-derived scores are harder to explain and defend than classical enrichment statistics, which limits their use in regulated or mechanistic reporting.
  • Results depend on the pathway database, gene-set size filters and hyperparameters; changing any of these can change which sets are reported.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Captures non-linear and co-enrichment signals across gene sets that classical per-set statistics evaluate one at a time.
  • Accepts multivariate or multi-class phenotype labels, not only two-group comparisons.
  • Feature-importance methods such as SHAP or attention weights can point to the individual genes driving an enriched set.
  • Can in principle combine pathway-level features from other omics layers with expression data.

Applications

  • Identifying dysregulated biological pathways in cancer subtypes from large tumor gene expression datasets (e.g., TCGA).
  • Predicting drug response by learning which pathway combinations are activated in sensitive versus resistant cell lines.
  • Characterizing cell-type-specific pathway activity in single-cell RNA-seq data across developmental trajectories.
  • Discovering disease-relevant pathway signatures in psychiatric, metabolic, or autoimmune genome-wide expression studies.
  • Prioritizing mechanistic hypotheses for experimental follow-up by ranking pathways according to ML importance scores.

How it works

How it works

1

Raw count or intensity data are normalized (e.g., TPM, TMM, or variance-stabilization) and quality-filtered. Batch effects, outlier samples, and missing features are addressed before any enrichment step to prevent technical artefacts from propagating into ML models.

2

Genes are ranked by an association statistic (fold-change, signal-to-noise ratio, or a ML-derived importance score) that reflects their differential behavior between conditions of interest. Unlike classical GSEA, ML-based ranking can incorporate multi-variate phenotype information and interaction effects.

3

An ML model, commonly a gradient-boosted tree, random forest or neural network, is trained on labeled samples to learn which combinations of pathway-level features best discriminate the phenotype. Gene set membership matrices serve as feature encodings. The model assigns importance or activation scores to each gene set, capturing non-linear and co-enrichment signals that classical per-set statistics do not model.

4

Enrichment scores are derived from the ML-ranked gene lists or directly from model-learned gene-set activations. Permutation-based or empirical null distributions are used to compute statistical significance (FDR-corrected p-values), so that model complexity does not by itself inflate false-positive rates. Implementations differ in how they build the score, so the exact model and null procedure should be reported with the results.

5

Enriched gene sets are validated through cross-validation, independent cohort testing, or experimental follow-up. Model selection and hyperparameter tuning should take place inside the cross-validation folds, so that the held-out test folds remain untouched. Interpretability methods (e.g., SHAP values, attention weights) help trace which genes within each set drove the enrichment signal, connecting statistical findings back to mechanistic hypotheses.

Common pitfalls

  • Training and testing on the same cohort without proper cross-validation inflates significance and often fails to replicate. Perform hyperparameter tuning and model selection inside the cross-validation folds, and report performance on a held-out or independent cohort.
  • Set an explicit gene-set size range before analysis and report it, since very small sets are unstable and very large sets dilute the signal in both classical and ML-based enrichment.
  • ML-derived pathway scores and classical FDR-corrected enrichment p-values answer different questions; do not mix them in one table without clear labels.
  • A biased pathway database, for example one dominated by well-studied processes, skews results toward heavily annotated genes whatever model is used.
  • Without an independent cohort or experimental follow-up, ML-GSEA findings are exploratory hypotheses rather than confirmed enrichments.
  • Report the class balance of the phenotype labels. Strongly imbalanced classes can give high overall accuracy while the model learns little about the minority class.

Frequently asked questions

Is ML-GSEA just classical GSEA with a different ranking metric?

Not exactly. Classical GSEA uses a predefined ranking statistic (e.g., signal-to-noise ratio) and a single enrichment score per gene set. ML-GSEA replaces or augments the ranking step with a model that learns from labeled data, and may evaluate combinations of gene sets jointly. The result is a richer but more complex score that captures interactions classical GSEA cannot.

How many samples do I need to use ML-GSEA reliably?

No fixed minimum sample size applies to every study. As a general guide, small cohorts leave supervised models with too few examples per class to learn from, which makes ML-GSEA unreliable; classical GSEA with permutation testing or pre-ranked approaches is then the safer default. Some regularized or transfer-learning variants may tolerate smaller cohorts, but independent validation is still required.

Which tools implement ML-GSEA?

Tool choice varies. Options include deep learning on pathway features, ontology-structured networks such as DCell, and general ML pipelines (for example with scikit-learn or PyTorch) that encode gene sets as features. Check each tool's documentation for its exact model and scoring method. The msigdbr package provides standardized gene set collections that can be used with these approaches.

Can I apply ML-GSEA to single-cell RNA-seq data?

Yes, but sparse single-cell counts usually require preprocessing, such as imputation or aggregation into pseudo-bulk profiles, before ML-based enrichment. Methods designed for the single-cell setting exist, but their choice should be checked against the dataset and validated.

Does ML-GSEA replace classical GSEA?

No. Classical GSEA remains the standard for small studies, regulatory submissions, and situations requiring transparent, well-calibrated FDR statistics. ML-GSEA is complementary: many rigorous analyses run both and use ML results to generate hypotheses that classical statistics then test more formally.

Related methods

Sources

  1. Subramanian, A., Tamayo, P., Mootha, V. K., Mukherjee, S., Ebert, B. L., Gillette, M. A., Paulovich, A., Pomeroy, S. L., Golub, T. R., Lander, E. S., & Mesirov, J. P. (2005). Gene set enrichment analysis: A knowledge-based approach for interpreting genome-wide expression profiles. Proceedings of the National Academy of Sciences, 102(43), 15545–15550.

    Open DOI reference
  2. Ma, J., Yu, M. K., Fong, S., Ono, K., Sage, E., Demchak, B., Sharan, R., & Ideker, T. (2018). Using deep learning to model the hierarchical structure and function of a cell. Nature Methods, 15(4), 290–298.

    Open DOI reference