|
| 1 | +# synthdiet |
| 2 | + |
| 3 | +[](https://pypi.org/project/synthdiet/) |
| 4 | +[](https://pypi.org/project/synthdiet/) |
| 5 | +[](https://opensource.org/licenses/MIT) |
| 6 | +[](https://github.com/bugraayancom/synthdiet/actions/workflows/ci.yml) |
| 7 | + |
| 8 | +> Andere Sprachen: [English](README.md) · [Türkçe](README.tr.md) · [Español](README.es.md) · [Français](README.fr.md) · [Português](README.pt.md) · [Italiano](README.it.md) · [中文](README.zh.md) · [日本語](README.ja.md) |
| 9 | +Eine Python-Bibliothek zum **Erzeugen synthetischer Patientinnen und |
| 10 | +Patienten** mit realistischen klinischen Tableaus und zur |
| 11 | +**Simulation diätetischer Interventionen** an ihnen. |
| 12 | + |
| 13 | +`synthdiet` richtet sich an Diätassistent\*innen, klinische |
| 14 | +Ernährungsforscher\*innen und Lehrende, die Diäten prototypisch |
| 15 | +entwickeln, virtuelle Studien durchführen und Ernährungsempfehlungen |
| 16 | +an Hunderten oder Tausenden synthetischer Patient\*innen |
| 17 | +stresstesten möchten, bevor sie in die Klinik gelangen. |
| 18 | + |
| 19 | +> Hinweis: `synthdiet` ist ein Forschungs- und Lehrwerkzeug. Die |
| 20 | +> erzeugten Zahlen sind **keine klinischen Empfehlungen** und die |
| 21 | +> synthetischen Patient\*innen sind **keine realen Personen**. Für die |
| 22 | +> Patientenversorgung wenden Sie sich stets an eine\*n qualifizierte\*n |
| 23 | +> registrierte\*n Diätassistent\*in. |
| 24 | +
|
| 25 | +--- |
| 26 | + |
| 27 | +## Autor |
| 28 | + |
| 29 | +**Buğra Ayan** — Ankara / Türkei |
| 30 | +- Webseite: <https://bugraayan.com> |
| 31 | +- E-Mail: <bugraayan.com@gmail.com> |
| 32 | +- Google Scholar: <https://scholar.google.com/citations?user=VHGqzNMAAAAJ&hl=tr> |
| 33 | + |
| 34 | +--- |
| 35 | + |
| 36 | +## Funktionsumfang |
| 37 | + |
| 38 | +### Kerndomänenmodell |
| 39 | +- Eine typisierte `Patient`-Klasse, die Demografie, Anthropometrie, |
| 40 | + Lebensstil, Laborbiomarker, Diagnosen und aktuelle Medikation |
| 41 | + zusammenführt. |
| 42 | +- Ein Register mit **mehr als 25 Krankheiten** aus den Bereichen |
| 43 | + Endokrinologie, Kardiologie, Nephrologie, Hepatologie, |
| 44 | + Gastroenterologie, Stoffwechsel, Bewegungsapparat, Onkologie, |
| 45 | + Psychiatrie und Allergologie. |
| 46 | +- Ein Register mit **19 klinisch relevanten Arzneimittel-Nährstoff- |
| 47 | + Wechselwirkungen** (Metformin → B12, Statine → Grapefruit, |
| 48 | + Warfarin → Vitamin K, L-Thyroxin-Einnahmezeitpunkt, Tyramin-Krise |
| 49 | + unter MAO-Hemmern usw.). |
| 50 | +- 5 Generatoren synthetischer Patient\*innen (zufällig, verteilungs- |
| 51 | + basiert, Copula, Kohorte, Markow-Progression). |
| 52 | +- Eine 45 Lebensmittel umfassende Datenbank mit Makro-/Mikronährstoff- |
| 53 | + Aufschlüsselung und 8 voreingestellten Diäten (Mediterran, DASH, |
| 54 | + Keto, Low-FODMAP, natriumarm bei Niereninsuffizienz, Diabetiker, |
| 55 | + vegan, Standard). |
| 56 | + |
| 57 | +### Methodische Tiefe (v0.1) |
| 58 | +- **Hall-Körperzusammensetzungsmodell (2011)** als optionale Engine |
| 59 | + (`DietSimulator(engine="hall_2011")`) mit Fett-/Magermassen- |
| 60 | + Aufteilung über die Forbes-Gleichung und adaptiver Thermogenese. |
| 61 | +- **Adhärenz- und Drop-out-Dynamik**: konstant, abklingend, Weibull, |
| 62 | + stochastische Aussetzer, wahrgenommene Belastung. |
| 63 | +- **RCT-Engine** (`synthdiet.trials`): Parallelarm-, Crossover- und |
| 64 | + 2×2-faktorielle Designs; geschichtete / Block- / |
| 65 | + Minimierungs-Randomisierung; Drop-out-Modellierung; ITT/PP/AT- |
| 66 | + Analysen. |
| 67 | +- **Kausale Inferenz** (`synthdiet.causal`): kontrafaktische |
| 68 | + Simulation, ATE/CATE-Schätzer, Konfundierungs-Experimente mit |
| 69 | + IPTW und g-Formel, leichtgewichtige DAGs. |
| 70 | +- **Indizes der Ernährungsqualität** (`synthdiet.indices`): HEI-2020, |
| 71 | + AHEI-2010, MEDAS, DASH-Score, PHDI, DII. |
| 72 | +- **Statistische Helfer** (`synthdiet.stats`): Power-Analysen für |
| 73 | + stetige und binäre Endpunkte, Bootstrap-KI, Permutationstests, |
| 74 | + Benjamini-Hochberg- und Holm-Bonferroni-Korrekturen, |
| 75 | + baseline-adjustierte ANCOVA. |
| 76 | +- **Mess- und Fehlende-Daten-Injektion** (`synthdiet.noise`): |
| 77 | + Assay-CV%, Selbstauskunfts-Bias, MCAR/MAR/MNAR-Muster. |
| 78 | +- **15 Fallstudien + OSCE-artige Bewertung** |
| 79 | + (`synthdiet.education`). |
| 80 | +- **Validierungssuite** gegen 5 Meilenstein-RCTs |
| 81 | + (`synthdiet.validation`): DASH-Sodium, PREDIMED, DiRECT, |
| 82 | + Look AHEAD, Diabetes Prevention Program. |
| 83 | +- **Visualisierung** (`synthdiet.viz`, optional): CONSORT-Diagramm, |
| 84 | + Forest-Plot, Trajektorien-Band, Tabelle 1. |
| 85 | + |
| 86 | +--- |
| 87 | + |
| 88 | +## Installation |
| 89 | + |
| 90 | +```bash |
| 91 | +pip install synthdiet |
| 92 | +``` |
| 93 | + |
| 94 | +Optionale Extras: |
| 95 | + |
| 96 | +```bash |
| 97 | +pip install "synthdiet[viz]" # matplotlib-Visualisierungen |
| 98 | +pip install "synthdiet[causal]" # networkx-DAG-Export |
| 99 | +pip install "synthdiet[docs]" # Sphinx + furo + myst-parser |
| 100 | +pip install "synthdiet[dev]" # pytest + ruff + mypy + matplotlib |
| 101 | +``` |
| 102 | + |
| 103 | +`synthdiet` benötigt Python 3.9+ und stützt sich auf `numpy`, `pandas`, |
| 104 | +`scipy`. |
| 105 | + |
| 106 | +--- |
| 107 | + |
| 108 | +## 60-Sekunden-Tour |
| 109 | + |
| 110 | +```python |
| 111 | +from synthdiet import ( |
| 112 | + CohortGenerator, CohortSpec, DiseaseSpec, |
| 113 | + DietSimulator, mediterranean_diet, |
| 114 | + evaluate_simulation, format_evaluation_report, |
| 115 | +) |
| 116 | + |
| 117 | +spec = CohortSpec( |
| 118 | + size=100, |
| 119 | + diseases=[ |
| 120 | + DiseaseSpec("type_2_diabetes", prevalence=0.40), |
| 121 | + DiseaseSpec("hypertension", prevalence=0.45), |
| 122 | + ], |
| 123 | +) |
| 124 | +cohort = CohortGenerator(spec, seed=42).generate() |
| 125 | + |
| 126 | +simulator = DietSimulator(adherence=0.8) |
| 127 | +diet = mediterranean_diet(daily_energy_kcal=1800) |
| 128 | + |
| 129 | +for patient in cohort[:3]: |
| 130 | + result = simulator.run(patient, diet, duration_weeks=12) |
| 131 | + evaluation = evaluate_simulation(result) |
| 132 | + print(format_evaluation_report(evaluation)) |
| 133 | + print("-" * 60) |
| 134 | +``` |
| 135 | + |
| 136 | +Vollständige Beispiele in [`examples/`](examples/); deutsche |
| 137 | +Tutorials in [`docs/de/`](docs/de/). |
| 138 | + |
| 139 | +--- |
| 140 | + |
| 141 | +## Zitation |
| 142 | + |
| 143 | +```bibtex |
| 144 | +@software{ayan_synthdiet_2026, |
| 145 | + author = {Buğra Ayan}, |
| 146 | + title = {synthdiet: A Python library for simulating diets on synthetic patients}, |
| 147 | + year = {2026}, |
| 148 | + version = {0.1.0}, |
| 149 | + url = {https://bugraayan.com} |
| 150 | +} |
| 151 | +``` |
| 152 | + |
| 153 | +## Lizenz |
| 154 | + |
| 155 | +MIT — siehe [`LICENSE`](LICENSE). |
0 commit comments