- Introduced by
- Multiple groups; early integration of ML with PEA circa 2010s (e.g., Ma'ayan Lab, Greene Lab)
- Year
- 2010s–present
- Type
- Computational pipeline combining statistical enrichment with machine learning
- Family
- Bioinformatics / omics
What does it do?
Machine learning-assisted pathway enrichment analysis combines classical pathway enrichment tests, such as over-representation analysis (ORA) or gene set enrichment analysis (GSEA), with a machine learning model that produces the gene ranking or feature weights those tests use.
The aim is to let the structure of the data, including interactions among genes and multiple cohorts or omics layers, influence which genes are prioritised, rather than relying only on a per-gene statistic from a single contrast. It is a multi-step pipeline rather than a single algorithm, so its output depends on how each step is configured.
The intuition behind the method
Conventional pathway enrichment asks whether genes from a known pathway are overrepresented in a list of differentially expressed genes, or near the top of a ranked list. This works well for clean two-group comparisons. In large, noisy, multi-cohort or multi-omics datasets, a per-gene statistic can miss joint patterns and the resulting hit lists can be long and redundant. A machine learning layer, such as a regularised regression that ranks genes by coefficient size or a random forest that ranks them by importance, lets the gene ranking reflect the joint structure of the data. The enrichment step then translates that ranking back into pathway-level terms that a biologist can interpret.
History
Over-representation analysis, which tests pathway membership with Fisher's exact test, and gene set enrichment analysis, which scores running sums along a ranked gene list, are established approaches to pathway enrichment. Several pipelines now use machine learning to rank or embed genes before enrichment. Enrichr (Chen et al., 2013) is a widely used interactive gene list enrichment tool rather than a machine learning pipeline. Way and Greene (2018) used variational autoencoders to learn a biologically relevant latent space from cancer transcriptomes, an example of the learned representations that some pipelines use. The combined approach has developed across several research groups, and no single first report is established.
When to use it
Consider this approach when conventional enrichment returns long or highly redundant gene-set lists, when the data have several cohorts or omics layers, and when the sample size is large enough to train and cross-validate a model stably. Sample size is the binding constraint: with very small numbers of samples per class, the model ranking is unstable and the enrichment results will not be reliable, and conventional differential expression followed by ORA or GSEA is then the more defensible choice. A practical stability check is to repeat the cross-validation or bootstrap resampling several times, record the top-ranked genes and pathways in each run, and compare their overlap; low overlap is a reason to fall back to the conventional route. Do not use it for a simple two-group comparison on clean data, where the added model gives little gain and reduces transparency. It is most useful when the goal includes both pathway discovery and building a predictive classifier.
Limitations and considerations
- The model ranking is only as stable as the training sample. With few samples per class, importance scores vary between resamples and the downstream enrichment inherits that variability.
- Several analyst choices (model family, hyperparameters, enrichment statistic, gene-set database) each change the output, so cross-validation and sensitivity analysis across these choices are required.
- Results are harder to reproduce and explain than those from a single enrichment test, which raises the bar for clinical translation.
- Pathway databases are incomplete and biased toward well-studied processes. The ML layer does not correct this bias, because the gene rankings it produces are constrained by the same annotations.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Model-based importance can, in principle, reflect interactions and non-linear effects among genes that a per-gene test on a single contrast does not represent, provided the model is flexible enough and the sample size supports it.
- Weights learned jointly across samples can reduce reliance on a single fold-change or p-value cutoff when ranking genes for enrichment.
- Pathway discovery and phenotype prediction can be carried out in one workflow, which suits biomarker studies.
- Several feature types can be combined in one model, although the choices made to integrate them then need to be justified.
- Regularised models can shrink the weights of uninformative or noisy features, which may limit the influence of technical noise, provided the regularisation strength is tuned by cross-validation.
Applications
- Identifying dysregulated metabolic and signaling pathways in cancer subtypes from bulk RNA-seq and proteomics data.
- Stratifying patients into treatment-response groups by combining pathway enrichment scores with clinical ML classifiers.
- Multi-omics integration studies linking transcriptomic, epigenomic, and metabolomic pathway activity in complex diseases.
- Drug mechanism-of-action studies where ML-ranked gene signatures are mapped to pharmacological pathways.
- Biomarker discovery pipelines in precision medicine that require both interpretable pathway context and predictive model output.
- Single-cell transcriptomics analyses where ML embedding precedes cell-type-specific pathway enrichment.
How it works
How it works
Raw omics data (RNA-seq counts, protein abundances or metabolite levels) are quality-controlled, normalised and, where needed, batch-corrected. Samples are annotated with phenotype labels such as case or control, or treatment and time point. Feature identifiers are mapped to a reference annotation so that they match the gene identifiers used by pathway databases such as KEGG, Reactome or Gene Ontology.
A machine learning model, commonly a regularised linear model (LASSO or ElasticNet), a random forest or a gradient boosting classifier, is trained on the normalised matrix to predict the phenotype. Regression coefficients or feature importance scores from the model are used to rank genes by their contribution to separating phenotypes. This ranking takes the place of, or supplements, the fold-change or t-statistic used in conventional differential expression. Cross-validation is needed here, because the ranking is only as reliable as the model that produced it. Correlated genes tend to share or split importance, so the ranking can change depending on which member of a correlated set the model retains; a stability analysis should accompany the ranking.
The model-derived gene ranking is passed to an enrichment algorithm. Some implementations apply GSEA-style running-sum statistics to the ranked list. Others use the model's importance or probability values as gene-level weights in a weighted over-representation test. Each pathway in the chosen database receives an enrichment score and an adjusted p-value, for example after false discovery rate correction.
In more advanced designs, pathway-level enrichment scores become the features of a second model that classifies samples or predicts an outcome. This two-level design supports the discovery of predictive pathways and the construction of a classifier whose inputs can be read in biological terms. It is most often used for biomarker discovery and patient stratification in clinical omics studies, where the classifier must be validated on samples that were held out from both steps.
Top-ranked pathways are displayed as enrichment maps, network diagrams or heatmaps. Overlapping gene sets are clustered so that near-duplicate pathways are not reported as independent findings. Driver genes shared across the leading pathways are identified and checked against the literature and external resources for biological plausibility. Classifier performance metrics such as AUC and accuracy are reported alongside the enrichment statistics, so that the reader can judge both the pathway findings and the predictive model.
Common pitfalls
- Skipping cross-validation for the ML step. Without held-out validation, feature importances reflect noise in the training set, and the enrichment is then built on a spurious gene ranking.
- Using the same samples for model training and for enrichment scoring without proper separation. This inflates enrichment statistics and produces false positives.
- Ignoring pathway redundancy. Large gene-set collections contain many overlapping pathways; without clustering or redundancy reduction, the top hits can be essentially the same gene set under different names.
- Treating model importance scores as biological ground truth without mechanistic validation. This leads to over-interpretation of computationally ranked pathways.
- Ignoring correlated features. Correlated genes share or split model importance, so a pathway may appear or disappear depending on which member of a correlated set the model retains. Check the ranking with correlated-feature filtering or a stability analysis before interpreting pathway hits.
Frequently asked questions
How is this different from standard GSEA?
Standard GSEA ranks genes by a single metric, such as the signal-to-noise ratio between two groups, and tests whether pathway gene sets are overrepresented at the top or bottom of that ranking. ML-assisted pathway enrichment replaces or augments that single metric with importance scores from a model trained across many samples and possibly several omics layers, which can be more informative in multi-group, complex or multi-omics settings. The enrichment scoring step may still use a GSEA-style algorithm; the ML component mainly changes the gene ranking that feeds into it.
What minimum sample size is needed for the ML step to be trustworthy?
There is no fixed threshold. What matters is the number of samples per class relative to the number of candidate features, and whether cross-validated importance scores are stable across resamples. A practical check is to repeat cross-validation or bootstrap resampling several times, record the top-k genes and top pathways in each run, and compare their overlap across runs. The value of k and the overlap level that is considered acceptable are analyst choices and should be reported. When overlap is low, the enrichment ranking is not reproducible, and conventional differential expression followed by ORA or GSEA is the safer choice.
Which ML algorithms are most commonly used?
LASSO and ElasticNet regularised regression are popular because they perform feature selection automatically and their coefficients are comparatively easy to inspect. Random forests and gradient boosting (for example XGBoost or LightGBM) provide non-linear importance scores. Variational autoencoders and other deep learning embeddings can learn latent representations of transcriptomic data, as Way and Greene (2018) showed for cancer transcriptomes. The choice depends on sample size, data dimensionality, and whether interpretability or predictive accuracy is the primary goal.
Can I apply this to single-cell RNA-seq data?
Yes, but the ML step is typically applied at the cell-type or pseudo-bulk level rather than to individual cells, because single-cell profiles are sparse and noisy. One possible workflow clusters cells first, creates pseudo-bulk profiles per cluster and sample, trains the model on those profiles, and then performs enrichment on the resulting gene rankings for each cluster.
What databases should I use for the enrichment step?
KEGG, Reactome and Gene Ontology Biological Process are widely used collections. MSigDB (Molecular Signatures Database) aggregates several curated gene-set collections and is often paired with GSEA. Because results can depend on the collection chosen, run the enrichment against more than one database and compare the findings; a pathway that appears in only one collection should be interpreted with caution.
Related methods
Sources
Chen, E. Y., Tan, C. M., Kou, Y., Duan, Q., Wang, Z., Meirelles, G. V., Clark, N. R., & Ma'ayan, A. (2013). Enrichr: interactive and collaborative HTML5 gene list enrichment analysis tool. BMC Bioinformatics, 14, 128.
Open publication referenceWay, G. P., & Greene, C. S. (2018). Extracting a biologically relevant latent space from cancer transcriptomes with variational autoencoders. Pacific Symposium on Biocomputing, 23, 80–91.
Open publication reference