feat(enrichr): retrieve gene sets incl. MSigDB collections (#139)#241
Draft
Elarwei001 wants to merge 2 commits into
Draft
feat(enrichr): retrieve gene sets incl. MSigDB collections (#139)#241Elarwei001 wants to merge 2 commits into
Elarwei001 wants to merge 2 commits into
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.pywith fixture entries intests/fixtures/test_enrichr.json; run with pytest.