This repository contains the code for reproducing the results from: "In Silico Elucidation of Key Drivers of Staphylococcus aureus-Staphylococcus epidermidis-Induced Skin Damage in Atopic Dermatitis Lesions".
Paper: Lee, J, Mannan, AA, Miyano, T, Irvine AD, Tanaka RJ. In Silico Elucidation of Key Drivers of Staphylococcus aureus-Staphylococcus epidermidis-Induced Skin Damage in Atopic Dermatitis Lesions. JID Innov 2024;4:100269.
DOI: 10.1016/j.xjidi.2024.100269
- Quick Start
- Figure Generation
- Repository Structure
- Complete Workflow
- Data Specifications
- Contact
- License
Software Requirements:
- MATLAB R2021b or later
- Statistics and Machine Learning Toolbox (for violin plots)
- Parallel Computing Toolbox
Hardware Recommendations:
- RAM: 4 GB minimum, 16 GB recommended for full workflow
- Storage: ~5 GB for all data files
- Runtime: ~24 hours for complete analysis (steady state analysis takes ~7 hours)
# Clone the repository
git clone https://github.com/username/SASE-model.git
cd SASE-modelOnce cloned, follow these steps to reproduce the key figures from the paper:
% Navigate to core analysis folder
cd 'Analyse steady states'
% Run complete steady state analysis (~7 hours)
run run_SteadyStates.mOutput: AllVirtualPatientTypes_latest.csv
- Contains 1 million virtual skin sites with steady states analysed
- Each row contains 26 columns: patient ID, number of steady states, 17 sampled parameters (Amax and Emax are fixed at default values), and 7 computed values (3 steady state values, 3 eigenvalues, 1 region classification).
More info: Please refer to Data Specifications for the complete 26 column description and region classification rules.
% Navigate to sub-type visualisation folder
cd '../Group virtual skin sites'
% Generate steady state subtype plots
run run_patient_types.mOutputs: Phase portraits showing SA (x-axis) vs SE (y-axis) populations at steady state, colored by barrier integrity (yellow = undamaged, red = damaged)
PatientTypes_1_SteadyState.png- Sites with 1 steady state (8 subplots)PatientTypes_2_SteadyStates.png- Sites with 2 steady states (21 subplots)PatientTypes_3_SteadyStates.png- Sites with 3 steady states (19 subplots)
Figures:
- Supplementary Figure S1: Uses subplots from the three generated files above (subplots were manually rearranged for publication)
- Figure 2: Characterisation of three main skin types (Asymptomatic, Reversible, Irreversible) based on this analysis
% Navigate to SA-killing treatment folder
cd '../Effect of SA-killing'
% Explore effect of SA-killing treatment
run run_SA_killing_main.m % generates Figure 3b - d in main text
run run_SA_killing_supplementary.m % generates Figure S2 in supplementary materials
run run_SA_killing_example_site.m % generates Figure S3 in supplementary materials Outputs:
Treatment strength varied between 0-5 days-1 and 1-4 days
Figure3_AllSites.png- Treatment response for all virtual skin sites with a damaged skin stateFigure3_Irreversible.png- Treatment response for irreversible sitesFigure3_Reversible.png- Treatment response for reversible sites
Treatment strength varied between 0-10 days-1 and 2-50 days
FigureS2_AllSites.png- Treatment response for all virtual skin sites with a damaged skin stateFigureS2_Irreversible.png- Treatment response for irreversible sitesFigureS2_Reversible.png- Treatment response for reversible sites
Treatment response for one example virtual skin site
FigureS3_PhasePortrait.png- SA and SE population sizes for one example virtual skin siteFigureS3_TreatmentResponse.png- Treatment response for one example virtual skin site
Figures:
- Figure 3b-d: (b)
Figure3_AllSites.png, (c)Figure3_Irreversible.png, and (d)Figure3_Reversible.png - Supplementary Figure S2: (a)
FigureS2_AllSites.png, (b)FigureS2_Irreversible.png, and (c)FigureS2_Reversible.png - Supplementary Figure S3: (a)
FigureS3_PhasePortrait.pngand (b)FigureS3_TreatmentResponse.png
% Navigate to violin plots folder
cd '../Violin plots'
% Generate all parameter distribution plots
run run_violin_analysis('generate_all', true)Outputs: Violin plots comparing 15 parameter distributions (Amax and Emax are fixed at 1.11Γ10βΉ) across patient types (asymptomatic, reversible, irreversible)
ViolinPlots_all.png- All virtual skin sitesViolinPlots_damage.png- Only sites with skin-damaging SE strains (Ξ΄BE > 0)ViolinPlots_no_damage.png- Only sites without skin-damaging SE strains (Ξ΄BE = 0)
Figures:
- Figure 4a: Highlights 6 key parameters from
ViolinPlots_all.png(subset of parameters selected by visual inspection) - Supplementary Figure S4: Complete parameter distributions from
ViolinPlots_all.png - Supplementary Figure S5a: Parameter distributions for damaging SE strains (from
ViolinPlots_damage.png) - Supplementary Figure S5b: Parameter distributions for non-damaging SE strains (from
ViolinPlots_no_damage.png)
% Navigate to dual-action treatment folder
cd '../Effect of dual-action treatment'
% Explore effect of dual-action treatment
run run_DualAction.m % generates Figure 5b - d in main text
run run_AttenuationOnly_supplementary.m % generates Figure S6b - d in supplementary materialsOutputs:
SA-killing strength varied between 0-5 days-1 and 1-4 days with 20-fold attenuation on SA and SE growths
Figure5_AllSites.png- Treatment response for all virtual skin sites with a damaged skin stateFigure5_Irreversible.png- Treatment response for irreversible sitesFigure5_Reversible.png- Treatment response for reversible sites
SA and SE growth attenuation varied between 1- and 20-fold
FigureS6_AttenuationHeatmaps.png- Proportion of virtual skin sites that gain an undamaged skin state
Figures:
- Figure 5b-d: (b)
Figure5_AllSites.png, (c)Figure5_Irreversible.png, and (d)Figure5_Reversible.png - Supplementary Figure S6b-d:
FigureS6_AttenuationHeatmaps.png
| Figure | Scripts | Folder | Description |
|---|---|---|---|
| Figure 2 | run_steady_state_plots.m |
Group virtual skin sites | Illustration of three types of virtual skin sites defined by whether the stable skin state converged to undamaged or damaged |
| Figure 3b-d | run_SA_killing_main.m |
Effect of SA-killing | Proportion of all damaged skin sites that recover to an undamaged skin state |
| Figure 4a | run_violin_analysis.m |
Violin plots | Parameter distributions by patient type |
| Figure 5b-d | run_DualAction.m |
Effect of dual-action treatment | Proportion of all damaged skin sites that recover to an undamaged skin state |
| Figure | Scripts | Folder | Description |
|---|---|---|---|
| Figure S1 | run_steady_state_plots.m |
Group virtual skin sites | Phase portraits by steady state count |
| Figure S2 | run_SA_killing_supplementary.m |
Effect of SA-killing | Success of SA-killing for longer and stronger treatments |
| Figure S3 | run_example_supplementary.m |
Effect of SA-killing | SA-killing applied to one example skin site |
| Figure S4 | run_violin_analysis.m |
Violin plots | Distribution of parameters driving asymptomatic, reversible, and irreversible skin sites |
| Figure S5 | run_violin_analysis.m |
Violin plots | Distribution of parameters for sites with (a) non-damaging and (b) damaging SE strains |
| Figure S6b-d | run_AttenuationOnly_supplementary.m |
Effect of dual-action treatment | Percentage of sites that gain a non-damaged state when SA and SE growth attenuation is enhanced by different strengths |
SASE-model/
βββ Analyse steady states/ # Key workflow: Generate & classify patients
β βββ run_SteadyStates.m # Main entry point
β βββ data/
β βββ asymp.csv # Asymptomatic skin sites
β βββ reversible.csv # Reversible skin sites
β βββ irreversible.csv # Irreversible skin sites
β βββ AllVirtualPatientTypes_latest.csv # Key output
β
βββ Group virtual skin sites/ # Visualise virtual skin sites by steady states observed
β βββ run_patient_types.m # Plots sub-categories of virtual skin sites
β βββ data/ # AllVirtualPatientTypes_latest.csv grouped into 1, 2, 3 steady states
β β βββ One_StableState.csv
β β βββ Two_StableState.csv
β β βββ Three_StableState.csv
β βββ figures/
β βββ PatientTypes_1_SteadyState.png
β βββ PatientTypes_2_SteadyStates.png
β βββ PatientTypes_3_SteadyStates.png
β
βββ Effect of SA-killing/ # SA-killing treatment analysis
β βββ run_SA_killing_main.m # Generates Figure 3b-d in paper
β βββ run_SA_killing_supplementary.m # Generates Figure S2 in paper
β βββ run_example_supplementary.m # Generates Figure S3 in paper
β βββ data/ # Treatment results
β β βββ irreversible_SAkilling.csv # Initial conditions for treatment simulations for irreversible sites
β β βββ reversible_SAkilling.csv # Initial conditions for treatment simulations for reversible sites
β β βββ reversible_treatment_results_main.csv # Treatment success for reversible sites
β β βββ reversible_treatment_results_supp.csv # Treatment success for reversible sites
β β βββ example_site_results.csv # Treatment success for example site
β βββ figures/
β βββ Figure3_AllSites.png
β βββ Figure3_Irreversible.png
β βββ Figure3_Reversible.png
β βββ FigureS2_AllSites.png
β βββ FigureS2_Irreversible.png
β βββ FigureS2_Reversible.png
β βββ FigureS3_PhasePortrait.png
β βββ FigureS3_TreatmentResponse.png
β
βββ Violin plots/ # Parameter distribution analysis
β βββ run_violin_analysis.m # Generate violin plots
β βββ figures/
β βββ ViolinPlots_all.png
β βββ ViolinPlots_SE_damaging.png
β βββ ViolinPlots_SE_nondamaging.png
β
βββ Effect of dual-action treatment/ # Dual-action treatment analysis
β βββ run_DualAction.m # Generates Figure 5b-d in paper
β βββ run_AttenuationOnly_supplementary.m # Generates Figure S6b-d in paper
β βββ data/
β β βββ attenuation_irreversible_SA20.0_SE20.0.csv # Steady states after 20-fold attenuation
β β βββ attenuation_reversible_SA20.0_SE20.0.csv # Steady states after 20-fold attenuation
β β βββ irreversible_SAkilling_post_attenuation.csv # Initial conditions for treatment simulations for irreverisble sites
β β βββ reversible_SAkilling_post_attenuation.csv # Initial conditions for treatment simulations for reverisble sites
β β βββ irreversible_treatment_results_dual_action.csv # Treatment results
β β βββ reversible_treatment_results_dual_action.csv # Treatment results
β βββ figures/
β βββ Figure5_AllSites.png
β βββ Figure5_Irreversible.png
β βββ Figure5_Reversible.png
β βββ FigureS6_AttenuationHeatmaps.png
βββ README.md # This file
g_*.m- Generate data files (e.g., parameter sets, CSVs)a_*.m- Analyse existing data (e.g., steady states, classifications)f_*.m- Function definitions (helper functions)run_*.m- Runner scripts (orchestrate workflows)
The analysis pipeline consists of five main stages:
[1] Generate & classify β [2] Visualise steady states β [3] Simulate effect of SA-killing treatment β [4] Analyse parameter distributions β [5] Simulate dual-action treatment
Location: Analyse steady states/
Purpose: Generate 1 million virtual patient parameter sets, compute their steady states, and classify them into clinical categories. This is the foundational analysis that provides input data for all downstream analyses (visualisations, treatment simulations, parameter distributions).
| Script | Purpose | Key Configuration Options | Outputs |
|---|---|---|---|
run_SteadyStates.m |
Execute complete steady state analysis pipeline | n_samples, random_seed |
AllVirtualPatientTypes_latest.csv and all intermediate files |
| Script | Purpose | Used By |
|---|---|---|
g_Samples.m |
Generate parameter samples from log-uniform distributions Input: Configuration parameters Output: SampledParameters_[date].csv (17 columns) |
Step 1 in run_SteadyStates.m |
a_SampledParameters.m |
Compute steady states across 4 biological scenarios Input: SampledParameters_latest.csvOutput: AllSteadyStates_[date].csv (23 columns) |
Step 2 in run_SteadyStates.m |
g_VirtualPatients.m |
Group by number of steady states and assign patient IDs Input: AllSteadyStates_latest.csvOutput: AllVirtualPatients_[date].csv (25 columns) |
Step 3 in run_SteadyStates.m |
a_PatientGroups.m |
Classify patients into 9 clinical categories Input: AllVirtualPatients_latest.csvOutput: AllVirtualPatientTypes_[date].csv (26 columns) |
Step 4 in run_SteadyStates.m |
g_ClassificationFiles.m |
Generate CSV files for downstream analyses Input: AllVirtualPatientTypes_latest.csvOutput: asymp.csv, reversible.csv, irreversible.csv |
Step 5 in run_SteadyStates.m |
| Function | Purpose | Used By |
|---|---|---|
f_defineODEs.m |
Define coupled ODE system for SA-SE-Barrier dynamics | a_SampledParameters.m |
f_computeCase1.m |
Compute steady states when both SA and SE agr are inactive | a_SampledParameters.m |
f_computeCase2.m |
Compute steady states when SA agr active, SE agr inactive | a_SampledParameters.m |
f_computeCase3.m |
Compute steady states when SA agr inactive, SE agr active | a_SampledParameters.m |
f_computeCase4.m |
Compute steady states when both SA and SE agr are active | a_SampledParameters.m |
f_SteadyStateCheck.m |
Validate computed steady states and calculate eigenvalues | g_VirtualPatients.m |
Complete workflow:
run_SteadyStates.m
βββ Step 1: g_Samples.m
β βββ Set random seed for reproducibility
β βββ Sample 1M parameter sets from log-uniform distributions
β βββ Save: SampledParameters_[date].csv (1M rows Γ 17 columns)
β
βββ Step 2: a_SampledParameters.m
β βββ For each parameter set, compute steady states across 4 scenarios:
β β βββ Case 1: Both agr switches OFF (low bacterial loads)
β β βββ Case 2: SA agr ON, SE agr OFF (SA dominance)
β β βββ Case 3: SA agr OFF, SE agr ON (SE dominance)
β β βββ Case 4: Both agr switches ON (SA-SE co-existence)
β βββ Calculate stability eigenvalues for each steady state
β βββ Save: AllSteadyStates_[date].csv (23 columns)
β
βββ Step 3: g_VirtualPatients.m
β βββ Group steady states by unique parameter sets (Patient ID)
β βββ Filter for stable states only (negative eigenvalues)
β βββ Count number of stable states per patient (1, 2, or 3)
β βββ Save: AllVirtualPatients_[date].csv (~1M patients Γ 25 columns)
β
βββ Step 4: a_PatientGroups.m
β βββ Classify each patient into 9 clinical categories based on:
β β βββ Bacterial population levels (SA*, SE*)
β β βββ Barrier integrity status (B*)
β β βββ Quorum sensing threshold relationships
β βββ Save: AllVirtualPatientTypes_[date].csv (~1M patients Γ 26 columns)
β
βββ Step 5: g_ClassificationFiles.m
βββ Separate patients by barrier status across ALL steady states:
β βββ Asymptomatic: ALL steady states have B* = 1
β βββ Reversible: MIX of B* = 1 and B* < 1 states
β βββ Irreversible: ALL steady states have B* < 1
βββ Save: asymp.csv, reversible.csv, irreversible.csv
data/AllVirtualPatientTypes_latest.csv- Complete virtual patient dataset (~1M patients Γ 26 columns)- Column 1: Patient ID (1 to 10βΆ)
- Column 2: Number of stable steady states (1, 2, or 3)
- Columns 3-19: Model parameters (17 parameters from Supplementary Table S1)
- Columns 20-22: Steady state values (SA*, SE*, B*)
- Columns 23-25: Stability eigenvalues (Ξ»β, Ξ»β, Ξ»β)
- Column 26: Clinical category/region (1-9)
- Please refer to Data Specifications for a more detailed breakdown.
data/SampledParameters_[date].csv- Raw parameter samples (1M sets Γ 17 columns)data/AllSteadyStates_[date].csv- All computed steady states (~4M states Γ 23 columns)data/AllVirtualPatients_[date].csv- Grouped by patient ID (1M patients Γ 25 columns)
data/asymp.csv- Asymptomatic patients (ALL states B* = 1)data/reversible.csv- Reversible patients (MIX of B* = 1 and B* < 1)data/irreversible.csv- Irreversible patients (ALL states B* < 1)
data/*_latest.csv- Symbolic links to most recent analysisdata/*_[date].csv- Date-stamped archives for reproducibilitydata/*_[date].mat- MATLAB format for faster loading (optional)
Location: Group virtual skin sites/
Purpose: Generate phase portrait plots of virtual skin sites organised by the number of stable steady states they possess. Creates figures showing SA vs SE populations at steady state, grouped by region combinations and colored by barrier integrity status (red = damaged, yellow = undamaged).
| Usage | Purpose | Outputs |
|---|---|---|
run_patient_types.m |
Generate all steady state visualisations | All CSV files and PNG figures |
| Function | Purpose | Used By |
|---|---|---|
g_PatientTypes_1.m |
Generate patient visualisations for patients with 1 steady state Input: AllVirtualPatientTypes_latest.csvOutput: PatientTypes_1_SteadyState.png (8 region categories) |
run_patient_types.m |
g_PatientTypes_2.m |
Generate patient visualisations for patients with 2 steady states Input: AllVirtualPatientTypes_latest.csvOutput: PatientTypes_2_SteadyStates.png (21 region combinations) |
run_patient_types.m |
g_PatientTypes_3.m |
Generate patient visualisations for patients with 3 steady states Input: AllVirtualPatientTypes_latest.csvOutput: PatientTypes_3_SteadyStates.png (19 region combinations) |
run_patient_types.m |
Prerequisites:
βββ ../Analyse steady states/data/AllVirtualPatientTypes_latest.csv β
Complete Workflow:
run_patient_types.m
βββ Step 1: g_PatientTypes_1.m
β βββ Filter patients with 1 steady state β data/One_StableState.csv
β βββ Group by 8 region categories (1,2,3,4,5,6,7,8/9)
β βββ Generate 2Γ4 subplot figure β figures/PatientTypes_1_SteadyState.png
β
βββ Step 2: g_PatientTypes_2.m
β βββ Filter patients with 2 steady states β data/Two_StableStates.csv
β βββ Group by region combinations (21 pairs in total)
β βββ Generate multi-subplot figure β figures/PatientTypes_2_SteadyStates.png
β
βββ Step 3: g_PatientTypes_3.m
βββ Filter patients with 3 steady states β data/Three_StableStates.csv
βββ Group by all detected region combinations (19 region combinations)
βββ Generate dynamic subplot figure β figures/PatientTypes_3_SteadyStates.png
data/One_StableState.csv- Patients with exactly 1 stable steady state (asymptomatic or irreversible)data/Two_StableStates.csv- Patients with exactly 2 stable steady states (reversible or irreversible)data/Three_StableStates.csv- Patients with exactly 3 stable steady states (always reversible)
figures/PatientTypes_1_SteadyState.png- Supplementary: Single steady state phase portraits (Supplementary Figure S1, 8 subplots)figures/PatientTypes_2_SteadyStates.png- Supplementary: Two steady state combinations (Supplementary Figure S1, 21 subplots)figures/PatientTypes_3_SteadyStates.png- Supplementary: Three steady state combinations (Supplementary Figure S1, variable subplots)
Location: Effect of SA-killing/
Purpose: Analyse SA-killing treatment effectiveness on virtual patients with damaged skin barrier. Focuses specifically on reversible and irreversible skin sites.
| Script | Purpose | Parameters | Outputs |
|---|---|---|---|
run_SA_killing_main.m |
Generate Figure 3b-d | Strength 0-5, Duration 1-4 days | Figure3_AllSites.png, Figure3_Reversible.png, Figure3_Irreversible.png |
run_SA_killing_supplementary.m |
Generate Supplementary Figure S2 | Strength 0-10, Duration 2-50 days | FigureS2_AllSites.png, FigureS2_Reversible.png, FigureS2_Irreversible.png |
run_example_supplementary.m |
Generate Supplementary Figure S3 | Single patient analysis | FigureS3_PhasePortrait.png, FigureS3_TreatmentResponse.png |
| Function | Purpose | Used By |
|---|---|---|
g_ExtractInitialConditions.m |
Extract worst-case initial conditions for treatment simulations (see Materials and Methods in paper) | run_SA_killing_main.m, run_SA_killing_supplementary.m |
g_TreatmentResponse.m |
Run SA-killing treatment grid simulations Input: data/reversible_SAkilling.csvOutput: data/reversible_treatment_results_[suffix].csvSuffix: 'main' or 'supp' to prevent overwriting |
run_SA_killing_main.m, run_SA_killing_supplementary.m |
| Function | Purpose | Used By |
|---|---|---|
g_Plot_Main.m |
Generate main text heatmaps with contour lines (Figure 3b-d) | run_SA_killing_supplementary.m |
g_Plot_Supplementary.m |
Generate supplementary heatmaps with exact values (Supplementary Figure S2) | run_SA_killing_main.m |
g_VisualiseExampleSites.m |
Generate phase portrait plot (Supplementary Figure S3a) | run_example_supplementary.m |
g_ExampleSiteAnalysis.m |
Generate treatment response plot for a single patient (Supplementary Figure S3b) | run_example_supplementary.m |
| Function | Purpose |
|---|---|
f_defineODEs.m |
ODEs defining mathematical model |
f_defineODEs_SAkilling.m |
ODEs with SA-killing term |
f_EventHealthy.m |
Event detection for when a healthy state (B* = 1) is reached |
Prerequisites:
βββ ../Analyse steady states/data/reversible.csv β
βββ ../Analyse steady states/data/irreversible.csv β
Main Text Workflow (Figure 3b-d):
run_SA_killing_main.m
βββ g_ExtractInitialConditions.m β data/reversible_SAkilling.csv, data/irreversible_SAkilling.csv
βββ g_TreatmentResponse.m β data/reversible_treatment_results.csv
βββ g_Plot_Main.m β figures/Fig3_AllSites.png, Fig3_Reversible.png, Fig3_Irreversible.png
Supplementary Workflow (Figure S2):
run_SA_killing_supplementary.m
βββ [Same extraction and treatment steps with different parameters]
βββ g_Plot_Supplementary.m β figures/FigS2_AllSites.png, FigS2_Reversible.png, FigS2_Irreversible.png
Example Site Workflow (Figure S3):
run_example_supplementary.m
βββ g_VisualiseExampleSites.m β figures/FigS3_PhasePortrait.png
βββ g_ExampleSiteAnalysis.m β figures/FigS3_TreatmentResponse.png
data/reversible_SAkilling.csv- Initial conditions for reversible patientsdata/irreversible_SAkilling.csv- Initial conditions for irreversible patientsdata/reversible_treatment_results.csv- Treatment simulation results griddata/example_site_results.csv- Single patient detailed analysis results
figures/Figure3_AllSites.png- Main text: Combined treatment response heatmapfigures/Figure3_Reversible.png- Main text: Reversible patients treatment responsefigures/Figure3_Irreversible.png- Main text: Irreversible patients treatment responsefigures/FigureS2_AllSites.png- Supplementary: Extended parameter range heatmap (combined)figures/FigureS2_Reversible.png- Supplementary: Extended parameter range (reversible)figures/FigureS2_Irreversible.png- Supplementary: Extended parameter range (irreversible)figures/FigureS3_PhasePortrait.png- Supplementary: Single patient phase portraitfigures/FigureS3_TreatmentResponse.png- Supplementary: Single patient treatment response
Location: Violin plots/
Purpose: Visualise parameter distributions across different patient types using violin plots. Provides three distinct filtering modes to examine how 15 model parameters vary between asymptomatic, reversible, and irreversible patient groups with a focus on SE strain characteristics.
| Usage | Purpose | Parameters | Outputs |
|---|---|---|---|
run_violin_analysis() |
Interactive mode with guided prompts | User prompts for mode and CSV options | Selected analysis based on user choice |
run_violin_analysis('all') |
Generate Figures 4a and S4 | All patients, 15 parameters | ViolinPlots_all.png |
run_violin_analysis('SE_damaging') |
Generate Supplementary Figure S5a | SE-damaging strains only (Ξ΄_BE > 0) | ViolinPlots_SE_damaging.png |
run_violin_analysis('SE_nondamaging') |
Generate Supplementary Figure S5b | SE-nondamaging strains only (Ξ΄_BE = 0) | ViolinPlots_SE_nondamaging.png |
run_violin_analysis('generate_all') |
Generate all figures at once | All three analysis modes | All three PNG files |
| Function | Purpose | Used By |
|---|---|---|
g_violin_plot.m |
Core plotting function with SE strain filtering Input: ../Analyse steady states/data/*.csvOutput: Violin plots |
All run_violin_analysis modes |
prepare_parameter_data() |
Helper function to format data for violin plots Handles log transformation and NaN padding for unequal group sizes |
g_violin_plot.m |
| Function | Purpose | Used By |
|---|---|---|
violinplot.m |
User-friendly wrapper for creating violin plots with customisation options. Downloaded from Holger Hoffmann (2025). Violin Plot (https://www.mathworks.com/matlabcentral/fileexchange/45134-violin-plot), MATLAB Central File Exchange. Retrieved October 17, 2025. | g_violin_plot.m |
Violin.m |
Downloaded from Holger Hoffmann (2025). Violin Plot (https://www.mathworks.com/matlabcentral/fileexchange/45134-violin-plot), MATLAB Central File Exchange. Retrieved October 17, 2025. | violinplot.m |
| Function | Purpose |
|---|---|
g_ClassificationFiles.m |
Generates asymp.csv, reversible.csv, irreversible.csv from AllVirtualPatientTypes_latest.csv |
Prerequisites:
βββ ../Analyse steady states/data/AllVirtualPatientTypes_latest.csv β
βββ ../Analyse steady states/g_ClassificationFiles.m β
Interactive Workflow:
run_violin_analysis()
βββ Check for CSV files β Generate if missing via g_ClassificationFiles.m
βββ User selects analysis mode (1-4)
βββ g_violin_plot(mode) β figures/ViolinPlots_[mode].png
Batch Workflow (All figures):
run_violin_analysis('generate_all')
βββ Check/generate CSV files automatically
βββ g_violin_plot('all') β figures/ViolinPlots_all.png
βββ g_violin_plot('SE_damaging') β figures/ViolinPlots_SE_damaging.png
βββ g_violin_plot('SE_nondamaging') β figures/ViolinPlots_SE_nondamaging.png
Single Mode Workflow:
run_violin_analysis('all', false)
βββ Use existing CSV files (no regeneration)
βββ g_violin_plot('all') β figures/ViolinPlots_all.png
../Analyse steady states/data/asymp.csv- Asymptomatic patient parameters (all steady states have B* = 1)../Analyse steady states/data/reversible.csv- Reversible patient parameters (mixed B* = 1 and B* < 1 states)../Analyse steady states/data/irreversible.csv- Irreversible patient parameters (all steady states have B* < 1)
figures/ViolinPlots_all.png- Main text: Complete parameter comparison across all patient types (Figure 4a source)figures/ViolinPlots_SE_damaging.png- Supplementary: SE-damaging strain analysis (Supplementary Figure S5a)figures/ViolinPlots_SE_nondamaging.png- Supplementary: SE-non-damaging strain analysis (Supplementary Figure S5b)
Location: Effect of dual-action treatment/
Purpose: Analyse combined SA- and SE-attenuation and SA-killing treatment effectiveness on virtual patients.
| Script | Purpose | Parameters | Outputs |
|---|---|---|---|
run_DualAction.m |
Generate Figure 5b-d | 20Γ SA- and SE-attenuation + SA-killing (0-5 strength, 1-4 days) | DualAction_Heatmap.png, treatment CSV files |
run_AttenuationOnly_supplementary.m |
Generate Supplementary Figure S6b-d | SA- and SE-attenuation grid (1Γ, 10Γ, 20Γ) | FigureS6_AttenuationHeatmaps.png, attenuation CSV files |
| Function | Purpose | Used By |
|---|---|---|
g_AttenuationFlexible.m |
Apply attenuation enhancement to bacterial growth rates Input: Patient CSV files Output: Post-attenuation steady states |
run_DualAction.m, run_AttenuationOnly_supplementary.m |
g_TreatmentResponse_DualAction.m |
Run SA-killing treatment on attenuated patients Input: data/[patient_type]_SAkilling_post_attenuation.csvOutput: Dual-action treatment results |
run_DualAction.m |
| Function | Purpose | Used By |
|---|---|---|
g_Plot_DualAction.m |
Generate dual-action treatment heatmaps (Figure 5b-d) | run_DualAction.m |
g_Plot_AttenuationOnly.m |
Generate attenuation-only heatmaps (Supplementary Figure S6b-d) | run_AttenuationOnly_supplementary.m |
| Function | Purpose |
|---|---|
f_defineODEs.m |
ODEs defining mathematical model |
f_defineODEs_SAkilling.m |
ODEs with SA-killing term |
f_EventHealthy.m |
Event detection for when a healthy state (B* = 1) is reached |
Prerequisites:
βββ ../Effect of SA-killing/data/reversible_SAkilling.csv β
βββ ../Effect of SA-killing/data/irreversible_SAkilling.csv β
Dual-Action Workflow (Figure 5b-d):
run_DualAction.m
βββ Stage 1: g_AttenuationFlexible(20Γ, 20Γ) β Apply 20Γ SA/SE growth attenuation
βββ Stage 2: Extract damaged sites β data/reversible_SAkilling_post_attenuation.csv
βββ Stage 3: g_TreatmentResponse_DualAction β SA-killing on attenuated patients
βββ Stage 4: g_Plot_DualAction β figures/DualAction_Heatmap.png
Attenuation-Only Workflow (Figure S6b-d):
run_AttenuationOnly_supplementary.m
βββ 3Γ3 grid analysis: g_AttenuationFlexible(SA_fold, SE_fold)
β βββ SA folds: [1Γ, 10Γ, 20Γ]
β βββ SE folds: [1Γ, 10Γ, 20Γ]
β βββ Total: 9 combinations Γ 2 patient types = 18 simulations
βββ Weighted combination across patient populations
βββ g_Plot_AttenuationOnly β figures/FigureS6_AttenuationHeatmaps.png
data/reversible_SAkilling_post_attenuation.csv- Initial conditions for reversible patients after 20Γ attenuationdata/irreversible_SAkilling_post_attenuation.csv- Initial conditions for irreversible patients after 20Γ attenuationdata/reversible_treatment_results_dual_action.csv- Dual-action treatment simulation resultsdata/irreversible_treatment_results_dual_action.csv- Dual-action treatment simulation results
figures/DualAction_Heatmap.png- Main text: Dual-action treatment response heatmapfigures/FigureS6_AttenuationHeatmaps.png- Supplementary: Attenuation-only effectiveness grid
| Column(s) | Name | Description | Units | Range |
|---|---|---|---|---|
| 1 | Patient ID | Unique parameter set identifier | - | 1 to 10βΆ |
| 2 | Num States | Number of stable steady states | - | 1, 2, or 3 |
| 3 | ΞΊA | SA growth rate | dayβ»ΒΉ | [9, 27] |
| 4 | Amax | SA carrying capacity | CFU/cmΒ² | 1.11Γ10βΉ |
| 5 | Ξ³AB | Skin inhibition of SA growth | - | [58.7, 5870] |
| 6 | Ξ΄AE | SA killing by SE | dayβ»ΒΉ | [4.78, 478] |
| 7 | Ath | SA QS threshold | CFU/cmΒ² | [1.13Γ10β·, 1.13Γ10βΉ] |
| 8 | Epth | SE density for half-max SA killing | CFU/cmΒ² | [1.13Γ10β·, 1.13Γ10βΉ] |
| 9 | Ξ³AE | SA QS inhibition by SE | cmΒ²/CFU | [1.30Γ10β»βΉ, 1.30Γ10β»β·] |
| 10 | ΞΊE | SE growth rate | dayβ»ΒΉ | [9, 27] |
| 11 | Emax | SE carrying capacity | CFU/cmΒ² | 1.11Γ10βΉ |
| 12 | Ξ³EB | Skin inhibition of SE growth | - | [55.8, 5580] |
| 13 | Ξ΄EA | SE killing by SA | dayβ»ΒΉ | [4.78, 478] |
| 14 | Eth | SE QS threshold | CFU/cmΒ² | [1.13Γ10β·, 1.13Γ10βΉ] |
| 15 | Apth | SA density for half-max SE killing | CFU/cmΒ² | [1.13Γ10β·, 1.13Γ10βΉ] |
| 16 | ΞΊB | Skin barrier recovery rate | dayβ»ΒΉ | [0.00711, 0.711] |
| 17 | Ξ΄B | Skin desquamation rate | dayβ»ΒΉ | [0.00289, 0.289] |
| 18 | Ξ΄BA | Skin damage by SA | cmΒ²/(CFUΒ·day) | [10β»ΒΉβ°, 10β»βΈ] |
| 19 | Ξ΄BE | Skin damage by SE | cmΒ²/(CFUΒ·day) | [10β»ΒΉΒ², 10β»βΈ] |
| 20 | SA* | SA steady state population | CFU/cmΒ² | β₯ 0 |
| 21 | SE* | SE steady state population | CFU/cmΒ² | β₯ 0 |
| 22 | B* | Barrier function steady state | - | [0, 1] |
| 23-25 | Ξ»β, Ξ»β, Ξ»β | Stability eigenvalues (Jacobian) | - | Real parts < 0 (locally stable) |
| 26 | Region | Steady state region classification | - | 1-9 |
For further details on parameter descriptions, please refer to Supplementary Table S1 in manuscript.
Asymptomatic:
- ALL steady states have B* = 1.0
- Undamaged skin that maintains barrier function
- Example: Patient with states [B*=1, B*=1, B*=1]
Reversible:
- Has BOTH B* = 1.0 AND B* < 1.0 states
- Can transition between healthy and damaged
- SA-killing can restore barrier function
- Example: Patient with states [B*=1, B*=0.7]
Irreversible:
- ALL steady states have B* < 1.0
- AD skin site with persistent barrier damage
- Example: Patient with states [B*=0.8, B*=0.6]
Based on characteristic SA and SE population densities at steady state (see Supplementary Figure S15):
| Region | SA Population | SE Population | Barrier Status | Description |
|---|---|---|---|---|
| 1 | Absent | Absent | B* = 1 | SA and SE-free skin |
| 2 | Low | Absent | B* = 1 | Low SA colonisation (non-damaging) |
| 3 | Absent | Low | B* = 1 | Low SE colonisation (non-damaging) |
| 4 | Low | Low | B* = 1 | SA-SE coexistence (non-damaging) |
| 5 | Absent | High | B* varies | High SE colonisation (damaging if Ξ΄BE > 0) |
| 6 | Present | High | B* varies | SA-SE coexistence with SE dominance (damaging if Ξ΄BE > 0) |
| 7 | High | Absent | B* < 1 | High SA colonisation (damaging) |
| 8 | High | Present | B* < 1 | SA-SE coexistence with SA dominance (damaging) |
| 9 | High | High | B* < 1 | SA-SE coexistence (damaging) |
Population Thresholds (relative to Ath and Eth):
- "Low": Below quorum sensing threshold
- "High": Above quorum sensing threshold
Questions? Please either:
- βοΈ Open an issue on GitHub
- π¨ Email: j.lee20@imperial.ac.uk
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
You are free to:
- Share β copy and redistribute the material
Under the following terms:
- Attribution β You must give appropriate credit
- NonCommercial β You may not use the material for commercial purposes
- NoDerivatives β You may not distribute modified versions
-
v1.1 (2025-10-21): Major refactoring
- Added comprehensive documentation with complete workflow guide
- Streamlined workflow to make figures easier to reproduce
-
v1.0 (2024-02-04): Initial release with publication
Ready to get started? Jump to Quick Start or explore the Complete Workflow!