How pharmaverse/anca works
Project type and purpose
• This is an R package that bundles an R Shiny web application (“aNCA”) plus a library of R functions for performing Non-Compartmental Analysis (NCA) on pharmacokinetic datasets.
File structure
• Top-level:
• DESCRIPTION, NAMESPACE, R/ (core R functions) → the package’s analysis engine.
• inst/shiny/ (UI assets, modules, app launcher).
• man/, vignettes/, pkgdown/ → documentation and site-generation.
• tests/, .github/workflows → automated testing and CI.
• Within inst/shiny:
• www/ → CSS/SCSS, JS, images (front-end assets)
• functions/ → shared server functions for UI interactions
• modules/ → Shiny modules for each tab (Data, NCA, TLG, Visuals)
• app.R → Shiny app entry point
• R/: functions wrapping PKNCA core logic, data formatting, plotting helpers.
README for additional insights
• The Shiny app is launched via run_app() and auto-loads sample data.
• Key features map to modules: data upload/filtering, NCA setup/run, outputs (plots, tables), export to CDISC.
• External dependency: PKNCA package (for the actual NCA algorithms).
Essential architectural elements
• Shiny modules as separate blocks under the frontend/server layer.
• PKNCA package as a dependency of the analysis engine.
• CI/CD pipeline and testing suite to reflect the development workflow.
• Avoid clutter by grouping similar modules (e.g., all UI modules under a single “UI Modules” container, with sub-labels).