Commit afbedc5
committed
Fix 4 bugs: ZIP fallback, Emax bound, NCA terminal min-points, log-rank tolerance
drug_synergy_tool.py — Bug #7 (CRITICAL): ZIP fallback was Bliss, not ZIP
- ZIP requires Hill curve fitting; without it a Bliss independence surface was
silently returned labelled as a ZIP delta score — scientifically wrong
- Now returns a clear error naming the drug(s) that failed Hill fitting and
directing the user to calculate_bliss for a non-parametric alternative
drug_synergy_tool.py — Bug #8: Emax upper bound 1.5 in Loewe/CI Hill fitter
- _fit_hill_for_loewe uses fractional inhibition (0-1); Emax > 1 is physically
impossible, yet the scipy curve_fit upper bound allowed 1.5
- Corrected to 1.0 (Loewe & Muischnek 1926; Chou & Talalay 1984)
nca_tool.py — Bug #4: terminal slope accepted 2 instead of 3 post-Tmax points
- FDA NCA guidance requires 3+ points for lambda_z: a 2-point linear regression
is a perfect fit by construction (R2=1 trivially), giving no quality signal
- Now requires 3+ post-Tmax positive concentrations before using the full set;
falls back to last n_points otherwise
survival_tool.py — Bug #6: log-rank zero-variance check used absolute tolerance
- Threshold 1e-10 too tight for large studies: float rounding errors over many
event times scale as N x 2.2e-16, so 1e-10 would erroneously reject valid
proportional distributions in datasets with thousands of events
- Replaced with relative tolerance: 1e-8 x total_events (safe up to 10^7 events)1 parent 888e2e3 commit afbedc5
3 files changed
Lines changed: 34 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
298 | 310 | | |
299 | 311 | | |
300 | 312 | | |
| |||
348 | 360 | | |
349 | 361 | | |
350 | 362 | | |
351 | | - | |
| 363 | + | |
352 | 364 | | |
353 | 365 | | |
354 | 366 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| 156 | + | |
| 157 | + | |
156 | 158 | | |
157 | 159 | | |
158 | | - | |
| 160 | + | |
159 | 161 | | |
160 | 162 | | |
161 | 163 | | |
162 | 164 | | |
163 | 165 | | |
164 | 166 | | |
| 167 | + | |
| 168 | + | |
165 | 169 | | |
166 | 170 | | |
167 | 171 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
355 | 355 | | |
356 | 356 | | |
357 | 357 | | |
358 | | - | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
359 | 368 | | |
360 | 369 | | |
361 | 370 | | |
| |||
0 commit comments