This repository contains the mathematical models, simulations, and correlation analyses used to investigate the dynamic interplay between stress-related and inflammation-related metabolites, along with microbiome-metabolite associations.
- LVmodel.py – Implements a Lotka-Volterra-inspired model of stress and inflammation dynamics.
- VDPmodel.py – Implements the Van der Pol oscillator model for non-convergent, non-linear dynamics.
- Correlation.py – Performs Spearman Rank Correlation analysis between microbiome taxa and metabolite abundances.
This model consists of two coupled differential equations:
dX/dt = A·X - B·X·Y
dY/dt = -C·Y + D·X·Y
Where:
X: Pro-inflammatory or pro-stress componentY: Anti-inflammatory or anti-stress componentA: Basal production rate ofXB: Inhibitory effect ofYonXC: Basal removal rate ofYD: Activation effect ofXonY
We also solved for the steady-state using the time-independent formulation:
Aln(Y) - BY + Cln(X) - DX = 0
Model constants were derived using average metabolite abundances and optimized using scikit-learn.
In cases where Lotka-Volterra dynamics failed to converge (i.e., non-periodic or damped oscillations), we applied the Van der Pol oscillator:
x'' - μ·(1 - x²)·x' + x = 0
Where μ controls the damping behavior. Variables were normalized between -1 and 1. First-order ODEs were used:
x' = y
Phase portraits were plotted using matplotlib.
- Input: DataFrames containing metabolite levels and microbial abundances.
- Method: Spearman Rank Correlation (
scipy.stats.spearmanr) - Output: Correlation matrix
- Filter: Correlations with |r| ≥ 0.8 were retained for interpretation.
Install dependencies using pip:
pip install numpy pandas matplotlib scikit-learn