NAFLD/NASH: recalibrate to placebo-corrected trial values + add validation harness#8
Open
mingushin3 wants to merge 3 commits into
Open
NAFLD/NASH: recalibrate to placebo-corrected trial values + add validation harness#8mingushin3 wants to merge 3 commits into
mingushin3 wants to merge 3 commits into
Conversation
…ontrast mrgsolve model (nafld_mrgsolve_model.R): - Remove compartments from CAPTURE block (mrgsolve >=1.0 rejects them; compartment amounts are returned automatically) Shiny app (nafld_shiny_app.R): - Remove compartments from CAPTURE block - TABLE: use TIME instead of lowercase time (collided with C library time()) - Remove apostrophes from an in-model comment that prematurely closed the single-quoted R model string (caused "unexpected symbol") - Hoist valueBox_shiny() above the ui object (UI called it at build time) - Replace deprecated page_navbar bg= with navbar_options(bg=, theme=) - High-contrast navbar: deep-maroon bar, light tab labels, white-pill active tab, white brand title (via bs_add_rules) Verified: both models parse, compile, and simulate; Shiny UI builds with no errors or warnings. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…el for stability req() error (Scenario Comparison / Endpoint Summary tabs): - mrgsolve exports a req() S3 generic that masks shiny::req() (loaded earlier), so req(input$compare_arms) hit mrgsolve's generic -> "no applicable method for req applied to character". Qualified all four server calls as shiny::req(). Model divergence (placebo grew ~10x/week to ~1e+85): - Root cause: disease pools were not initialized at their own steady state (absolute production terms) and the steatosis->Kupffer->TNFa->IR->DNL->fat positive-feedback loop was unbounded. - Re-calibrated BOTH nafld_mrgsolve_model.R and nafld_shiny_app.R to steady-state-consistent indirect-response (turnover) form (kin = KOUT*baseline) with fold-change-normalized, saturable drivers and loop gain << 1 (Dayneka 1993; Jusko & Ko 1994; Woo 2009; Angeli-Ferrell-Sontag 2004; Maldonado 2022). - LIVER_FAT influx split into DNL + adipose-NEFA(weight); Kupffer drive saturable; ALT injury is now a sum (not product) of normalized drivers; collagen made the slowest pool. INS_RES/BODY_WT/ADIPONECTIN already correct (set-point form). - Remapped the Fibrosis-tab sliders/param() to the new sensitivity names (GTGF_HSC, GHSC_COL, GLIP_KUP, GKUP_TGF) and adjusted ranges. - Added nafld_model_design_brief.md documenting the literature basis. Verified (R, mrgsolve 2.0.1): placebo flat to machine precision for all 11 states over 72 wk; perturbation recovers to baseline; no divergence in any arm; drug directions clinically correct (resmetirom -40% liver fat ~ MAESTRO, semaglutide lowers fat/HOMA-IR/weight & raises adiponectin, OCA lowers fibrosis, triple best); fibrosis-tab live-param path works. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…validation harness - Resmetirom: DNL inhibition 0.40->0.30, efflux gain 0.60->0.48 => 100 mg liver fat -40% -> -34.0% (MAESTRO-NAFLD-1 wk52 placebo-corrected -33.9%) - Empagliflozin: add direct hepatic-fat efflux term (WEMP_LF=0.47, calibrated to E-LIFT placebo-corrected -24.7%) + fix latent near-inert PK scaling (EC50_EMP 0.15->0.015) => liver fat -1% -> -24.6% - Calibrate to placebo-corrected (between-group) trial effects throughout (the QSP placebo arm is flat, so raw within-arm trial changes would over-credit the drug) - Fix citation provenance in model header (ESSENCE/Newsome, OCA, EMPACTA->E-LIFT, Rieger); document recalibration + adversarial-review limitations in the design brief - Add validation/validate.R reproducibility harness (placebo flat + effect sizes; all pass) and validation figures Co-Authored-By: Claude Opus 4.8 <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.
Summary
Recalibrates the NAFLD/NASH QSP model so each drug's effect size matches the placebo-corrected
endpoint of its pivotal trial, fixes a latent empagliflozin PK bug, corrects citation provenance,
and adds a reproducible validation harness.
Validated effect sizes (model vs published, placebo-corrected)
All numbers are reproducible:
Rscript nafld-nash/validation/validate.R(exit 0 = all checks pass —placebo flat, no divergence, effect sizes within tolerance of the trials).
Changes
WEMP_LFdirect hepatic-fat efflux term (calibrated to E-LIFTplacebo-corrected −24.7%) +
EC50_EMP0.15→0.015 (10 mg was effectively inert before).adversarial multi-lens review (the raw within-arm E-LIFT −30% over-credits the control-arm decline).
validation/harness (validate.R+ evidence figures).Before → after recalibration
Notes
repo is public). See
nafld_references.mdfor DOIs/PMIDs.Limitations / next
Steady-state model matches the wk52 plateau (not the within-study time-course); NAS sub-scores are
proxies → use deltas; OCA safety (pruritus, LDL) and the NASH-resolution endpoint are not modeled;
a continuous-output → responder-rate (% NASH resolution) bridge is future work.
🤖 Generated with Claude Code