How yhhton/biigler works
Project type and purpose
• This is an R package (“biigler”) that serves as a client-side wrapper for the BIIGLE 2.0 RESTful API.
• Its primary purpose is to automate and simplify repetitive BIIGLE GUI operations (fetching volumes, images, label trees, posting/deleting labels or annotations, and generating reports) entirely from R.
File structure
• Top-level files:
• DESCRIPTION, NAMESPACE – standard R package metadata and export configuration
• biigler.Rproj – RStudio project file
• README.md, LICENSE* – documentation and licensing
• Directories:
• R/ – contains all functional R scripts grouped by operation (data retrieval, posting/deleting, labeling assistant, summary/visualization)
• man/ – generated Rd files documenting each exported function
• data/ – example datasets (ex_annotation.rda, ex_label.rda) for testing summary/visualization functions
• No separate “frontend” or “backend” folders; the package itself is both client and orchestrator.
Extract additional insights from README
• Key functional groups:
• API client functions (getBIIGLE, getVolID, getVolImg, getTree, postLabs, volPostNDelete, etc.)
• Labeling assistant (labelingAssistant)
• Reporting & visualization (ana_sumVol)
• Authentication utility (genAuth)
• Dependencies: R ≥4.1.2, BIIGLE 2.0 API v3.14.2, plus typical HTTP/JSON libraries (e.g., httr, jsonlite).
a. Main components to include:
• R Package (biigler)
– Authentication module (genAuth)
– API Client module (all get*/post* functions)
– Labeling Assistant module
– Reporting & Visualization module
– Example Data (ex_annotation, ex_label)
• External BIIGLE 2.0 RESTful API (hosted at user-configurable URL)
• User’s R session / script / RStudio IDE
• (Optional) Downstream chart output (e.g., ggplot bar charts)
b. Relationships and interactions:
1. User invokes functions in biigler from RStudio
2. Authentication module generates auth header
3. API Client module issues HTTP GET/POST requests to BIIGLE API
4. BIIGLE API responds with JSON data or status
5. Received JSON is parsed into R objects (data frames, lists)
6. Labeling Assistant or Reporting modules transform data or send batch requests
7. Visualization modules render bar charts or export CSV reports
c. Architectural patterns and design principles:
• Modular separation by responsibility (auth, data retrieval, data posting, reporting)
• Single responsibility functions, each documented in man/
• Data encapsulation: example data stored in data/ for testing
• Reuse of standard R package conventions (DESCRIPTION, NAMESPACE)
d. Key technologies and libraries:
• R (core language)
• httr / jsonlite (HTTP client and JSON parsing)
• csv / data.frame (data exchange format)
• ggplot2 or base plotting (assumed for bar charts in ana_sumVol)