-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathm06_treatment_outcome_model.py
More file actions
276 lines (243 loc) · 11.3 KB
/
Copy pathm06_treatment_outcome_model.py
File metadata and controls
276 lines (243 loc) · 11.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
"""
Module 06: Treatment Outcome Model and Study Design
====================================================
Models expected clinical outcomes and proposes a study design
to test the bromantane-xenon combination hypothesis.
Includes:
- PANSS score improvement predictions
- Symptom domain-specific effects
- Dosing regimen recommendations
- Proposed clinical trial design
- Risk-benefit analysis
"""
import numpy as np
import json
from dataclasses import dataclass
from typing import Dict, List
@dataclass
class TrialDesign:
"""Proposed clinical trial design parameters."""
name: str
phase: str
n_patients: int
duration_weeks: int
arms: List[str]
primary_outcome: str
secondary_outcomes: List[str]
class TreatmentOutcomeModel:
"""
Models expected treatment outcomes and proposes study designs.
"""
def __init__(self):
self.results = {}
def predict_panss_improvement(self, m03_mc: Dict = None) -> Dict:
"""
Predict PANSS (Positive and Negative Syndrome Scale) improvement.
PANSS has 3 subscales:
- Positive (P): delusions, hallucinations (1-7 per item, 7 items)
- Negative (N): avolition, alogia, flat affect (1-7 per item, 7 items)
- General (G): anxiety, guilt, depression, disorganization (1-7 per item, 16 items)
Typical chronic schizophrenia: P=25, N=30, G=50 (total ~105)
Treatment response: antipsychotics reduce P by ~30%, N by ~10-15%
"""
if m03_mc is None:
from m03_synergistic_interaction import run_module
m03 = run_module()
m03_mc = m03["monte_carlo"]
# Baseline PANSS (chronic, treatment-resistant schizophrenia)
baseline = {
"positive": 25.0,
"negative": 30.0,
"general": 50.0,
"total": 105.0
}
# Improvement predictions (from Monte Carlo)
positive_improvement = m03_mc["positive_symptoms"]["combined_effect"]
negative_improvement = m03_mc["negative_symptoms"]["combined_effect"]
general_improvement = m03_mc["cognitive_symptoms"]["combined_effect"] * 0.7 # Partial overlap
# PANSS score changes (max improvement per subscale)
panss_positive_max = 7 * 7 # 7 items * (7-1) max change per item
panss_negative_max = 7 * 6
panss_general_max = 16 * 6
p_positive_score = round(baseline["positive"] * (1 - positive_improvement), 1)
p_negative_score = round(baseline["negative"] * (1 - negative_improvement), 1)
p_general_score = round(baseline["general"] * (1 - general_improvement * 0.7), 1)
p_total_score = round(p_positive_score + p_negative_score + p_general_score, 1)
p_total_change = round(
-baseline["positive"] * positive_improvement -
baseline["negative"] * negative_improvement -
baseline["general"] * general_improvement * 0.7, 1
)
predicted = {
"positive": {
"baseline": baseline["positive"],
"improvement_pct": float(positive_improvement),
"predicted_score": p_positive_score,
"change": round(-baseline["positive"] * positive_improvement, 1)
},
"negative": {
"baseline": baseline["negative"],
"improvement_pct": float(negative_improvement),
"predicted_score": p_negative_score,
"change": round(-baseline["negative"] * negative_improvement, 1)
},
"general": {
"baseline": baseline["general"],
"improvement_pct": float(general_improvement),
"predicted_score": p_general_score,
"change": round(-baseline["general"] * general_improvement * 0.7, 1)
},
"total": {
"baseline": baseline["total"],
"predicted_score": p_total_score,
"change": p_total_change
}
}
self.results["panss_prediction"] = predicted
return predicted
def propose_trial_design(self) -> Dict:
"""
Propose a Phase II clinical trial to test the hypothesis.
"""
design = {
"trial_1_phase_ii_proof_of_concept": {
"name": "Bromantane-Xenon in Schizophrenia Negative Symptoms",
"phase": "II",
"n_patients": 120,
"duration_weeks": 12,
"arms": [
"Bromantane 100mg/day + Placebo inhalation",
"Xenon 50% inhalation (3x/week) + Placebo pill",
"Bromantane 100mg/day + Xenon 50% inhalation (3x/week)",
"Active control: Risperidone 4mg/day"
],
"primary_outcome": "Change in PANSS negative subscale at 12 weeks",
"secondary_outcomes": [
"PANSS positive subscale change",
"PANSS total score change",
"COGNS (cognitive battery) change",
"Subjective negative symptom scale",
"Quality of life questionnaire"
],
"inclusion": "Chronic schizophrenia, PANSS-N >= 25, stable on antipsychotics",
"exclusion": "History of substance abuse, NMDA antagonist use in past 3 months",
"hypothesis": "Combination arm shows greater PANSS-N improvement than either monotherapy"
},
"trial_2_phase_ii_acute_exacerbation": {
"name": "Xenon Rescue for Acute Schizophrenia Exacerbations",
"phase": "II",
"n_patients": 60,
"duration_weeks": 4,
"arms": [
"Xenon 60% inhalation (daily, 30 min)",
"Xenon 60% inhalation (every other day, 30 min)",
"Placebo inhalation"
],
"primary_outcome": "Change in PANSS total score at 4 weeks",
"secondary_outcomes": [
"CGI-S (clinical global impression)",
"Hospitalization rate",
"Adverse event profile"
],
"inclusion": "Acute exacerbation, PANSS total >= 70",
"exclusion": "History of xenon adverse reaction, respiratory disease"
}
}
self.results["trial_design"] = design
return design
def risk_benefit_analysis(self, m03_mc: Dict = None) -> Dict:
"""
Comprehensive risk-benefit analysis.
"""
if m03_mc is None:
from m03_synergistic_interaction import run_module
m03 = run_module()
m03_mc = m03["monte_carlo"]
# Benefits
benefit_negative = m03_mc["negative_symptoms"]["combined_effect"]
benefit_positive = m03_mc["positive_symptoms"]["combined_effect"]
benefit_cognitive = m03_mc["cognitive_symptoms"]["combined_effect"]
therapeutic_index = m03_mc["therapeutic_index"]["mean"]
# Risks
# Bromantane: rare adverse events (~5%)
# Xenon: anesthesia-related (~12%)
# Combination: ~17% combined adverse rate
# Theoretical risk: bromantane could worsen positive symptoms (low)
# Theoretical risk: xenon could worsen NMDA hypofunction (low-moderate)
adverse_rate = m03_mc["adverse_effects"]["combined_adverse_rate"]
analysis = {
"benefits": {
"negative_symptom_improvement": float(benefit_negative),
"positive_symptom_improvement": float(benefit_positive),
"cognitive_improvement": float(benefit_cognitive),
"therapeutic_index": float(therapeutic_index),
"unique_advantages": [
"Targets both dopamine and glutamate hypotheses",
"Addresses negative symptoms (unmet need)",
"No tolerance development (bromantane)",
"Fast rescue capability (xenon)",
"Neuroprotective effects (xenon)",
"Genomic persistence (bromantane)"
]
},
"risks": {
"combined_adverse_rate": float(adverse_rate),
"theoretical_risks": [
"Bromantane may increase mesolimbic dopamine -> worsen positive symptoms",
"Xenon NMDA blockade may worsen interneuron disinhibition",
"Xenon requires anesthesia infrastructure",
"Bromantane not FDA-approved (Russia-only)",
"Xenon not FDA-approved for psychiatric use"
],
"mitigation_strategies": [
"Start with low-dose bromantane (50mg)",
"Monitor PANSS positive subscale closely",
"Use xenon only in clinical setting with anesthesia support",
"Exclude patients with acute positive symptoms",
"Include cognitive safety assessments"
]
},
"overall_assessment": (
"Favorable risk-benefit ratio for treatment-resistant negative symptoms."
" Primary concern is theoretical worsening of positive symptoms; requires"
" careful patient selection and monitoring. Neuroprotective effects of xenon"
" and genomic persistence of bromantane provide unique advantages over"
" existing treatments."
)
}
self.results["risk_benefit"] = analysis
return analysis
def run_module(m03_mc: Dict = None):
"""Run the full treatment outcome model."""
print("=" * 70)
print("MODULE 06: TREATMENT OUTCOME MODEL AND STUDY DESIGN")
print("=" * 70)
model = TreatmentOutcomeModel()
# 1. PANSS prediction
print("\n[1/3] Predicting PANSS improvement...")
panss = model.predict_panss_improvement(m03_mc)
print(f" -> Positive: {panss['positive']['baseline']} -> {panss['positive']['predicted_score']} ({panss['positive']['change']:+.1f})")
print(f" -> Negative: {panss['negative']['baseline']} -> {panss['negative']['predicted_score']} ({panss['negative']['change']:+.1f})")
print(f" -> General: {panss['general']['baseline']} -> {panss['general']['predicted_score']} ({panss['general']['change']:+.1f})")
print(f" -> Total: {panss['total']['baseline']} -> {panss['total']['predicted_score']} ({panss['total']['change']:+.1f})")
# 2. Trial design
print("\n[2/3] Proposing trial designs...")
trials = model.propose_trial_design()
for name, trial in trials.items():
print(f" -> {trial['name']}")
print(f" Phase {trial['phase']}, N={trial['n_patients']}, {trial['duration_weeks']} weeks")
print(f" Primary: {trial['primary_outcome']}")
# 3. Risk-benefit
print("\n[3/3] Risk-benefit analysis...")
rb = model.risk_benefit_analysis(m03_mc)
print(f" -> Adverse rate: {rb['risks']['combined_adverse_rate']:.1%}")
print(f" -> Therapeutic index: {rb['benefits']['therapeutic_index']:.1f}")
print(f" -> Assessment: {rb['overall_assessment'][:120]}...")
return {
"module": "m06_treatment_outcome_model",
"panss_prediction": panss,
"trial_design": trials,
"risk_benefit": rb
}
if __name__ == "__main__":
run_module()