## Data
model_input.R - longitudinal RBC and iRBC data as well as MCMC fitting parameters
survival.csv - survival data from eight mouse strains
cytokines.csv - longitudinal cytokine (TNF-α, IFN-γ, IL-10 and TGF-β) data

## MCMC model fitting
Run model_fit.R to fit the Stan model (model_fit.stan) to longitudinal RBC and iRBC data (model_input.R). The results will be outputted as output1.rda.

## MCMC model refitting
Run simulate_post_mean.R to simulate RBC and iRBC data based on the posterior mean estimates from the original fit (contained in output1.rda). 

Run model_fit_to_post_mean.R to fit the Stan model (model_fit.stan) to the simulated longitudinal RBC and iRBC data. The results will be outputted as output2.rda.

## Plotting
R scripts used in plotting are found in the following files. Plotting some of the figures below requires plot_simulate.stan (which contains the Stan programme for simulating, not sampling the model) and output files (output1.rda and output2.rda).

Fig.1: plot_Fig1_survival.R
Fig.2: plot_Fig2_disease_space.R
Fig.3: plot_Fig4_posterior.R
Fig.4: plot_Fig5_pca.R
Fig.5: plot_Fig6_cytokines.R

Fig.S1 & S2: plot_FigS1_S2_model_fit.R
Fig.S3 & S4: plot_FigS3_S4_plot_FigS3_S4_posterior_diagnostics.R



 