Investigating the role of the spleen in red blood cell loss in malaria

This repository contains a mathematical model of red blood cell (RBC) dynamics in a malaria infection. This model includes the spleen as a separate model compartment that can retain large amounts of infected and uninfected RBCs.

This model is described in The role of the spleen in red blood cell loss caused by malaria: a mathematical model, PLOS Comp Biol 22(1), 2026.

See the online documentation for vignettes and reference materials.

Installation

The model is implemented in R and provided as an R package called spleenrbc. The simplest way to install this package is:

package_repos <- c(
  CRAN = "https://cloud.r-project.org/",
  spleenrbc = "https://robmoss.r-universe.dev"
)
install.packages("spleenrbc", repos = package_repos)
library(spleenrbc)

You will then be able to run the baseline model scenarios, and define and run your own model scenarios. See the provided package documentation and vignettes for examples.

Running simulations and plotting results

The simulation and plotting scripts are not included in the package itself. In order to run them, you will need to clone this repository:

git clone https://gitlab.unimelb.edu.au/rgmoss/malaria-spleen-rbc-loss.git
cd malaria-spleen-rbc-loss

Running simulations

There are scripts to run the following simulations:

Code structure

The model implementation is divided into multiple R files: