feat(reactome): add gget reactome module to query the Reactome pathway database (#114)#236
Draft
Elarwei001 wants to merge 3 commits into
Draft
feat(reactome): add gget reactome module to query the Reactome pathway database (#114)#236Elarwei001 wants to merge 3 commits into
Elarwei001 wants to merge 3 commits into
Conversation
…y database (scverse#114) New module `gget reactome` (Python API + CLI) querying the Reactome ContentService REST API (https://reactome.org/). Supports three query types via the `resource` argument: - pathways (default): the Reactome pathways an identifier (e.g. a UniProt accession) participates in - search: full-text search of the Reactome knowledgebase - entity: details for a Reactome stable ID Returns a pandas DataFrame (or JSON with json=True / --csv on the CLI). Reuses the shared http_json helper for retries/error handling, strips HTML highlight tags from search results, and maps Reactome 404s to empty results (pathways/search) or a clear ValueError (entity). Adds unit tests (offline argument validation via fixture + release-robust network smoke tests that skip when Reactome is unreachable), docs page docs/src/en/reactome.md, a SUMMARY.md entry, and an updates.md note. Resolves scverse#114. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
for more information, see https://pre-commit.ci
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #236 +/- ##
==========================================
+ Coverage 56.14% 56.93% +0.79%
==========================================
Files 29 30 +1
Lines 9244 9337 +93
==========================================
+ Hits 5190 5316 +126
+ Misses 4054 4021 -33 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Add a network-free TestReactomeOffline class that mocks http_json to cover _strip_html passthrough, the pathways/search/entity parsing, verbose logging, 404 and non-404 error branches, the entity name fallback/summation, and resource/query validation. gget_reactome.py now 98% (only the import-time PackageNotFoundError version fallback, lines 16-17, remains, which is un-coverable in an installed environment). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
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 #114
Summary
gget reactome: New module to query the Reactome pathway knowledgebase via its ContentService REST API. Supports three query types via theresourceargument:pathways(the Reactome pathways an identifier such as a UniProt accession participates in),search(full-text search of the knowledgebase), andentity(details for a Reactome stable ID). Resolves issue 114.Testing
Unit tests in
tests/test_reactome.py(offline argument-validation viatests/fixtures/test_reactome.jsonplus release-robust network smoke tests that skip when Reactome is unreachable); run with pytest.