mendelnoulli

Code and figure notebooks for the manuscript on time-varying polygenic effects and monogenic penetrance.

Each page shows one main figure panel by panel, with the script that draws it, the scripts that produced its inputs, and each script's header (inputs, recipe, outputs). All code is in src/ of the GitHub repository; the notebooks in notebooks/ regenerate every panel from the fitted models. No participant-level data are included.

Figure 1 — Polygenic effects change with age Figure 2 — The genetic age interaction changes individual predictions Figure 3 — Polygenic risk rescales loading; carrier variants reshape composition Figure 4 — What the gate selects Figure 5 — Inherited predisposition and the health record Figure 6 — Replication: carrier life courses in three cohorts

Model design

Why the triplet — the ablation behind the health component, PC-excluded scores and frailty (not a manuscript figure) Training notes — read before training: stop by held-out score and not by training loss, how to check a fit, how to apply the sex-warmup correction, and what to re-derive on another dataset Training length and stability — how the number of epochs was chosen, what is reproducible across batches and seeds, and the sex-warmup correction (not a manuscript figure)

Pipeline

1. Train the model on UK Biobank (src/train_slope_3way.py): signatures, polygenic level and age effects, health reference, frailty.
2. Held-out predictions (src/triplet_loo_calibration.py): per-person deviation and frailty refit up to enrollment.
3. Carrier atlases (src/reparam_fig3/run_atlas_triplet_fixed.sh, run_static_atlas_triplet.sh, run_brca1_s8_triplet.sh).
4. Figures: the scripts named on each page.

License: MGB Source Available License 1.0 (non-commercial research use; see LICENSE).

Data access: UK Biobank, All of Us and Mass General Brigham Biobank data are available to approved researchers from each resource.