×
Overview
The Phage OD Deviation Analyzer objectively identifies the time when a treatment curve (e.g.,
phage-infected bacteria) begins to measurably diverge from a control curve (uninfected bacteria).
This eliminates subjective visual assessment and provides reproducible, quantitative deviation detection.
Core Algorithm: Slope-Based Divergence Detection
1. Slope Calculation
For each timepoint, the algorithm calculates local slopes using a sliding window linear regression:
- Window Size: Number of consecutive timepoints used for regression (e.g., 5 points)
- Control Slope: Growth rate of the control culture at that timepoint
- Treatment Slope: Growth rate of the treatment culture at that timepoint
2. Ratio Comparison
At each timepoint, the algorithm computes:
Slope Ratio = Treatment Slope / Control Slope
When this ratio drops below a threshold (e.g., 0.8 = treatment growing at <80% the rate of
control), a potential deviation is flagged.
3. Sustained Deviation Requirement
To avoid false positives from transient noise, deviation must be sustained for a minimum number of
consecutive timepoints (e.g., 3–5 points). The first timepoint of this sustained period is reported
as the deviation time.
Trimmed Mean Consensus Approach
Why Multiple Parameter Methods?
No single set of parameters (window size, threshold, minimum consecutive) works optimally for all datasets. Different parameters may be appropriate for:
- Different sampling frequencies (every 1 min vs every 10 min)
- Different noise levels in the data
- Different rates of deviation (rapid lysis vs gradual growth inhibition)
The Trimmed Mean Solution
The algorithm runs with multiple parameter combinations (typically 18–27 different methods), then:
- Sorts all deviation times from earliest to latest
- Drops the top 25% (outliers that detected too late)
- Drops the bottom 25% (outliers that may have detected noise)
- Averages the middle 50% to get a robust consensus estimate
This approach provides both a consensus deviation time and a measure of uncertainty (standard
deviation), making results more reproducible across different datasets.
Auto-Parameter Adjustment
The tool automatically adjusts parameters based on your data characteristics:
- Data Spacing: Tightly-spaced data (e.g., 1–5 min intervals) uses smaller windows; sparse data (10+ min intervals) uses larger windows
- Target Duration: Windows are sized to cover approximately 15–45 minutes of actual time, regardless of sampling frequency
Biological Interpretation
What Does Deviation Represent?
Deviation detection captures an intermediate milestone in phage-bacteria ecological dynamics:
- Occurs after: Initial bactericidal activity (uninfected cell count begins declining)
- Occurs before: Complete lysis (visible OD drop to baseline)
- Timing: Typically occurs approximately one latent period after infection begins
Deviation vs. Colony-Forming Units (CFU)
OD-based deviation metrics complement traditional CFU time-kill curves:
- CFU: Measures loss of colony-forming ability (bactericidal activity)
- OD Deviation: Measures disruption of population growth dynamics
- Both Together: Provide comprehensive assessment of phage antibacterial activity
Recommended Usage
Data Requirements
- Minimum 10 timepoints with valid numeric data in both control and treatment columns
- Works with both automated measurements (every 1–10 minutes) and manual measurements (sparse timepoints)
- Supports separate time columns for control and treatment — data will be automatically interpolated to a common grid using the control timepoints as reference
- Handles duplicate column headers (e.g., multiple "Time" columns) — they will be automatically renamed
Parameter Adjustment Guidelines
- If detection is too early: Use the "🔽 Lower Thresholds" button to reduce sensitivity (detects later). Lower threshold values = less sensitive to small changes.
- If detection is too late: Use the "🔼 Raise Thresholds" button to increase sensitivity (detects earlier). Higher threshold values = more sensitive to small changes.
- For manual fine-tuning: Use the "📋 Copy Thresholds" button to copy current values, then paste and adjust them manually in the Threshold Range box.
- For very noisy data: Increase window sizes or increase minimum consecutive points.
Output Interpretation
Results Summary
- Trimmed Mean Deviation Time: Consensus estimate (in minutes)
- Standard Deviation: Uncertainty/variability across methods (±minutes)
- Range: Earliest to latest detection among included methods
Individual Method Results
Green cards show methods included in the trimmed mean; red cards show excluded outliers. This transparency allows you to assess consensus quality.
Visualizations
- Top Chart (Deviation Focus): Zoomed view emphasizing the deviation timepoint
- Middle Chart (Lysis Focus): Extended view showing complete lysis (appears only if data extends significantly beyond deviation)
- Bottom Chart (Full Range): Complete treatment data for context
Comparing Multiple Treatments
To compare multiple treatments against the same control:
- Run the analysis separately for each treatment in different browser tabs
- Use the "📋 Copy Thresholds" button to ensure you use the same threshold values across all analyses (important for valid comparisons)
- Download results as CSV for each treatment
- Compile and compare deviation times in a spreadsheet
This approach allows flexible comparison of any number of treatments while keeping each analysis focused and clear.
Contact & Support
For questions, bug reports, or methodology discussions, contact: deviation@phage.org
Citation
Manuscript in preparation. Check back for publication details.
To cite this tool: Abedon, S.T. (2026). Phage OD Deviation Analyzer. deviation.phage.org.
10.5281/zenodo.19023878
Additional manuscripts describing the computational methodology and validation of the Deviation approach are in preparation.
Version 2026.04.07