This project implements a comprehensive parameter fitting pipeline for an oncolytic vaccinia virus model based on Zhou et al. (2024) Cancer Science data on neutrophil-virus interactions and tumor treatment.
The model consists of a 4-compartment ODE system:
dT/dt = λT - βTV
dE/dt = βTV - kE
dI/dt = kE - δI
dV/dt = pI - cV
Where:
- T = Uninfected tumor cells (mm³)
- E = Eclipse phase infected cells
- I = Infectious cells
- V = Virus particles (pfu)
- λ = Tumor growth rate (1/day)
- β = Infection rate (1/(pfu·day))
- k = Eclipse → infectious transition rate (1/day)
- δ = Infected cell death rate (1/day)
- p = Virus production rate (pfu/day)
- c = Virus clearance rate (1/day)
The fitting is performed in 3 sequential steps:
Method: Literature-based value
- Value: δ = 1.0 per day (0.042 per hour)
- Range: 0.5-2.0 per day for vaccinia virus
- Sources: Canine et al. (2016), Workenhe et al. (2014)
- Rationale: Figure 4B contains viral DNA abundance (which increases with replication), not cell viability (which should decrease monotonically). Since proper in vitro cell viability time-course data is not available in the paper, we use a well-established literature value.
- Output: δ (kept FIXED for subsequent steps)
- Note: If in vitro viability data becomes available, δ can be fitted using exponential decay model T(t) = T₀ × exp(-δt)
Data: data_figure_1B.csv (Neutrophils+VV treatment)
- Model: ODE system with λ=0 (no tumor growth, in vitro)
- Initial conditions: [T, E, I, V] = [1.0, 0.0, 0.0, 0.01]
- Fixed: δ (from Step 1)
- Fit: β, k, p, c
- Output: c (kept FIXED for Step 3)
Data: data_figure_4F.csv (tumor volumes, 4 treatments)
- Model: Full ODE system with tumor growth
- Treatments: PBS, VV, LY6G, LY6G+VV
- Initial conditions: [T, E, I, V] = [50.0, 0.0, 0.0, 0.0]
- Virus dosing: 3×10⁷ pfu IV every 2 days starting day 7
- Fixed: δ (Step 1), c (Step 2)
- Fit: λ, β, k, p (separately for each treatment)
python >= 3.8
numpy
pandas
scipy
matplotlibpip install numpy pandas scipy matplotlibpython run_all_steps.pyThis will execute all three fitting steps in sequence.
# Step 1: Cell death rate
python step1_cell_death_rate_estimation.py
# Step 2: Viral dynamics
python step2_viral_dynamics_fit.py
# Step 3: Tumor growth
python step3_tumor_growth_model.pyNote: Steps must be run in order as later steps depend on parameters from earlier steps.
.
├── README.md # This file
├── utilities.py # Common functions and ODE system
├── run_all_steps.py # Master script to run all steps
│
├── step1_cell_death_rate_estimation.py # Step 1: Fit δ
├── step2_viral_dynamics_fit.py # Step 2: Fit β, k, p, c
├── step3_tumor_growth_model.py # Step 3: Fit λ, β, k, p
│
├── data_figure_4B.csv # Cell viability data
├── data_figure_1B.csv # Viral dynamics data
├── data_figure_4F.csv # Tumor volume data
│
└── outputs/ # Generated outputs
├── step1_*.png/pdf # Figures
├── step2_*.png/pdf
├── step3_*.png/pdf
├── step*_fitted_parameters.txt # Human-readable parameters
├── step*_results_summary.txt # Comprehensive results
└── step*.npy # Machine-readable data
step1_cell_death_rate_fit.png/.pdf- Exponential decay fit (linear + log scale)step2_viral_dynamics_fit.png/.pdf- Viral dynamics fit (linear + log scale)step3_tumor_growth_PBS.png/.pdf- PBS treatment fitstep3_tumor_growth_VV.png/.pdf- VV treatment fitstep3_tumor_growth_LY6G.png/.pdf- LY6G treatment fitstep3_tumor_growth_LY6G_VV.png/.pdf- LY6G+VV treatment fitstep3_tumor_growth_comparison.png/.pdf- All treatments comparison
step1_fitted_parameters.txt- δ (hourly and daily)step2_fitted_parameters.txt- β, k, p, c (hourly and daily)step3_fitted_parameters_*.txt- λ, β, k, p for each treatment (daily)
step1_results_summary.txt- Complete Step 1 resultsstep2_results_summary.txt- Complete Step 2 resultsstep3_results_summary_*.txt- Complete Step 3 results per treatmentstep3_all_treatments_summary.txt- Parameter comparison table
step1_delta_fitted.npy- δ valuestep2_*.npy- β, k, p, c values
- Method: L-BFGS-B (bounded optimization)
- Parameter space: Log₁₀ transformed
- Objective function: Sum of squared residuals (SSR) on log₁₀ scale
- Convergence criterion:
ftol = 1e-12
- Solver:
scipy.integrate.odeint(LSODA) - Segmented solving: Implemented for repeated virus injections in Step 3
Publication-quality figures with:
- Background: #E8E8F0 (light gray)
- Data points: #2E5CB8 (blue), size 100
- Model lines: Same blue, width 2.5
- Grid: White, subtle (α=0.25)
- Font: Arial/Helvetica, 11-13pt
- Spines: Gray, width 1.5
- ✓ Full docstrings (NumPy style)
- ✓ Type hints throughout
- ✓ Modular function design
- ✓ Comprehensive error handling
- ✓ Professional naming conventions
- ✓ Publication-quality outputs
All functions include:
- Purpose description
- Parameter specifications
- Return value descriptions
- Units and mathematical formulas
Based on Zhou et al. (2024) Cancer Science:
- Figure 1B: Neutrophils+VV viral dynamics (4-6 hours) - used in Step 2
- Figure 4B: Viral DNA abundance (NOT used - shows viral replication, not cell viability)
- Figure 4F: Tumor volumes for all treatments (days 7-19) - used in Step 3
- PBS: 3 time points (days 7, 11, 14)
- VV: 5 time points (days 7, 11, 14, 15, 16)
- LY6G: 5 time points (days 7, 11, 14, 15, 16)
- LY6G+VV: 7 time points (days 7, 11, 14, 15, 16, 18, 19)
- Literature: Infected cell death rate δ (Canine et al. 2016, Workenhe et al. 2014) - used in Step 1
If you use this code, please cite:
Zhou et al. (2024). [Full citation to be added]
Cancer Science.
PhD-level implementation Date: January 2025
[Specify license here]
[Add contact information]
- All parameters are fitted on log₁₀ scale for numerical stability
- SSR (sum of squared residuals) is calculated on log₁₀ scale
- Virus injections in Step 3 are implemented via segmented ODE solving
- Parameter bounds are carefully chosen based on biological plausibility
- Convergence should be verified for each optimization
Issue: FileNotFoundError for step1 or step2 .npy files
Solution: Run previous steps first. Steps must be executed in order.
Issue: Optimization not converging Solution: Adjust initial guesses in the respective step files. Check data loading.
Issue: Figures look different from examples Solution: Ensure Arial/Helvetica fonts are installed. Check matplotlib version.
Issue: Import errors
Solution: Install all required packages: pip install numpy pandas scipy matplotlib
Potential extensions:
- Bootstrap or MCMC for confidence intervals
- Sensitivity analysis for parameter identifiability
- Cross-validation between treatments
- Extended model with immune cell dynamics
- Comparison with alternative ODE formulations