# v4 extensions: ethinylestradiol, improved SHBG, more routes, flux diagrams

## What changed from v3 → v4

| | v3 | v4 |
|---|---|---|
| Species tracked | E2, E1, E1S + SHBG | E2, E1, E1S, **EE**, SHBG |
| SHBG induction | single Hill curve | **three parallel pathways** |
| Scenarios | 8 | **12** (added oral 4 mg, IM EC, sub-Q EUn, COC) |
| Validation passing | 7/8 within 2× | **10/12 within 2×** |
| Visualizations | static plots | **+ Sankey flux diagrams + interactive HTML viewer** |

## EE compartment

Ethinylestradiol is structurally a different molecule than estradiol — the 17α-ethinyl substitution blocks the 17β-HSD2 oxidation that normally inactivates E2 to E1. So EE doesn't share metabolism pathways with E2/E1/E1S; it gets its own state variable.

### EE parameters (from research/EE-parameters.md)

| Parameter | v4 value | Source |
|---|---|---|
| F (oral bioavailability) | 0.45 | Stanczyk 2013; range 38–48% |
| MCR | 400 L/day | Lorbek 2018 PBPK (CL_iv × 24); range 250–500 |
| Vd | 280 L | ~4 L/kg × 70 kg (Lorbek 2018) |
| Half-life | 18 h (steady state) | Range 12–24 h |
| Tmax | 1.5 h | Multiple sources |
| SHBG Kd | 1000 nM | ~50× weaker than E2 (Kuhl 2005) |
| Free fraction | ~2% | Mostly albumin-bound; negligible SHBG binding |

Note that EE has its own albumin binding (similar Kd ~12 µM) but **does not meaningfully bind SHBG** — so high SHBG doesn't trap EE the way it traps E2.

### COC validation (30 µg EE/day)

| Variable | Model | Anchor | Ratio | Notes |
|---|---|---|---|---|
| Plasma EE (Cavg) | 34 pg/mL | 40 pg/mL | 0.84 | ✓ |
| SHBG | 179 nM | 170 nM | 1.05 | ✓ |
| Plasma E2 | 1.8 | 5 | 0.36 | low — model has no ovarian suppression term |
| Plasma E1 | 21 | 50 | 0.42 | similar |

The EE Cavg and SHBG rise match well. The E2/E1 anchors are low because the model uses postmenopausal-baseline endogenous E1 (40 µg/d) for the COC scenario, not the partial suppression of ovarian function that happens in real premenopausal COC users. To match the 5 pg/mL E2 anchor properly, would need a "premenopausal-on-COC" baseline that suppresses ovarian E2 from ~50 → ~5.

## Improved SHBG dynamics

The v3 SHBG model used a single Hill curve on free hepatic E2. That worked for pregnancy (high systemic free E2) but **under-predicted oral E2 SHBG induction** because the systemic free E2 from a 1–2 mg oral dose is similar to a transdermal dose at the same systemic Cmax — but the *hepatic* exposure (during first-pass) is much higher.

v4 splits SHBG induction into three additive pathways:

1. **Sustained free hepatic E2** — Hill(free_hep_E2, EC50=1500 pg/mL, n=1.5). Drives the pregnancy SHBG rise (massive sustained free E2 hits hepatic ER all day).
2. **Oral E2 first-pass signal** — Hill(daily_oral_dose_mg, EC50=1.5 mg, n=1). Drives the Lindberg 2005 dose-response (1 mg → +60%, 2 mg → +120%, 4 mg → ~+180%).
3. **Oral EE first-pass signal** — Hill(daily_oral_dose_µg, EC50=50 µg, n=1) with high max (0.5). Drives the COC SHBG rise (30 µg → +200–300%, 50 µg → +400–500%). EE's ~100× hepatic potency per molar is captured by giving its pathway a much higher max-induction-fraction than the oral E2 pathway (0.5 vs 0.2).

The three pathways are summed and capped at 1.0 (so the SHBG response asymptotically saturates at max_induction × baseline = 15 × 50 = 750 nM).

### Validation across scenarios

| Scenario | SHBG model | SHBG anchor | Ratio |
|---|---|---|---|
| Cycling | 50 nM | 50 | 1.00 ✓ |
| Oral 1 mg | 105 | 80 | 1.31 ✓ |
| Oral 2 mg | 129 | 110 | 1.17 ✓ |
| Oral 4 mg | 150 | 140 | 1.07 ✓ |
| Transdermal 50 µg | 50 | 50 | 1.00 ✓ |
| Transdermal 100 µg | 50 | 55 | 0.91 ✓ |
| Sublingual 1 mg BID | 106 | 80 | 1.32 ✓ |
| IM E2V 5 mg q5d | 51 | 60 | 0.85 ✓ |
| IM EC 5 mg q14d | 50 | 55 | 0.91 ✓ |
| Sub-Q EUn 25 mg | 50 | 60 | 0.84 ✓ |
| COC EE 30 µg | 179 | 170 | 1.05 ✓ |
| Pregnancy term | 211 | 350 | 0.60 ✓ (barely) |

Pregnancy still under-shoots SHBG by ~40%. Capturing the full 5–10× pregnancy rise probably needs an explicit placental SHBG production term, which we don't include.

## New scenarios

### Oral 4 mg E2 (high-dose trans HRT)

Captures the high end of oral E2 dosing. Model gives E2 186 pg/mL (anchor 130), E1 807 (anchor 900), E1S 15,800 (anchor 9,000). All within 2× but E1S is at the upper edge — consistent with SULT1E1 substrate inhibition starting to kick in at high E2.

### IM estradiol cypionate (EC) 5 mg / 14 days

Longer-acting than EV due to cypionate ester (longer carbon chain). Half-life ~6.5 days. Model predicts E2 ~80 pg/mL average, on the low end of literature 100–150 pg/mL.

### Subcutaneous estradiol undecylate 25 mg / monthly

Very long-acting depot (~22-day half-life). Used in some trans HRT regimens (notably "Aly's depot" formulations). Model gives E2 ~190 pg/mL.

### Combined oral contraceptive (EE 30 µg/d)

The flagship scenario for showing why EE has a hepatic-disproportionate SHBG effect. Despite Cavg of only ~30–40 pg/mL EE, SHBG rises to ~180 nM (similar magnitude to pregnancy), because:
- EE's 17α-ethinyl blocks the inactivation pathway that "uses up" oral E2
- Per-molar EE is ~100× more potent than E2 at hepatic SHBG induction
- The hepatic first-pass concentration of EE during absorption is high

## Sankey flux diagrams (`figures/v4/sankey_*.html`)

For each scenario, an interactive Plotly Sankey diagram shows the steady-state mass flux (µg/day) from sources → plasma species → metabolic sinks. Open the HTML files in a browser; hover on links to see exact flux values.

The Sankey makes route-of-administration effects visually obvious:
- **Oral E2**: huge flow from "Oral E2 dose" splits across E2 (4%), E1 (30%), E1S (32%) entry points — most of the dose enters circulation as already-conjugated estrogens, not as free E2.
- **Transdermal**: thin clean flow from "Transdermal patch" → plasma E2 only, with peripheral conversion driving E1, E1S downstream.
- **IM EV**: medium flow through "IM E2V depot" → plasma E2, slow but sustained.
- **COC**: tiny EE flow into a separate plasma EE compartment that goes straight to metabolism without interconversion.

Also a **static summary panel** (`flux_summary.png`) showing the four most important scenarios side-by-side with all fluxes plotted on log-scale µg/day axes.

## Interactive time-animation HTML viewer (`figures/v4/interactive_viewer.html`)

A self-contained HTML page that lets you:
- Pick any of the 12 scenarios from a dropdown
- Scrub through time with a slider, or hit Play
- See concentrations of E2/E1/E1S/EE/SHBG update in real time
- See instantaneous metabolic flux through each pathway (E2→E1, E2→E1S, E1→E1S, etc.) as horizontal bars that update with the time slider
- See the model-vs-anchor ratio update live, with green/red color coding

This is the "ECG-like display moving through time" the user asked about. No external dependencies beyond a web browser — open the file directly.

## Animated GIFs (`figures/v4/anim_*.gif`)

For four key scenarios (oral 2 mg, IM EV 5 mg q5d, COC EE 30 µg, sublingual 1 mg BID), an animated GIF shows:
- Time courses of E2/E1/E1S over the full simulation
- A horizontal flux-bar chart on the right that updates as time advances
- A red cursor showing current time on the time-course plots

Useful for embedding in slides or social media without needing the full HTML viewer.

## What's still wrong / missing

- **Pregnancy SHBG (still 0.6×)**: would need a placental-SHBG-production term, possibly with an explicit estrogen-independent component (some of pregnancy SHBG rise is HCG-driven, not E2-driven).
- **Sublingual E1S (still 2.2×)**: the literature anchor itself is uncertain; the model produces an internally-consistent answer.
- **COC E2/E1 too low**: needs a "premenopausal-on-COC" mode that partly suppresses ovarian function.
- **No CYP1A1/1B1 catechol pathway**: 2-OH-E2, 4-OH-E2 lumped into "other clearance". Matters for breast-cancer-risk reasoning but not for the validation targets here.
- **No enterohepatic recirculation**: omits the gut-bacterial β-glucuronidase reactivation step.
- **No inter-individual variability**: single-trajectory deterministic model. Real PK has CV ≈ 30–60% on most parameters.
- **No estriol pathway**: pregnancy is modeled by lumped placental E2/E1 input, not the actual DHEA-S → E3 chain.
