Skip to content

Add rattler-build recipe#92

Open
mtran-code wants to merge 9 commits into
mainfrom
feat/add-rattler-build-recipe
Open

Add rattler-build recipe#92
mtran-code wants to merge 9 commits into
mainfrom
feat/add-rattler-build-recipe

Conversation

@mtran-code
Copy link
Copy Markdown
Collaborator

@mtran-code mtran-code commented May 6, 2026

Primarily for pixi-build support from Git source.

Summary by CodeRabbit

Release Notes

  • New Features

    • Added persistent caching for API queries to improve performance on repeated requests.
    • Introduced configurable caching options.
  • Changes

    • Relaxed minimum R version requirement to 4.5.0.
  • Chores

    • Updated version to 0.99.7.
    • Added BiocFileCache dependency.
    • Added Conda recipe file.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 6, 2026

Caution

Review failed

Failed to post review comments

📝 Walkthrough

Walkthrough

This PR introduces persistent caching infrastructure to the AnnotationGx package via BiocFileCache. Package metadata was updated (version 0.99.5→0.99.7, R dependency 4.6.0→4.5.0), a new caching utility suite added, and API client methods across BioMart, Cellosaurus, ChEMBL, Oncotree, PubChem, and UniChem refactored to use the caching layer. Tests and Conda recipe were added.

Changes

Persistent Caching System

Layer / File(s) Summary
Package Metadata & Dependencies
DESCRIPTION, NEWS.md, recipe.yaml
Version bumped to 0.99.7; R minimum requirement lowered to 4.5.0; BiocFileCache added as new import; Conda recipe introduced for package distribution.
Caching Infrastructure
R/utils-cache.R
New internal utility suite providing cache directory resolution, BiocFileCache handle management, namespace-based key building, cache persistence checks, refresh control, and a central .cache_fetch function that wraps computations with hash-based caching and error handling. Controlled by options: annotationgx.cache.dir, annotationgx.cache.use (default TRUE), annotationgx.cache.refresh (default FALSE).
API Integration Refactoring
R/biomart_core.R, R/biomart_core.R, R/cellosaurus.R, R/cellosaurus_annotations.R, R/cellosaurus_helpers.R, R/chembl.R, R/chembl_helpers.R, R/oncotree.R, R/pubchem_rest.R, R/pubchem_view.R, R/pubchem_view_helpers.R, R/unichem.R
Each API client method refactored to encapsulate core query logic in internal query_impl function and wrap execution in .cache_fetch with namespace and parameters. Data shapes and public signatures preserved; logic flow now uses caching layer for result reuse. Mechanism columns expanded in ChEMBL helpers; minor field mapping updates in Cellosaurus.
Cache Testing & Configuration
tests/testthat/setup-cache.R, tests/testthat/test_cache_helpers.R
Test setup configures temporary cache directory and disables refresh by default. New test file validates .cache_fetch persistence across repeated calls and honors refresh option via annotationgx.cache.refresh.

Sequence Diagram

sequenceDiagram
    participant Client as Client Code
    participant Fetch as .cache_fetch()
    participant Cache as BiocFileCache
    participant Disk as Disk Storage
    participant API as External API

    Client->>Fetch: .cache_fetch(namespace, params, FUN)
    Fetch->>Cache: Check cache enabled?
    Cache-->>Fetch: Yes (if annotationgx.cache.use = TRUE)
    Fetch->>Cache: Look up key (version + namespace + hash(params))
    Cache->>Disk: Query by key
    Disk-->>Cache: Hit or Miss?
    alt Cache Miss
        Fetch->>API: Execute FUN (original query logic)
        API-->>Fetch: Response data
        Fetch->>Cache: Write result to cache
        Cache->>Disk: Store with key
        Disk-->>Cache: Written
    else Cache Hit
        Cache-->>Fetch: Return cached object
    end
    alt Refresh Enabled
        Fetch->>API: Always execute FUN (bypass cache)
        API-->>Fetch: Response data
    end
    Fetch-->>Client: Return value
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • bhklab/AnnotationGx#66: Both PRs modify Cellosaurus codebase (mapCell2Accession, related helpers); this PR adds caching infrastructure and inner query_impl structures while the other PR adds feature flags and field mappings.

Poem

🐰 A cache of carrots, nested deep,
Where weary queries come to sleep.
No fetch twice—BiocFileCache knows,
Swift returns as the rabbit goes!
Persistent roots through session's night,
Fast queries, oh what a delight!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title 'Add rattler-build recipe' does not match the primary changes in the changeset, which focus on implementing caching infrastructure across multiple API query functions and adding BiocFileCache support. Consider a more comprehensive title that reflects the main objective, such as 'Add BiocFileCache-based caching infrastructure and rattler-build recipe' or focus the title on the primary change if rattler-build is secondary.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/add-rattler-build-recipe

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant