Skip to content

feat(enrichr): retrieve gene sets incl. MSigDB collections (#139)#241

Draft
Elarwei001 wants to merge 2 commits into
scverse:devfrom
Elarwei001:feature/enrichr-msigdb-139
Draft

feat(enrichr): retrieve gene sets incl. MSigDB collections (#139)#241
Elarwei001 wants to merge 2 commits into
scverse:devfrom
Elarwei001:feature/enrichr-msigdb-139

Conversation

@Elarwei001

Copy link
Copy Markdown
Contributor

Resolves #139

Summary

gget enrichr: Added support for retrieving gene sets, including MSigDB collections (fixes issue 139).

Testing

Unit tests added/extended in tests/test_enrichr.py with fixture entries in tests/fixtures/test_enrichr.json; run with pytest.

Add `gget.enrichr_library()` (CLI: `gget enrichr --get_library`) to fetch the
gene sets (members) of any Enrichr gene-set library — the recommended way to
retrieve MSigDB gene sets (e.g. MSigDB_Hallmark_2020) without MSigDB login.

- Returns a long-format DataFrame (gene_set, gene), or a {gene_set: [genes]}
  dict with json=True. `gene_set=` returns a single set; `species` selects the
  non-human Enrichr variants.
- CLI: new --get_library/-gl and --gene_set/-gs; genes/--database made optional
  in library mode (still enforced for enrichment). Backward compatible.
- Detects Enrichr's HTML-404 (HTTP 200) response for unknown libraries.
- Tests + fixtures (live Enrichr) and docs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov-commenter

codecov-commenter commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.62%. Comparing base (5cf607f) to head (69cc3ea).
⚠️ Report is 1 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #241      +/-   ##
==========================================
+ Coverage   56.14%   56.62%   +0.48%     
==========================================
  Files          29       29              
  Lines        9244     9285      +41     
==========================================
+ Hits         5190     5258      +68     
+ Misses       4054     4027      -27     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Add a network-free TestEnrichrLibraryOffline class that mocks requests
to cover enrichr_library: invalid species, verbose logging, blank-line
parsing, bad/empty library errors, gene_set filter + not-found, and the
json/json+save/CSV-save branches. All PR-added lines now covered.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Elarwei001 Elarwei001 marked this pull request as draft June 25, 2026 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants