# ABM PGx Atlas — catalogue of computed parameters

Per-variant and per-association parameters available in the resource.
Unit of analysis: **variant × drug × ICD-10 condition** ("association").

---

## 1. Study design

Each association is characterised against **four independent GWAS phenotype arms** run on the
same biobank cohort, which is what makes the contrast parameters (§3) possible:

| arm | phenotype | model |
|---|---|---|
| **ADR (discovery)** | condition occurring in users of the drug | logistic (REGENIE) |
| **disease-alone** | the ICD-10 condition in the general population, drug-free | logistic |
| **drug dose** | `<drug>__median_dose__ln` | **linear** |
| **drug prescribed** | propensity to be prescribed the drug | logistic |

Cohort is split **80% discovery / 20% held-out test**; the discovery arm is run on the 80%,
and every association carries an independent replication statistic from the held-out 20% (§4).

---

## 2. Association statistics — per arm

For each of the four arms:

- `BETA` — effect size (log-odds; linear for the dose arm)
- `SE` — standard error
- `LOG10P` — −log10 p-value
- `CHISQ` / `Z_STAT` — test statistics

---

## 3. Contrast parameters (differences of betas)

The most informative family — they isolate what is **specific to the drug** rather than to the
condition or to the patient population:

- `delta_BETA_ADR_vs_pure` — ADR effect vs the same variant's effect on the disease alone
- `delta_BETA_ADR_vs_dose` — ADR effect vs the dose-response arm
- `delta_BETA_ADR_vs_prescribed` — ADR effect vs prescription propensity
- `delta_BETA_pure_vs_prescribed` — disease-alone vs prescription propensity
- `beta_superiority` — ADR effect relative to the **strongest** drug-free arm, SE-shrunk and
  frequency-standardised; untested arms excluded rather than treated as null
- `effect_sign_concordance` — sign agreement between arms
- `drug_specificity` — how much of the signal is drug-conditional

Betas are normalised across arms before contrasting (the dose arm is linear, the others
logistic), and standardised per-allele by `β·√(2f(1−f))` to remove frequency-driven inflation
in rare variants.

---

## 4. Held-out replication

- `repl_directional_z` — `sign(BETA_discovery) · log(OR_test) / SE_test`; one-sided,
  precision-weighted, direction-aware
- `OR_logdiff_test_minus_disc`, `OR_ratio_test_over_disc` — test-vs-discovery effect calibration
- `test_Z_STAT`, `LOG(OR)_SE` — held-out test statistics
- confidence tier — replicated / replication-underpowered / unreplicated

Directional replication is used rather than a p-value threshold because most candidates are rare;
201/207 are sign-concordant, where only 105 would pass a two-sided P<0.05.

---

## 5. Genotype and frequency

- `A1_CASE_CT`, `A1_CTRL_CT`, case/control allele counts
- `A1_CASE_FREQ`, `A1_CTRL_FREQ` — allele frequency in cases and controls separately
- `CASE_HET_A1_CT`, `CASE_HOM_A1_CT`, `CTRL_HET_A1_CT`, `CTRL_HOM_A1_CT` — genotype counts
- `A1_FREQ`, `INFO` (imputation quality), `N`
- `gnomAD_AF` + missingness indicator

---

## 6. Temporal / EHR-derived (ADR-specific)

Derived from prescription and diagnosis dates — these describe the **time relationship between
drug exposure and the event**, and are among the most discriminating parameters we have:

- `TEMP_n_before_exposure`, `TEMP_n_after_exposure` — event counts either side of first exposure
- `TEMP_pct_before`, `TEMP_pct_after` — proportion of diagnoses before / after the prescription
- `ADR_after_over_before` — directional log-ratio (drug-induced vs pre-existing direction)
- `TEMP_median_days_after`, `TEMP_median_years_after`
- `TEMP_median_days_before_exposure`, `TEMP_median_years_before_exposure`
- `TEMP_q25_days_after`, `TEMP_q75_days_after` — onset-window location (tight window = drug-locked)
- `TEMP_pct_missing_dx_date`, `TEMP_pct_missing_rx_date` — data-quality indicators

Empirically: events following exposure at ~30× the pre-exposure rate is the drug-effect
signature; a high pre-exposure fraction (~15%) is the indication signature.

---

## 7. Pharmacovigilance (FAERS)

Real-world spontaneous-report disproportionality for the same drug–event pair:

- `FAERS_PRR` (+ CI), `FAERS_ROR` (+ CI), `FAERS_IC025`, `FAERS_a` (report count)
- `FAERS_MedDRA_PT` — mapped preferred term

Caveat we document: these are elevated for **on-label** pairs (confounding by indication), so
they corroborate reporting, not causality.

---

## 8. Variant annotation

- VEP `Consequence` (+ canonical severity rank), `IMPACT`, `BIOTYPE`, `SYMBOL`, `Gene`, `Feature`
- `SIFT`, `PolyPhen` scores
- `Existing_variation` (rsID), position, REF/ALT
- `internal_pleiotropy` — number of hits for the variant across our own GWAS corpus
  (computed internally, de-contaminated of ancillary biobank traits)

---

## 9. Label / indication context

- `BNF_indication_codes`, `BNF_indication_description` — licensed indications for the drug
- `on_BNF` — whether the ICD-10 condition is on the drug's own label

---

## 10. Composite / derived outputs

- **latent-PGx priority score** — equal-weight geometric mean (soft-AND) of five evidence axes:
  directional replication, FAERS disproportionality, temporal direction, effect superiority,
  and inverse pleiotropy. No tuned weights.
- **five-state mechanistic classification**, assigned from parameter signatures alone
  (unsupervised — no expert labels):

  | state | meaning |
  |---|---|
  | **I** | Indication — drug given *for* the condition |
  | **E** | drug-triggered Effect — drug-specific, follows exposure, replicates |
  | **P** | Preexisting effect enhanced by the drug |
  | **C2** | Confounder — a locus drives the disease/prescription, the drug adds nothing |
  | **C** | Comorbidity — weak, nonspecific co-occurrence |

- `evidence_stouffer_Z`, `evidence_conjunction_minZ` — cross-arm evidence combination
  (Stouffer 1949; Nichols 2005 conjunction)
- cluster assignment + per-cluster mechanistic label

---

## 11. Scale

- **44** parameters in the classification model, derived from ~**164** source columns
- **207** locus × phenotype associations after collapsing co-located variants to lead signals
  (250 kb window per drug × condition)
- 4 GWAS arms × ~2.7 M variants in the underlying summary-statistics corpus

---

## What is distinctive here

1. **Four-arm contrast design** — the same variant is measured with the drug, without the drug,
   against dose, and against prescription propensity. This is what separates a drug-triggered
   effect from a predisposition or a confounder.
2. **Temporal EHR parameters** — event timing relative to first exposure, which pure
   summary-statistics resources do not carry.
3. **Held-out directional replication** on an independent 20% of the cohort.
4. **Pharmacovigilance linkage** to the same drug–event pair.
