skillfed

gseapy

Gene Set Enrichment Analysis in Python

gseapy v1.3.1 249.9K downloads/30d#8,643 on PyPI708
Permissive license BSD-3-Clause Active released

What it is and what it does

GSEApy is a Python/Rust implementation of gene set enrichment analysis that brings GSEA functionality and Enrichr API access into a Python environment. It supports multiple analysis methods—standard GSEA, prerank (with a faithful Rust port of fgsea's multilevel algorithm for resolving p-values below 1/permutation_num), single-sample GSEA (ssGSEA), and GSVA—making it suitable for RNA-seq, ChIP-seq, and microarray data. The package can work with expression matrices, ranked gene lists, or Enrichr libraries, and produces publication-quality figures via matplotlib.

The package is designed for both interactive Python workflows and command-line batch processing. It accepts standard GSEA file formats (GMT, GCT, RNK, CLS) and can work directly with pandas DataFrames and Series, eliminating the need to switch between Python and desktop GSEA tools. A biomart module also enables gene ID conversion. Runtime dependencies are numpy, scipy, pandas, matplotlib, and requests—all widely used scientific Python libraries.

Use it for:

  • Identify significantly enriched biological pathways in RNA-seq differential expression results using prerank with gene rankings.
  • Perform single-sample enrichment scoring across multiple samples to assess pathway activity per sample.
  • Batch process multiple genomic datasets in a snakemake or Python workflow without manual GSEA desktop invocations.
  • Reproduce GSEA desktop results programmatically using the replot module on existing GSEA output directories.
  • Query Enrichr libraries for functional annotation of gene lists via the enrichr module API.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Performs gene set enrichment analysis (GSEA) on genomic data using Python, supporting multiple methods including prerank, ssGSEA, GSVA, and Enrichr API integration.

Yes. GSEApy is actively maintained, has no known vulnerabilities, carries a permissive BSD-3-Clause license, and fills a genuine need for GSEA functionality within Python workflows. The medium install friction (Rust compilation) is a one-time cost offset by broad wheel availability for modern Python versions (3.10–3.13) and clear fallback instructions. Suitable for bioinformaticians and computational biologists working with genomic data.

Install

gseapy on PyPI

pip

pip install gseapy

uv

uv add gseapy

poetry

poetry add gseapy

Installing gseapy

Before you install

Medium install friction due to Rust compilation requirement for versions after 0.11.0. Wheels are available for Python 3.10–3.13 on macOS, Linux, and Windows, but pip install may require a Rust toolchain if a pre-built wheel is unavailable. Active maintenance with recent release (19 days ago).

License in practice

BSD-3-Clause permissive license allows commercial and private use with minimal restrictions, requiring only license and copyright notice retention.

Quickstart

pip install gseapy

import gseapy
import pandas as pd

# Run GSEA with expression data and gene sets
gseapy.gsea(data='expression.txt', gene_sets='gene_sets.gmt', cls='test.cls', outdir='test')

# Or use prerank with fgsea multilevel p-value method
gseapy.prerank(rnk='gsea_data.rnk', gene_sets='gene_sets.gmt', method='multilevel', outdir='test')

Requires Python >=3.9. If pip install fails, Rust toolchain must be installed first (curl https://sh.rustup.rs -sSf | sh).

Verify before relying

  • Whether the Rust compilation requirement applies to all platforms or only specific architectures.
  • Performance characteristics when analyzing large-scale genomic datasets.
  • Compatibility with specific gene set database formats beyond GMT and Enrichr libraries.

Package facts

License BSD-3-Clause (permissive)
Python support supports the current Python release (>=3.9)
Install friction medium — platform-specific wheel
Runtime dependencies 5 — numpy, scipy, pandas, matplotlib, requests
Maintenance actively maintained — 19 days since the last release
Last repo commit
First released
Downloads 249,903/month — #8,643 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: gseapy-1.3.1-cp310-cp310-macosx_11_0_arm64.whl; gseapy-1.3.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; gseapy-1.3.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; gseapy-1.3.1-cp310-cp310-win32.whl; gseapy-1.3.1-cp310-cp310-win_amd64.whl; gseapy-1.3.1-cp311-cp311-macosx_11_0_arm64.whl; gseapy-1.3.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; gseapy-1.3.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; gseapy-1.3.1-cp311-cp311-win32.whl; gseapy-1.3.1-cp311-cp311-win_amd64.whl; gseapy-1.3.1-cp312-cp312-macosx_11_0_arm64.whl; gseapy-1.3.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; gseapy-1.3.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; gseapy-1.3.1-cp312-cp312-win32.whl; gseapy-1.3.1-cp312-cp312-win_amd64.whl; gseapy-1.3.1-cp313-cp313-macosx_11_0_arm64.whl; gseapy-1.3.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; gseapy-1.3.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; gseapy-1.3.1-cp313-cp313-win32.whl; gseapy-1.3.1-cp313-cp313-win_amd64.whl

Keywords: Gene Ontology, GO, Biology, Enrichment, Bioinformatics, Computational Biology

Development Status :: 4 - BetaIntended Audience :: Science/ResearchOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIXProgramming Language :: Python :: 3Topic :: Scientific/Engineering :: Bio-InformaticsTopic :: Software Development :: Libraries

Tags

gene set enrichment analysis pythonGSEA RNA-seq analysisenrichment analysis bioinformaticsGO enrichment pythongenomic data analysisprerank GSEA toolssGSEA single sample
bioinformaticsgenomicsenrichment-analysis

More Libraries packages