Objective Detection of Phage Treatment Effect Onset from Optical Density Data
by Stephen T. Abedon Ph.D. (abedon.1@osu.edu)
phage.org | phage-therapy.org | biologyaspoetry.org | abedon.phage.org | google scholar
Jump to: 💡 Concept | ∂ The Math | 🔬 Analyzer | 🔬ⁿ n-Analyzer | 🧪 Time-Kill | 📖 Methods | ⚙️ Tech | 🧮 More Calculators
?simdata=1) for analyzing ODE simulation outputs against the same
detection algorithms.
deviation.phage.org · Abedon’s Books · DOI: 10.5281/zenodo.19023877
How can I improve this page? contact: deviation@phage.org
Threshold-based detection (Uni & Multi) enables direct comparison between approaches; it is also more robust than the "earliest" estimate for both noisy and continuous data.
For a primer on the underlying math — first derivative, second derivative, inflection points — see the ∂ The Math tab.
When lytic bacteriophage infect a bacterial culture, the optical density (OD) of the culture eventually begins to drop as infected cells lyse. But the actual onset of deviation — when the phage treatment first measurably affects bacterial growth — often occurs earlier than the OD drop. Deviation is the separation of phage-containing from phage-free OD curves; it is the OD signature of phage impact on a bacterial culture. Detecting this precisely, objectively, and early is the goal of this calculator.
Deviation is a y-axis phenomenon — a magnitude. Its onset and the operational estimates of that onset are x-axis quantities — times. The methods first detect whether deviation is occurring (y-axis), then estimate when it began (x-axis).
Deviation onset is the calculus landmark itself (d²(OD)/dt² = 0; equivalently, d(OD)/dt at its maximum). Earliest deviation and threshold deviation are operational alternatives, used when a noise margin past the bare onset is desired. In temporal order: deviation onset → earliest deviation (half a sample later) → threshold deviation (later still, after the deviation has accumulated to 5% of peak slope). All three are computed from the same OD curve; which one to report depends on how much noise margin the application requires.
Deviation timing — the x-axis quantity — is a measure of phage antibacterial virulence: earlier deviation onset means faster-acting phage (Abedon 2025a; Abedon 2025b). It complements traditional metrics like OD-max and area-under-curve (AUC), but perhaps most importantly it provides an OD-based alternative to traditional time-kill curves. The key advantage: automated OD plate readers can take readings every few minutes across a multi-hour experiment, whereas traditional time-kill curves require manual plating at each timepoint — making fine-resolution sampling impractical (Abedon 2026).
Every phage-bacterial OD curve contains a sequence of biologically meaningful moments. The calculator identifies and reports the following landmarks, each marked by a feature of the OD curve, its first derivative d(OD)/dt, or its second derivative d²(OD)/dt²:
The two killings — phage-mediated bactericidal activity (deviation) and bacterial physiological death (lysis) — sit at successive landmarks separated by approximately one latent period. A single signal (the second derivative) narrates the entire phage-bacterial dynamic. The landmarks above the lysis cascade (PLR, 95L, EOL) and beyond (presumptive regrowth) extend the same calculus-based framework to capture the full lifecycle of the OD signature.
The Time-Kill tab adds CFU-side landmarks (CFU peak, CFU 50% drop, CFU 10× drop, CFU 100× drop) when CFU measurements are also provided. The Sim Data tab adds simulation-only landmarks (Peak culture growth, Control stationary phase). For chart axes and AUC integration windows, the calculator consistently anchors at TD — see the Math tab section 8 for rationale.
This calculator implements three approaches to detecting deviation, ordered from least to most complex — in terms of what data you need, what assumptions you make, and what happens when simpler approaches are insufficient. These are Univariate Detection, Multivariate Detection, and Statistical Detection:
One curve — no control required. When bacterial growth is exponential, the natural logarithm of OD increases linearly with time. This means the instantaneous slope of ln(OD) — the specific growth rate μ — is constant. Deviation is detected as the first sustained departure of μ from its pre-deviation plateau: mathematically, when the second derivative of ln(OD) with respect to time (d²(ln OD)/dt²) first becomes persistently negative — that is, when the growth rate itself is declining.
The instantaneous slope (the slope of a short local window of ln(OD) vs time, approximating d(ln OD)/dt at each moment) is computed at each timepoint and compared against the peak pre-deviation slope. When the slope first drops below a threshold fraction of that peak and stays down, deviation is declared.
Experimental flexibility: Because Univariate Detection requires only a single curve, it offers greater experimental flexibility than the two-curve approaches. Multiple treatment curves with different starting bacterial concentrations can be generated and analyzed simultaneously without the need to precisely pair each one with a matched phage-free control experiment. Technical replicates can likewise be analyzed individually and compared directly, rather than averaged to match a control — preserving within-experiment variation that averaging would obscure.
The cost of this flexibility is also experimental: Univariate Detection requires not only that deviation occurs during exponential growth, but that exponential growth is captured over a sufficient number of timepoints to establish with confidence that the pre-deviation growth was in fact exponential. Too few pre-deviation timepoints, or a lag phase that extends too far into the pre-deviation period and thereby obscures it (it is best practice to start these experiments with log-phase bacteria), will compromise the reliability of the result — as reflected in a low correlation coefficient.
Quality metric: How flat is the instantaneous slope series during the pre-deviation window? If the slope d(OD)/dt is nearly constant (or equivalently, if d(ln OD)/dt is constant on a logarithmic plot — exponential growth being linear on a log scale but not on a linear scale) (a flat horizontal line), the pre-deviation growth was cleanly exponential and detection is reliable. If the slope is erratic or trending, exponential growth was not clean and results should be interpreted with caution. The calculator reports this flatness using the correlation coefficient (R²) — expressed as a percentage from 0% to 100%, where higher means flatter and more reliable.
Two curves — phage-free control required. The Univariate Detection approach requires exponential growth because it is the linearity of ln(OD) vs time that provides the flat reference baseline. If growth is not exponential — for example, if the culture is in a lag phase, approaching stationary phase, or growing linearly rather than exponentially — then ln(OD) is not linear in time, the slope series is not flat, and establishing a stable baseline becomes more difficult, making the approach less reliable.
The Multivariate Detection approach solves this by using the phage-free control curve as the reference rather than pre-deviation bacterial growth in phage presence — no curve fitting or assumption about growth shape is needed. At each timepoint, the instantaneous slope of ln(OD_treatment) and the instantaneous slope of ln(OD_control) are each computed independently. As long as phage are having no effect, both cultures are growing at the same rate, so the two slopes are equal — their difference hovers near zero regardless of what shape the growth curve has. It doesn't matter whether growth is exponential, linear, decelerating, or anything else: whatever is driving both cultures equally appears in both slope series and cancels out when you subtract one from the other.
Deviation is declared at the first moment when the treatment slope drops persistently below the control slope — the same logic as Univariate Detection, but using the control curve's instantaneous slope as the reference rather than the treatment curve's own pre-deviation slope. No curve fitting is required; the control curve provides the reference point by point.
Quality metric: Noise level of the pre-deviation residual. Low noise → sensitive detection. High noise → consider the Statistical approach.
Two curves — phage-free control required. Fallback when calculus-based approaches are unreliable. The Statistical approach uses a parameter grid sweep. At each timepoint and for each combination of window size, threshold, and minimum consecutive points, the ratio of treatment slope to control slope is tested. Results across all parameter combinations are trimmed and averaged, yielding a robust consensus estimate that is resistant to individual noisy readings.
Two sub-approaches run in parallel: stat-raw (slopes on raw OD values, absolute growth rate) and stat-ln (slopes on ln-OD values, specific growth rate). Their independently trimmed means are combined with equal weight.
Quality metric: SD of the trimmed mean across the parameter grid. Lower SD → more consistent result across parameter choices → higher confidence.
The three approaches are complementary, not competing. When all three agree, you have very strong multi-method evidence. When they disagree, the pattern of disagreement is itself informative:
Starting inoculum: Beginning experiments with log-phase (exponentially growing) bacteria produces cleaner pre-deviation data for all three approaches. With log-phase inocula, OD begins rising almost immediately and the slope curve rises quickly to a reliable plateau. Stationary-phase inocula introduce a true lag phase that can obscure the pre-deviation baseline. Log-phase inocula are therefore strongly recommended.
All three approaches benefit from denser sampling. Experimental OD plate readers sampling every 5–10 minutes may appear to show sharper transitions than fine-resolution simulations — this however is a sampling artifact. Denser sampling reveals the true gradual nature of the transition and improves detection precision for all three approaches, particularly Univariate.
For Univariate specifically, two quality metrics predict detection reliability: pre-deviation R² > 0.85 indicates clean exponential growth; noise level < 10% indicates low measurement variability. Both being good = reliable. Low R² or high noise level suggests caution and preference for Statistical (Multivariate noise level is necessarily higher than Univariate on the same data, but it does not require exponential growth).
Computational models of phage-bacteria dynamics (e.g., ODE-based population models) are ideally suited to validate these detection approaches. Key open questions addressable by simulation include:
Hypothesis (working, supported by ten paired OD+CFU datasets across five experiments): All three deviation-related landmarks — deviation onset, earliest deviation, and threshold deviation — closely track CFU-measured bacterial killing time, while ODmax and end-of-lysis lag the killing event substantially. The strongest finding is that deviation onset places r48 and WT phages within half the OD sampling interval of each other in every paired experiment, even when CFU sampling is too coarse to detect the within-experiment correspondence directly.
Five reasons all three deviation candidates are useful estimators of bacterial killing:
The important caveat: These conclusions depend on having sufficiently short OD sampling intervals. With 1–5 minute sampling, threshold deviation crossings are detected with sub-sampling-interval precision via linear interpolation between samples. With 10+ minute intervals, the threshold crossing may be poorly resolved, and earliest deviation (or deviation onset itself) may become the better choice because their timings are anchored to the slope-peak sample rather than to the interpolated threshold crossing.
Test these conclusions on your own paired OD+CFU data using the 🧪 Time-Kill tab. The Time-Kill comparison table directly shows which deviation estimator (onset, earliest, or threshold) best matches the CFU 10× drop and CFU 50% drop times on your dataset.
This tab explains the mathematical ideas behind OD deviation detection — no prior calculus knowledge required.
A derivative measures how fast something is changing at a given moment. If you plot a quantity on a graph, the derivative at any point is the slope of the curve at that point — how steeply it is rising or falling.
More precisely, the first derivative of OD with respect to time, written d(OD)/dt, answers the question: "How fast is the optical density changing right now?" A large positive value means OD is rising rapidly; a value near zero means OD is barely changing; a negative value means OD is falling.
The second derivative, d²(OD)/dt², tells you how fast the first derivative itself is changing — whether the growth rate is speeding up, staying constant, or slowing down.
Physics analogy: if OD is position, then d(OD)/dt is velocity and d²(OD)/dt² is acceleration. Just as you can describe a moving car by its position, velocity, and acceleration, you can describe an OD curve by its current value, its rate of change, and the rate at which that rate of change is itself changing.
During exponential growth, a bacterial culture doubles at a constant rate. This means the OD curve rises as an exponential function: OD(t) = OD₀ × eμt, where μ is the specific growth rate.
A typical phage-bacterial OD curve passes through three biologically distinct moments, each marked by a specific feature of the derivatives of OD(t):
The second derivative as a single narrator. A single signal — d²(OD)/dt² — passes through all three landmarks in sequence: it starts positive (growth accelerating), crosses zero at deviation onset, reaches its minimum near OD_max, and crosses zero again at end-of-lysis. This calculator computes all three.
Asymmetry: deviation onset is fundamentally harder to detect than the other two landmarks — but the other two are not the same kind of "easy."
Bottom line: for OD_max, the peak-anchored value is the default — it inherits naive's robustness while adding calculus's sub-timepoint precision and a confidence diagnostic. For end-of-lysis, use the calculus value — the naive minimum is measuring a different (later) event.
Why is deviation onset the most informative for time-kill? Lysis onset (OD_max) occurs approximately one latent period after the phage-mediated killing events that produced it. By the time OD has peaked, the killing decision has already been made; the OD curve is reporting downstream consequence. Deviation onset, by contrast, marks the earliest detectable moment that growth has slowed relative to pure exponential — the closest OD-based correlate to the actual phage adsorption and host commitment events.
When a phage population begins to have an effect on a bacterial population, bacterial growth slows. This shows up immediately in the first derivative: d(OD)/dt, which had been rising steadily, begins to drop. The zero-crossing — where d(OD)/dt = 0 — marks where OD peaks. At this exact moment the second derivative d²(OD)/dt² = 0, meaning the OD curve has an inflection point. This zero-crossing is the latest possible deviation time.
More sensitively, deviation can be detected before the zero-crossing, as a drop from the rising first-derivative curve. Panel A of Figures 1 and 2 shows the first derivative of OD vs time. The calculator reports two estimates:
Note on fine-grained simulations: For continuously sampled or very fine-grained data (e.g., simulations with 1-second intervals), the "earliest" estimate (peak slope timepoint) and the threshold estimate converge — adjacent timepoints are so close together that the bracket between them is negligibly small. In this regime, the threshold-based interpolated crossing is the better-defined estimate, since it gives a precise continuous time rather than depending on the sampling interval. For typical plate-reader data (4-minute intervals), the earliest and threshold estimates bracket a meaningful temporal range.
Expected ordering: The earliest estimate should always be earlier than (or equal to) the threshold estimate, which should always be earlier than (or equal to) OD_max (zero-crossing). That is: earliest ≤ threshold ≤ OD_max. Note on two-peak OD profiles: Even without phage-resistant mutant development or host-range mutation, some phage-bacterium combinations produce two distinct OD decline events: a first partial lysis (reflecting early rounds of infection) followed by bacterial regrowth and then terminal lysis (culture clearing). This is most common with lysis-inhibition phages at intermediate bacterial densities. The first ODmax is the virulence-relevant landmark — it marks when phages first began lysing bacteria at a detectable scale. The pre-terminal ODmax (last local maximum before EOL) is the KOTE-relevant landmark for phage titer calibration, since it is the consistent event across curves at all titers that precedes culture-wide clearing. Peak lysis rate timing should likewise be measured during the terminal lysis decline. The KOTE Calibration tab uses the pre-terminal ODmax automatically; the main Analyzer tab reports both (as OD_max and, when detected, the second hump time in the second lysis row). If the threshold estimate appears earlier than the earliest estimate, this indicates a data quality issue — likely a noisy spike in the first derivative that created a false peak, or insufficient data before the true deviation.
To see the zero-crossing clearly, use the X-min and X-max controls in the Figure 1 or Figure 2 toolbar to crop the x-axis around the OD peak — X-min cuts off the early growth phase, X-max cuts off the post-lysis tail.
The Statistical detector runs the deviation analysis with multiple parameter combinations (different window sizes, threshold fractions, minimum consecutive points) and reports a robust summary. The results table shows it in two rows:
The gap between earliest and threshold is itself informative. A small gap (a few sample intervals) indicates the deviation event is sharp and well-defined — most methods agree on roughly when it happened. A large gap (tens of minutes or more) indicates the deviation is gradual, noisy, or low-amplitude — only the most sensitive methods catch the beginning, while less-sensitive methods need more accumulated divergence before firing.
Both rows have parallel "earliest" and "threshold" entries for Univariate too: Univariate's earliest is the peak-slope-midpoint estimate (no threshold required); Univariate's threshold is the trimmed mean across its own threshold grid (0.95, 0.85, 0.75 of peak μ).
Note on Multivariate training window logic. Multi's training baseline is bounded by three caps applied simultaneously: (1) the first 25% of dataset points; (2) an absolute 60-time-unit ceiling (for long plate-reader runs where 25% would extend past the deviation event); and (3) an early-peak cap that stops the training window at least 4 indices before the treatment OD reaches its maximum within the first 25% of data. Cap 3 is critical for fast-lysis datasets (T3, T7 short) where OD peaks at ~t = 48–52 min — without it, the 60-min cap would extend into the lysis trough and corrupt the training baseline. For delayed-lysis datasets (T1, T7 long/longer, T4), the early OD peak is much later, so cap 2 continues to govern. The cutoff additionally carries a noise floor of μ − 2σ (where σ is the standard deviation of training-window diff-slopes), ensuring the threshold is always meaningfully below the baseline even when the peak treatment slope is small.
The calculator reports three estimates of ODmax, each addressing different failure modes of the others:
The peak-anchored value carries a PRECISE / MODERATE PRECISION / LOW PRECISION / IMPRECISE label based on slope-sign consistency around the anchor point. Specifically: in a window around the discrete max, the algorithm computes short-window slopes on either side. It reports:
Confidence levels:
Confidence reflects curve shape, not biological importance. A canonical fast-lysis curve (sharp rise, sharp fall around one latent period) yields PRECISE. A delayed-lysis curve where OD drifts upward and then very gradually drifts down can yield LOW PRECISION or IMPRECISE even though the experiment is interpretable — the "peak" is just genuinely ill-defined in the data, and the confidence flag is signaling that honestly.
When all three methods agree, the data has a clean well-defined peak and any value is trustworthy. When they disagree, the disagreement is itself informative:
The naive and zero-crossing values are kept in the table as reference points for this kind of diagnostic comparison.
Note on AUC calculations: AUC windows that anchor to ODmax use the naive max time (not the peak-anchored value), because the AUC computation needs an actual sample point and the naive value is naturally aligned to one. For pre-lysis-recovery datasets (where the global naive max is post-lysis), this can produce an inappropriate AUC window — a known limitation. For most clean datasets the naive max is biologically meaningful and the AUC windows are correct.
Pre-deviation R² is reported for Univariate only. It measures how flat the slope series d(OD)/dt is during the pre-deviation period — for clean exponential growth this series should be nearly constant (≈ μ_peak rising slowly), giving high R². Low R² indicates the slope was not steady before deviation, which undermines the Univariate detection's premise. R² is not reported for Multivariate because Multivariate's relevant series is the slope-difference (treatment − control), which is expected to hover near zero. A linear regression of a near-zero series explains almost no variance, so its R² is structurally near 0 regardless of data quality. Reporting it would mislead more than inform.
Noise level (σ / peak slope) is reported for both Univariate and Multivariate and is directly comparable between them. It is the standard deviation of slope values in a ±5-point window around the peak slope, divided by the peak treatment slope. The peak window is where the slope is approximately constant, so SD there represents true noise (not the rising trend of exponential growth). Interpretation:
Multivariate combines noise from two independently noisy curves, so its noise level is typically higher than Univariate on the same data. (If the two curves share correlated noise — e.g., parallel temperature fluctuations — some common-mode noise cancels in the subtraction and Multi noise can be lower than Uni.)
Taking the logarithm of OD before computing the first derivative gives d(ln OD)/dt — which equals μ (the specific growth rate) when growth is truly exponential. Unlike d(OD)/dt, which rises continuously during exponential growth, d(ln OD)/dt should be flat during exponential growth.
This makes Panel B a powerful noise diagnostic. If Panel B is flat and horizontal, pre-deviation growth was cleanly exponential and Panel A detection is reliable. If Panel B is noisy, rising, or trending, then either:
In either case, Panel B noise warrants caution. However, the magnitude of the variation matters greatly — a y-axis spanning 0.0001 ln-OD units that appears dramatic is actually negligible biologically. This is the same phenomenon seen when graphing the OD of a sterile-broth control: the variation looks enormous on the graph, but the absolute values are trivially small. Always check the y-axis scale before concluding that Panel B noise is biologically meaningful. When Panel B noise is large in absolute terms (y-axis spanning a substantial fraction of μ), the Multivariate or Statistical approaches should be preferred.
True instantaneous derivatives require continuous functions. Real OD data is sampled at discrete timepoints. The calculator approximates the first derivative at each timepoint using ordinary least squares (OLS) linear regression over a short sliding window of 3 consecutive timepoints. The slope of that fitted line is the derivative estimate at the center timepoint.
This is called a finite difference approximation — standard practice in numerical analysis. The 3-point window is small enough to be locally responsive (capturing rapid changes) but large enough to reduce the impact of individual noisy readings.
Any noise visible in Panel B at early timepoints — where the flat line appears to wobble — reflects real measurement noise in the OD readings. At low OD values, small absolute fluctuations create large proportional changes in ln(OD), amplifying noise in the d(ln OD)/dt estimate. As OD builds, signal-to-noise improves and Panel B stabilizes.
Loading Example 4 (pure noiseless exponential growth, no deviation) demonstrates the theory:
Loading Example 5 (noiseless exponential with a sharp theoretical deviation at t = 120 min) shows:
Alongside the landmark-based detection approaches discussed above, this calculator also computes two whole-curve summary metrics from the literature: the Virulence Index (VI) of Storms et al. (2020) and the Centroid Index (CI) of Hosseini et al. (2024). Both are based on the area under the curve (AUC) and require a phage-free control curve for computation. They are included for compatibility with the existing literature and for users who wish to compare results to published work.
Raw AUC is computed by trapezoidal integration of (time, OD) over a defined window. The integration baseline is y = 0 (matching the conventions of both Storms 2020 and Hosseini 2024).
Virulence Index is defined as VI = 1 − (AUCtreatment / AUCcontrol). For an ideally effective phage that completely prevents bacterial growth, AUCtreatment = 0 and VI = 1. For a phage with no effect (treatment curve identical to control), VI = 0. VI does not consider when the area accumulates; only how much area accumulates overall.
Centroid Index uses the centroid (x̄, ȳ) of the region under each curve. The centroid coordinates carry information about both how much OD-mass accumulated (ȳ) and when in the experiment it accumulated (x̄). CI is defined as CI = 1 − (x̄t · ȳt) / (x̄c · ȳc). This makes CI sensitive to late regrowth: a treatment curve with substantial post-lysis bacterial regrowth has its centroid pulled toward later times (higher x̄), producing a lower CI even if the simple AUC ratio (VI) would be similar.
The classical use of VI and CI integrates from t = 0 to the end of the experiment. We additionally compute both indices over three landmark-anchored windows:
Plus a user-adjustable fifth window in the calculator interface, allowing free exploration of integration limits.
The windows often give quite different VI and CI values for the same data — illustrating directly the "limit selection" sensitivity that Ceballos and Stacy (2021) identify as a fundamental weakness of AUC-based metrics.
The lower anchor in landmark-anchored AUC windows is TD (threshold deviation) — the time at which d(OD)/dt has dropped by τ% from its peak. TD is used everywhere in the calculator as the universal deviation comparative for one practical reason: it is the only deviation estimator that can be produced by every detection approach this calculator supports. The Univariate approach can produce both DO (deviation onset, d²(OD)/dt² = 0) and TD; the Multivariate and Statistical approaches produce only TD; and the Sim Data tab's simulator produces only TD (its noise-free curves do not admit a meaningful Univariate calculus DO, since d²(OD)/dt² zero-crossing is ill-defined on a smooth curve). For cross-approach and cross-tab consistency, the only common landmark across all of these is TD, so TD is what the calculator uses as the AUC window anchor everywhere.
Mechanistically, TD is slightly later than DO: TD fires once the slope has dropped by τ% from its peak, while DO fires at the inflection (peak slope) itself. Both are valid "phage zero points" for AUC purposes; TD is simply the one with universal availability. On real Time-Kill data where Univariate also runs, DO and TD typically differ by half a sampling interval to a few sampling intervals depending on τ — small enough that the resulting VI and CI values are quite similar in either choice.
The conventional Storms 2020 and Hosseini 2024 implementations integrate from y = 0. Mathematically clean, but biologically the "from y = 0" choice means the AUC also includes the substantial OD that exists below the phage-attributable signal — the residual turbidity that any bacterial culture contributes simply by being present, plus the broth itself, plus any post-lysis floor that remains. A more biologically motivated baseline would be the minimum OD observed after phage activity has begun — i.e., the lysis floor, or whatever the curve settles to between deviation onset and end-of-lysis. Integrating from this baseline strips away the residual turbidity and measures only the area above the floor — the bacterial biomass that phage still has to deal with, in OD-time units.
The calculator offers four baseline modes via radio buttons at the top of the AUC card: (1) y = 0 (literature default), (2) y = min OD post-deviation (the biological baseline), (3) Show both (renders both tables side-by-side for comparison), and (4) User-defined (set by hand — useful, e.g., for the OD of sterile broth, around 0.04 in many systems). Non-zero baselines use clip-to-zero arithmetic: any region of the curve falling below the baseline contributes zero area, with the curve-baseline crossing point computed exactly via linear interpolation. This matches the "area above the floor" interpretation.
Like the window choice, the baseline choice is itself a free parameter — different baselines will give different VI and CI values, sometimes substantially so. The "Show both" mode makes this sensitivity directly visible. None of these choices has a single "right" answer; what they have are different biological interpretations.
VI and CI are whole-curve summary statistics. As such, they cannot distinguish bacterial killing from post-extinction regrowth of phage-resistant bacteria, they conflate multiple temporally distinct biological events (pre-deviation growth, deviation, lysis, post-lysis), and their values depend strongly on the integration window. Negative CI values can occur and are not errors — they indicate that the phage-treated curve had higher OD-weighted mass than the control, which typically signals substantial bacterial regrowth.
The landmark-based deviation framework that is the focus of this calculator addresses these limitations directly by identifying specific moments on the OD curve (deviation onset, lysis onset, end-of-lysis) rather than integrating across the whole curve. Deviation onset, in particular, is positioned closer in time to the actual phage-mediated bacterial-killing event than is any AUC-based metric. Nevertheless, VI and CI remain useful for cross-study comparison and as quick whole-curve summaries, and are provided here for those purposes.
References:
Supported formats: Excel (.xlsx, .xls) or CSV (.csv)
Data structure: Columns for Time, Control OD, and Treatment OD
Example: Time (min) | Control OD | Treatment OD
Drag and drop your data file, or click to select
Analyzing your data...
Parenthetical values shown alongside each landmark time are the corresponding treatment OD readings — e.g., "28.00 (0.150)" means at time 28 the OD value is 0.150. These are linearly interpolated between samples and provide visual reality checks for landmark placement.
| Metric | Univariate | Multivariate | Statistical |
|---|
Analyze a set of OD curves simultaneously — one time column, N treatment columns, optional control column. Each curve is analyzed independently using Univariate detection (Multivariate when Univariate fails and a control is available). Results appear as a landmark table with one row per curve. Landmark definitions match the main Analyzer tab.
Specialized analysis for experiments combining optical density (OD) measurements with colony-forming unit (CFU) plating in the same run. Loads three curves — phage-free bacterial OD, with-phage OD, with-phage CFU — and addresses two distinct biological questions.
Question 1 — When did bacterial genetic killing occur? (time-kill, loss of colony-forming ability — the genetic / culturability sense of "killing"). The CFU drop is the ground truth: CFUs measure cells that can still divide. The report ranks OD-based candidates (deviation onset, deviation, ODmax, end-of-lysis) by how closely each matches the CFU 10× drop time. Deviation is the leading hypothesis here because, unlike ODmax or end-of-lysis, its timing captures the moment biomass accumulation in the phage-containing culture first lags the control — temporally upstream of any lysis-based observable.
Question 2 — How and when did phages affect bacterial structural wholeness? (cumulative lytic effect on culture biomass — the structural / physical sense of "impact"). This is a different biological question from Q1: cells can be genetically dead (Q1) long before they physically lyse (Q2). Phages first commit cells to death (deviation begins), then later lyse them (OD declines), and eventually extinction of turbidity (end-of-lysis). Q2 has both a temporal component (ODmax, end-of-lysis times) and a magnitude component (VI, CI — AUC-based scalars). There is no CFU equivalent for Q2 — CFU measures viable cells, not turbidity.
The literature has often conflated these two questions, treating AUC-based virulence as if it answers "when did killing happen." It does not — AUC produces a scalar, not a time. The CFU comparison in this report makes the distinction operationally clear.
A downloadable HTML report includes all inputs, outputs, charts, and AI-parsing metadata, suitable for archival, supplementary materials, or upload back to Claude for synthesis across experiments.
Paste data with this column structure (tab- or comma-separated; header row recommended):
Time | "B" OD | Time | "R" OD | Time | "R" CFUs
Each curve may have its own time column (typical for plate-reader and manual experiments where readings are sequential). All six columns are required.
Column meanings: "B" = phage-free bacterial culture; "R" = with-phage culture (R = reaction or resistance-testing); OD = optical density (any units); CFUs = colony-forming units per ml.
About the example datasets: Eighteen datasets organized as two phage groups. Phage T1 (Experiments 1–8): eight chronological single-phage experiments acquired between 2025-12-13 and 2025-12-16 in E. coli B. T1 has a short latent period (~5 min); the OD curve produces a clean lytic peak. These eight experiments establish that deviation onset on the OD curve corresponds to CFU 50% drop time with a mean absolute offset of about 3–5 minutes (n=8). Because T1's latent period is short, ODmax also corresponds reasonably to the CFU 10× drop (~1.6 min mean absolute offset) — this is an expected consequence of short latent period rather than evidence that ODmax is generally reliable. Phage T4 (Experiments 1–5, ten datasets): five paired experiments acquired between 2025-12-05 and 2025-12-12 (chronologically earlier than the T1 series but reported second because T4 introduces the more complex r48-vs-WT comparison) in E. coli B. Each T4 experiment compares T4 r48 (rapid-lysis mutant, short latent period, deep OD lysis trough) against T4 WT (longer latent period, frequently producing a plateau-and-rise OD profile without a clear lytic peak). These five paired experiments demonstrate that when latent period is longer and the OD curve lacks a clean lytic peak, ODmax fails by tens of minutes while deviation-based timings still track CFU killing within ~3–5 min. The within-experiment T4 r48-vs-WT difference in deviation onset is exactly 0.50 min in all five experiments — at the limit of OD sampling resolution — directly demonstrating that deviation captures the bacterial killing event (shared between r48 and WT) rather than the lysis event (which differs by tens of minutes). Together, the T1 and T4 datasets establish that deviation-based detection is latent-period-independent while ODmax-based detection is reliable only for short-latent-period phages. T1 Experiments 1, 4, 5, 6, 7, 8 had below-detection CFU entries excluded; T4 Experiment 3 had spurious zero CFU entries removed. The data loaded by these buttons are the cleaned versions used in the manuscript analysis.
The Phage OD Deviation Calculator implements three detection approaches, described in order from least to most complex. Each is described in the 💡 Concept tab; this tab covers operational details, output interpretation, and guidance on using the calculator effectively.
Univariate Detection operates on the treatment curve alone — no phage-free control is required. It computes the first derivative of OD with respect to time (d(OD)/dt, Panel A of Figure 1) at each timepoint using a short sliding-window OLS regression. During exponential growth this rises continuously; deviation is detected as the first sustained drop from the rising curve. Panel B (d(ln OD)/dt) serves as a noise diagnostic — a flat Panel B confirms clean exponential growth; a noisy Panel B warrants caution. Reliability is measured by the pre-deviation R² (Univariate only) and the noise level (σ/peak slope, comparable between Univariate and Multivariate).
Univariate Detection is most powerful when pre-deviation exponential growth spans a sufficient number of timepoints, and when deviation occurs while growth is still exponential, which is best achieved by starting experiments with log-phase bacteria that are adapted to experimental conditions. See the Concept tab for a discussion of experimental flexibility.
Multivariate Detection requires a phage-free control curve. At each timepoint it computes the first derivative d(OD)/dt (Panel A of Figure 2) for both treatment and control curves. When phage have no effect, both first derivatives track together on the rising curve. Deviation is detected as the first moment the treatment first derivative drops and stays below the control first derivative. Panel B (d(ln OD)/dt for both curves) serves as a noise diagnostic. No curve fitting or assumption about growth shape is required.
Multivariate Detection is most useful when pre-deviation growth is not cleanly exponential (low Univariate R² or high noise level), but the phage-free control curve provides a reliable empirical reference.
Statistical Detection also requires a phage-free control curve. At each timepoint and for each combination of window size, threshold fraction, and minimum consecutive points, the ratio of treatment slope to control slope is tested. When the ratio drops below the threshold and stays there for the required number of consecutive points, a deviation is recorded. This is run across a full grid of parameter combinations — two sub-approaches (stat-raw using raw OD slopes; stat-ln using ln-OD slopes) — and all detections are trimmed and averaged to produce a robust consensus estimate.
Statistical Detection is most useful when data is too noisy for the slope-change calculus of Univariate or Multivariate — the grid sweep and trimming provide robustness against individual noisy readings that would otherwise cause false detections.
The stat-raw and stat-ln sub-approaches are trimmed independently; their trimmed means are combined with equal weight: Statistical = (stat-raw + stat-ln) / 2.
What "0.95 ×μ_peak" means: A threshold of 0.95 means d(OD)/dt must drop below 95% of its peak value to register a sustained-drop event. This is a fraction of the peak first derivative — a multiplicative threshold against a known reference. The same notation now applies to both Univariate and Multivariate (sharing the unified 5%-drop threshold), where Multivariate's cutoff = pre-deviation mean − (1 − 0.95) × peak_treatment_slope, giving the threshold the same meaning of "5% drop from the treatment curve's peak first derivative."
OD_max for each approach: Univariate and Multivariate report the same interpolated zero-crossing of d(OD)/dt — a continuous, calculus-based estimate. Statistical does not use derivatives, so it reports OD_max as the discrete timepoint at which the maximum measured OD occurred — an actual data point. These two definitions agree closely but are not identical (the interpolated zero-crossing may fall between sampling intervals; the discrete max is snapped to a measured timepoint).
Deviation onset (= time of peak d(OD)/dt): Shown for both Univariate and Multivariate since both compute the first derivative of the treatment curve and find its peak. Mathematically, deviation onset is the zero-crossing of d²(OD)/dt² going from positive (growth accelerating) to negative (growth decelerating), which is equivalent to the time at which d(OD)/dt attains its maximum. The two values should match (same curve, same algorithm). Not applicable to Statistical, which doesn't compute derivatives. Caveat: on datasets where the bacterial culture exits mid-log phase before phage-induced lysis (e.g., long plate-reader runs with slow-acting phage), peak d(OD)/dt occurs during the natural deceleration of the host culture, not at the phage event. Univariate cannot distinguish these cases on its own; Multivariate, which uses the phage-free control curve to subtract out natural deceleration, is the appropriate approach for such datasets.
Pre-deviation R²: Shown for Univariate only. Measures how flat the d(OD)/dt slope series is during the pre-deviation period — high values (e.g. >0.85) indicate clean exponential growth and reliable detection; low values indicate that the treatment curve was not cleanly exponential before deviation. R² is not shown for Multivariate because Multivariate's regression-of-slope-differences metric is structurally low even for excellent data (see Math tab §4 for full explanation).
Noise level (σ / peak slope): A directly comparable noise metric for both Univariate and Multivariate. Computed as the standard deviation of slope values in a ±5-point window around the peak slope, divided by the peak slope. The window is positioned where the slope is approximately constant (at its maximum), so variation within it represents noise rather than the rising trend of exponential growth. Lower is better: ~0% = essentially noiseless; 5–10% = mild noise; 25%+ = noisy. Multivariate combines noise from two independently noisy curves, so its noise level is typically higher than Univariate on the same data.
Std dev (across methods): Shown only for Statistical Detection, where the threshold × window-size grid produces multiple deviation-time estimates whose spread is informative. For Univariate and Multivariate (which use a single shared 5% threshold), all methods within an approach return the same interpolated crossing time — the spread is zero by construction, which is not informative, so the row is omitted for those approaches.
AUC-based analysis (4th column): Three whole-curve summary metrics are computed alongside the landmark-based deviation detection: raw AUC (the trapezoidal area under each curve), Virulence Index (VI) per Storms et al. 2020, and Centroid Index (CI) per Hosseini et al. 2024. Each is computed over three integration windows: 0 → end of data (the traditional whole-experiment window), 0 → end-of-lysis (excludes post-extinction bacterial regrowth), and TD → end-of-lysis (isolates the phage-active phase, anchored at threshold deviation — the universal cross-approach deviation comparative used everywhere in this calculator). Raw AUC is always computed; VI and CI require a phage-free control curve. VI = 1 − (AUC_treat / AUC_ctrl), ranging from 0 (no impact) to 1 (perfect killing). CI = 1 − (x̄_t · ȳ_t) / (x̄_c · ȳ_c), additionally sensitive to when in the experiment the OD-mass was distributed (later mass — e.g., regrowth — penalizes the index). Negative CI values are displayed as-is and indicate the phage-treated curve had higher OD-weighted mass than the control (typically due to substantial bacterial regrowth). These AUC-based metrics are useful for comparison with the existing literature but have known limitations (whole-curve summaries cannot distinguish phage-mediated bacterial killing from later regrowth of phage-resistant bacteria; they conflate multiple temporally distinct biological events; and they depend strongly on the integration window). The landmark-based deviation detection in columns 2–4 addresses these limitations directly by isolating specific time points rather than integrating across the whole curve.
The results table shows four columns — Metric | Univariate | Multivariate | Statistical — for each curve analyzed. Deviation times for Univariate and Multivariate are computed using first-derivative (d(OD)/dt) interpolation and the halfway method described above. Pre-deviation R² (Univariate only) indicates how cleanly exponential pre-deviation growth was; noise level (σ/peak slope) is shown for both Univariate and Multivariate for direct comparison. When all three approaches agree closely, you have strong multi-method evidence for the deviation time. When they disagree, the pattern is informative:
If a reference curve is loaded it is automatically analyzed, and its results table appears directly below the treatment table for easy comparison.
The phage-bacterial OD curve is best understood as a sequence of three calculus landmarks, each marking a distinct biological event:
This calculator reports all three. The deviation onset is reported in two flavors: "earliest" (calculus-based midpoint) and "threshold" (interpolated 5%-drop crossing). Lysis onset is reported as both the interpolated zero-crossing (calculus-based) and the discrete OD maximum (data-based). End-of-lysis is reported as the midpoint of the bracket around the minimum d(OD)/dt.
Why threshold-based detection matters: The threshold-based deviation time (midpoint of the bracket where d(OD)/dt drops below threshold×μ_peak for ≥ minConsec consecutive points) serves two purposes: (1) it is directly comparable within an approach across experiments — since both Univariate and Multivariate use the same bracket-midpoint logic, threshold times from the same approach can be compared across datasets; (2) it is more robust than the "earliest" estimate for data that is continuous or nearly continuous, where the first derivative decreases gradually rather than dropping sharply — a threshold requirement prevents detecting trivially small initial drops. The "earliest" estimate (Univariate only) gives the theoretical lower bound but has no Multivariate equivalent because the difference series in Multivariate is doubly noisy.
Expected ordering of estimates: earliest ≤ threshold ≤ OD_max. The earliest estimate should never be later than the threshold estimate; the threshold estimate should never be later than OD_max (the zero-crossing). This ordering is mathematically expected: the "earliest" fires at the first drop from peak, the threshold fires only after a sustained drop, and OD_max is where the curve has already peaked. Violations of this ordering indicate data quality issues.
OD_max is defined as the time at which the first derivative d(OD)/dt crosses zero — computed by linear interpolation between the last timepoint where d(OD)/dt > 0 and the first timepoint where d(OD)/dt < 0. This gives a continuous time estimate, not restricted to a measured timepoint. The threshold-based deviation time is computed as the interpolated crossing time: linear interpolation between the last above-threshold and first below-threshold timepoints gives the exact time where d(OD)/dt crosses the threshold. This is a continuous estimate independent of the sampling interval — deviation is not forced to occur at a measured timepoint. The threshold and minimum-consecutive parameters are still used to confirm the sign change is real (not a single noisy point), but the reported time is always this midpoint.
Note: by default, these individual-method tables are hidden to reduce clutter; they are revealed on user request via the "Show Statistical Detection Method Details" toggle in the results display.
Green cards show Statistical Detection methods included in the trimmed mean; red cards show excluded outliers. Stat-raw and stat-ln methods are displayed in separate side-by-side grids. This transparency lets you assess consensus quality and identify any outlier parameter combinations.
Figure 1 shows two side-by-side panels for the treatment curve:
Vertical markers across both panels indicate the calculus-based "earliest" deviation (orange), the threshold-based deviation (green), OD_max (purple), and end-of-lysis (red). The same set of markers appears on Multivariate Figure 2 below.
The x-axis range can be adjusted via the X-min and X-max controls in the Figure 1 and Figure 2 toolbars; both endpoints synchronize across the two figures for direct comparison. X-min cuts off the early portion of the curve (the rising exponential phase); X-max cuts off the late portion (post-lysis). Useful for zooming in on the peak region when investigating ODmax divergence or end-of-lysis timing.
Traditional time-kill curves measure bacterial viability by plating at coarse intervals (typically 30 min to several hours). This coarseness is a feature when the goal is a qualitative distinction — culture alive vs. culture dead — and a limitation when the goal is precise timing. Time-kill methodology has traditionally all but abandoned timing precision in favor of robust binary outcome scoring.
OD-based deviation detection inverts this trade-off. Because OD is measured continuously and at high frequency, and because deviation timing is computed via interpolation rather than snapped to a measured timepoint, deviation gives a quantitative, sub-sampling-interval estimate of when phage killing first manifests in population dynamics. The "earliest" estimate captures the most sensitive possible detection; the "threshold" estimate (5% drop from peak) provides a more robust, consistent landmark that allows direct comparison across approaches and between datasets. Both are continuous in time.
An important caveat: deviation at threshold occurs later than the earliest detectable departure from exponential growth, and therefore corresponds to a state in which somewhat more bacteria have been productively infected than at the earliest point. Whether this matters depends on the question — for comparing phage-host pairs the threshold estimate is reproducible and comparable; for inferring the absolute earliest kinetics, the calculus-based "earliest" estimate is more sensitive.
Unless deviation is defined very late (e.g., at or near OD_max), deviation onset does not mean that all (or even a majority of) phage-sensitive bacteria have been infected. Rather, it marks some aspect of the start of that process — the moment when biomass accumulation in the phage-containing culture first measurably lags that of the phage-free control. By the time of deviation onset, only a fraction of bacteria may yet have been productively infected; the rest will be infected over the remaining course of the experiment.
Caveat: this interpretation may apply less directly to phages whose infection does not substantially impact bacterial replication rates during the infection — for such phages, deviation timing reflects more directly the timing of lysis itself than the timing of bacterial death-commitment.
An important consideration for Multivariate and Statistical Detection: when bacterial cultures are older at the point of deviation — i.e., the phage-free control curve has begun to deviate from clean exponential growth due to nutrient depletion, density-dependent slowing, or stationary-phase entry — it can take a very long time before the treatment curve reaches OD_max or undergoes the lysis-to-extinction transition. Multi and Statistical Detection compare treatment against a control whose own dynamics are no longer exponential, which complicates their interpretation. In such cases, Univariate Detection (which uses only the treatment curve and seeks its own inflection point) is often more reliable, since it does not require the control to be cleanly exponential at the deviation point.
When the calculator detects no deviation from exponential growth — that is, when the slope d(OD)/dt does not drop persistently below its peak value — this is itself an important diagnostic result, not a failure of detection. A no-deviation outcome strongly suggests one of:
The first interpretation — null phage impact — is biologically informative and worth reporting in its own right. In phage-bacterial screening, a clean "no deviation" outcome distinguishes ineffective phage-host pairs from those producing measurable killing, even before considering quantitative deviation timing.
Starting with log-phase (exponentially growing) bacteria produces cleaner pre-deviation OD curves and more reliable deviation detection. OD rises almost immediately from inoculation, the slope series reaches a clear plateau quickly, and there is less ambiguity about where the pre-deviation phase begins. A one- or two-timepoint instrument-settling artifact at t=0 is normal and does not affect detection.
Window sizes for Statistical Detection are automatically adjusted based on data spacing:
For questions, bug reports, or methodology discussions: deviation@phage.org
To cite this tool: Abedon, S.T. (2026). Phage OD Deviation Calculator. deviation.phage.org. 10.5281/zenodo.19023877
Additional manuscripts describing the computational methodology and validation of the Deviation approach are in preparation.
A precise account of how the Phage OD Deviation Calculator detects the three landmarks of the phage-bacterial OD curve — deviation onset, lysis onset (OD_max), and end-of-lysis — together with the quality metrics, parameters, and pseudocode, suitable for methods sections and peer review.
The calculator analyzes a phage-bacterial optical-density (OD) curve to extract three biologically meaningful landmarks corresponding to successive features of the second derivative d²(OD)/dt²:
Deviation onset is the operationally most informative landmark for inferring phage time-kill, since it precedes the latent-period delay inherent in lysis-based detection. All three landmarks are reported in the results table.
Three detection approaches are implemented for deviation onset: Univariate Detection (single-curve, first-derivative-based), Multivariate Detection (two-curve, first-derivative-based), and Statistical Detection (two-curve, slope-ratio grid). All three are run when a phage-free control curve is provided; only Univariate Detection runs without one. Figures 1 and 2 in the Analyzer show Panel A (d(OD)/dt, used for detection) and Panel B (d(ln OD)/dt, noise diagnostic) for Univariate and Multivariate respectively.
Control and treatment OD time series are extracted from the uploaded file. If separate time columns are provided, the treatment series is interpolated onto the control time grid using linear interpolation. A minimum of 10 valid timepoints is required.
For all three approaches, local slopes are estimated using a 3-point sliding window of ordinary least-squares (OLS) linear regression. For a given window size W and timepoint i:
slope = (n·ΣxᵢYᵢ − ΣxᵢΣYᵢ) / (n·Σxᵢ² − (Σxᵢ)²) // OLS
For Univariate and Multivariate Detection, this window is fixed at 3 points. For Statistical Detection, window sizes target 15, 30, and 45 minutes of elapsed time.
Operates on the treatment curve alone. Detects the first inflection point of OD — equivalently, the peak of d(OD)/dt — and reports it in two flavors (earliest and threshold-based). Also computes lysis onset (zero-crossing of d(OD)/dt) and end-of-lysis (minimum of d(OD)/dt).
// Step 1: Compute d(OD)/dt at each timepoint (3-point OLS on raw OD) localSlope[i] = OLS slope of OD_treatment over points [i-3..i] // Also compute d(ln OD)/dt for noise diagnostic (Panel B) lnSlope[i] = OLS slope of ln(OD_treatment) over points [i-3..i] // Step 2: Training window = first 25% of timepoints fitEndIdx = floor(n × 0.25) // Step 3: Find peak d(OD)/dt in first 75% of data (= deviation onset landmark) μ_peak = max(localSlope[i] for i ≤ 0.75·n) t_peak = time at which μ_peak occurs // Step 3b: Zero-crossing of d(OD)/dt (= lysis onset = OD_max) t_lysisOnset = linear interpolation between last-positive and first-negative slope // Step 3c: Minimum of d(OD)/dt after lysis onset (= end-of-lysis) t_endOfLysis = midpoint of bracket around min(localSlope[i] for i > t_lysisOnset) // Step 4: Correlation coefficient R² of pre-peak slope series (quality metric) R² = flatness of slope series up to peak (0–1; higher = cleaner exponential growth) // Step 5: Detect first sustained drop below threshold × μ_peak // Thresholds: 0.75, 0.85, 0.95 × μ_peak // minConsecutive: 2, 3, ... (at least 2 required) // Report first timepoint of sustained run // Step 6: Trimmed mean across threshold × minConsecutive grid trimCount = ceil(n × 0.25) from each end uniMean = mean of included deviation times
Requires phage-free control curve. Detects when the slope of the difference between treatment and control ln-OD first drops persistently below zero.
// Step 1a: Compute d(OD)/dt for both curves (3-point OLS on raw OD) → Panel A treatLinSlope[i] = OLS slope of OD_treatment over points [i-3..i] ctrlLinSlope[i] = OLS slope of OD_control over points [i-3..i] // Step 1b: Compute d(ln OD)/dt for both curves → Panel B (noise diagnostic) lnDiff[i] = ln(OD_treatment[i]) − ln(OD_control[i]) diffSlope[i] = OLS slope of lnDiff over points [i-3..i] // Step 2: Training window = first 25% of timepoints // During pre-deviation phase, diffSlope ≈ 0 (both growing at same rate) // Step 3: Characterize training slope series μ̄ = mean(diffSlope in training window) // ≈ 0 pre-deviation σ = SD(diffSlope in training window) // noise floor R² = NOT computed for Multivariate (structurally low; see Math tab §4) // Noise level = SD(diffSlope) / peakTreatSlope (relative noise, comparable to Uni) // Step 4: Detect first sustained drop below μ̄ − k×σ // k = 1.0, 1.5, 2.0; minConsecutive ≥ 2 // Report first timepoint of sustained run // Step 5: Trimmed mean across k × minConsecutive grid
Requires phage-free control curve. Runs two sub-approaches (stat-raw and stat-ln) across a full parameter grid and takes a trimmed mean consensus.
// For each window size W ∈ {W₁₅, W₃₀, W₄₅}:
// For each threshold T ∈ {0.75, 0.85, 0.95}:
// For each minConsecutive C:
// Compute treatmentSlope[i] and controlSlope[i] (OLS over W points)
// ratio[i] = treatmentSlope[i] / controlSlope[i]
// Flag timepoint when: ratio < T AND controlSlope > 0
// Deviation = first timepoint of ≥ C consecutive flags
// → one method result per (W, T, C, approach)
// stat-raw: OLS on raw OD values (absolute growth rate)
// stat-ln: OLS on ln(OD) values (specific growth rate; skipped if any OD ≤ 0)
// Trimming per sub-approach:
sorted = methods.sort(ascending by deviationTime)
trimCount = ceil(n × 0.25)
included = sorted[trimCount … n − trimCount]
rawMean = mean(included stat-raw times)
lnMean = mean(included stat-ln times)
// Combined Statistical mean:
statMean = (rawMean + lnMean) / 2 // equal-weighted
| Parameter | Default | Derivation |
|---|---|---|
| Window sizes (W) | Auto: targets 15, 30, 45 min | max(3, round(target / avgSpacing)) |
| Thresholds | 0.75, 0.85, 0.95 | Fixed; user-adjustable ±0.05 |
| Min consecutive (C) | Auto: derived from window size | max(2, round(W / 4)) |
| Trim fraction | 25% from each end, per sub-approach | ceil(n × 0.25) independently |
| Control slope guard | controlSlope > 0 required | Prevents detection during flat/declining control |
To cite this tool: Abedon, S.T. (2026). Phage OD Deviation Calculator. deviation.phage.org. https://doi.org/10.5281/zenodo.19023877
Development preview — not yet publicly linked
This tab implements two functions for kinetic optical density-based phage titer estimation (KOTE assays). Calibration Generator: upload OD curves with known titers (at one, two, or three bacterial concentrations) to produce a reusable calibration JSON encoding the best-performing metrics and their regression parameters. Titer Estimator: load a calibration JSON and upload an unknown OD curve to obtain an ensemble titer estimate weighted across all qualifying metrics.
Upload one CSV per bacterial concentration. CSV format: first column
Time_min, then one column per known titer with the titer value
(PFU/ml) as the column header. Include a column headed 0 or
control for the no-phage control. Each OD value should be the
mean of technical replicates. Up to three bacterial concentrations supported.
Development preview — not publicly linked
Upload or paste output from a phage–bacteria population dynamics model. The calculator synthesizes a simulated culture density curve (B + infected cells), treats B(no phage) as the control, and applies the full deviation-detection algorithm — reporting all landmarks just as the Analyzer tab does for real OD data. All four model variables are plotted together on a shared axis (cells/ml or PFU/ml).
Coupled recurrence equations for phage-bacteria dynamics with delayed lysis (Bull, in preparation). Output TSV is in Jim's standard format and loads directly into the analysis pipeline below.
Sim Data JSON (canonical format, produced by this calculator or Jim's model):
{"model_parameters":{"k":…,"b":…,"L":…},"data":[{"time":…,"B_nophage":…,"B_uninfected":…,"Pf":…,"inf_cells":…},…]}
Jim-format TSV (auto-detected by k=…b=…L=… header line):
Row 1: model parameters · Row 2: column headers ·
Remaining rows: time=X.X B(no phage) = X B=X Pf=X inf_cells=X
Plain CSV or TSV — five columns, header row required:
time, B_nophage, B_uninfected, Pf, inf_cells (matched case-insensitively)
All concentrations assumed cells/ml (bacteria) or PFU/ml (free phage).
This tab analyzes simulation data across multiple initial phage densities (P₀). To use it: open the Sim Data tab and load a multi-titer Jim-format TSV file — one with multiple "Initial phage density = …" delimited blocks (e.g., the SA2.tsv format, which stacks six simulations at k, b, L fixed and steps P₀ through 10², 10³, 10⁴, 10⁵, 10⁶, 10⁷).
Once such data is loaded, this tab will display: