PDR Pipeline Plan — Navigation Kernel
Status: Operational state has moved to the database. This file is navigation only. ~80 lines, intentionally short.
Last consolidated: 2026-05-16
Why this file is short: the 1,176-line predecessor (now at
docs/_archive/2026-05-16_pre_consolidation/PDR_PIPELINE_PLAN.md) tried to be checklist + run journal + decision log + roadmap all at once and became unreadable. Operational facts now live in DB; this file is the map.
What lives where
| You want… | Look at… |
|---|---|
| What should I work on next? | GitHub issues labelled critical-path (always paired with p0). The current run’s order, decisions and acceptance checks are in its tracking issue (smoke run #1: #439) and docs/mods_smoke_run_1_playbook.md. (Deprecated 2026-09-28: the Research dashboard Pipeline tab and the pdr_status task list. Their pdr_pipeline_task rows were last touched 2026-05-21, and the stale critical ones were demoted to future.) |
| Training-run history & metrics | mods_research_run + mods_run_metric tables — Training Runs tab, or GET /api/mods/research/runs |
| Decisions and learnings | pdr_note_search (MemoryItem, kind=‘decision’ / ‘insight’; Q4 decisions are pinned notes). Decisions of record since 2026-10-01: ledger #599’s clearinghouse table and its sub-issue cards (issues titled “Decision D-Q4-nn”). docs/PDR_NOTES.md is the pre-Q4 narrative, last curated 2026-09-24. |
| Run-specific notes | pdr_note_search('run name') or MemoryItem rows linked via MemoryLink to mods_research_run |
| Patient-eval results | GET /api/mods/research/runs/{id}/patient-eval, or the mods_research_run_patient_eval_v view |
| Per-phase publishable writeups | docs/pdr_phase*_writeup.md (one per closed phase) |
| Variant-aware KG planning (Phase 8.5) | docs/pdr_phase8.5_variant_kg_planning.md |
| Temporal patient modeling planning (Phase 13) | docs/temporal_patient_modeling_planning.md |
| Patient-as-Node thinking doc (Phase 12) | docs/paan_planning.md |
| Original sprawling plan | docs/_archive/2026-05-16_pre_consolidation/PDR_PIPELINE_PLAN.md (do not edit; grep only) |
Paper taxonomy — orientation
KG-Predict and PDR1 share GP-KG and a CompGCN + InteractE model. PDR2 is ULTRA
on a different graph, KGïA’s (#905). The three report different metrics on
different tasks. Don’t conflate them.
Canonical reference: docs/References/README.md.
| Key | Paper | Year | Role | Headline numbers |
|---|---|---|---|---|
| KG-Predict | Gao, Ding, Xu, JBI | 2022 | Introduced GP-KG and the foundational CompGCN + InteractE model. | CV link prediction: AUROC 0.981, AUPR 0.409, MRR 0.261. AD case study: AUROC 0.868, AUPR 0.364. |
| PDR1 | Oğuztüzün et al., JBI | 2025 | Individualized the KG-Predict foundational model per-patient with UK Biobank PRS/biomarker scalars. | Table 3 foundational: MR 1390.6, MRR 0.19231, Hits@10 0.31331, AUC 0.866 (5-fold CV). |
| PDR2 / PDR-II | Oğuztüzün et al., JBI | 2026 | ULTRA on KGïA’s 100,563-entity graph (KG4FM), which its text calls GP-KG (#905). Personalization is a patient-specific term in the loss. | Code at docs/References/PDR2/. Evaluation problems: #891 (adjustments: the authors’ released function applies them differently; AUPRC sampler), #903 (each patient model scored on its own random split). |
Comparator map (which measurement compares to which published number):
| Our measurement | Right comparator |
|---|---|
compute_metrics.py AUROC/AUPR on AD drug ranking vs 60 NCT positives | KG-Predict AD-CS: AUROC 0.868, AUPR 0.364 |
Val/test MRR without -skip_head (Run 4) | KG-Predict CV: AUROC 0.981, MRR 0.261 |
Val MRR with -skip_head (Runs 1–3) | No fair comparator — tail-only eval inflates MRR |
| Per-patient drug ranking (smoke run #1, 2026-09-29: her released PRS, CRC anchor over 9,099 candidates, scored per RGCC draw) | No fair published comparator. PDR1’s per-patient drug result is Fig. 5 (prescribed-drug ranks for three UK Biobank patients, no metric). PDR1 Table 3 and PDR2 Table 1 are link-prediction metrics, and PDR2’s AUPRC lift is in question (#891, #903). (2026-10-30, #1131: this row used to say “not attempted”.) |
KG choice — current production decision
- PrimeKG is the production graph. 7,957 drugs, 30 relation types, rich drug-disease evidence. All Phase 9+ personalization targets PrimeKG.
- GP-KG is paper-comparator only. 1,430 drugs, 9 relations. Sufficient to reproduce KG-Predict, insufficient for CRC personalization (only 1 of 5 RGCC high-sensitivity drugs is in GP-KG).
- PrimeKG canonical checkpoint: Run B (
primekg_corr_1l_400d_v1). Phase 7.5 Tier 1 ρ = +0.351, p = 0.00018 (n=109) — ⚠ superseded pending restatement, GH#324: the label was the mean of her two RGCC draws, which flattened the 12 drugs that inverted by class. Do not use as a baseline until re-run per timepoint.
Decision history: pdr_note_search and ledger #599 for Q4; docs/PDR_NOTES.md through 2026-09-24 only.
Reproducibility & ent2id discipline: CompGCN / PDR1 era (lib/pdr/)
- Keep each checkpoint’s
<name>_vocab.pklsidecar. The ent2id map is built from train.txt traversal order.main.pywrites the sidecar (ent2id, rel2id, RNG state) andtest.pyloads it, so inference in a new session is safe; a checkpoint without its sidecar scrambles predictions there. - GP-KG drug IDs are PubChem CID + 100,000,000 (
cid100002907= CID 2907): subtract 100M before a PubChem lookup (docs/References/kg-predict/lookup_drugs.py). Gene symbols that start with “CID” (e.g. CIDEA) are not drugs. (Corrected 2026-10-30, #1131, #489: this used to say “add 100M offset”.) - PrimeKG drug-disease relations (PDR1 pre-files): three types —
indication,off-label use,contraindication. Enumerate all three at inference time. (GP-KG usestreat.) PDR2 exports carry Biolink predicates (biolink:treats,biolink:has_off_label_use,biolink:contraindicated_for); the held-out G1 ranking scoresbiolink:treats, and contraindication stays out of the loss and is enforced in the decision layer (D-Q4-26 J2). test.pyflags: always pass-gcn_layerand-opnmatching the checkpoint. Silent prediction scrambling otherwise.
Working conventions
- New tasks: open a GitHub issue (CLAUDE.md, “Issue tracking”). If it blocks the
current end-to-end run, label it
critical-path+p0. (Deprecated 2026-09-28: adding topdr_pipeline_taskvia the Pipeline tab orPOST /api/mods/research/pipeline/tasks.) - New decisions:
pdr_note_save(scope='global', kind='decision', pinned=true, ...). - New run findings:
pdr_note_save(scope='run', scope_id='<uuid>', kind='insight', ...). - Run naming:
{kg}_{opn}_{gcn_layer}l_{gcn_dim}d_v{n}(e.g.,gpkg_corr_2l_200d_v1). The Tag taxonomy atmods_research_run.tagsuseskg:<name>,opn:<name>,layers:N,dim:N,phase:<phase>, plus free-form labels (canonical,historical, etc.).