Package 'spleenrbc'

Title: The role of the spleen in red blood cell loss due to malaria
Description: A mathematical model of red blood cell (RBC) dynamics in a malaria infection, which includes the spleen as a separate model compartment that can retain large amounts of infected and uninfected RBCs.
Authors: Saber Dini [aut] , Ali Haghiri [aut] , Robert Moss [aut, cre]
Maintainer: Robert Moss <[email protected]>
License: MIT + file LICENSE
Version: 0.0.1
Built: 2024-10-29 01:18:41 UTC
Source: https://gitlab.unimelb.edu.au/rgmoss/malaria-spleen-rbc-loss

Help Index


Age-structured parasite multiplication rates (the number of released merozoites that successfully invade uRBCS of age a) in the circulation.

Description

Age-structured parasite multiplication rates (the number of released merozoites that successfully invade uRBCS of age a) in the circulation.

Usage

alpha_c(u_rbc, pmf, beta)

Arguments

u_rbc

The RBC count.

pmf

The parasite multiplication factor.

beta

The (age-dependent) merozoite preference for uninfected RBCs.


Age-structured parasite multiplication rates (the number of released merozoites that successfully invade uRBCS of age a) in the spleen.

Description

Age-structured parasite multiplication rates (the number of released merozoites that successfully invade uRBCS of age a) in the spleen.

Usage

alpha_r(u_rbc, pmf, beta)

Arguments

u_rbc

The RBC count.

pmf

The parasite multiplication factor.

beta

The (age-dependent) merozoite preference for uninfected RBCs.


Return the baseline parameter values, including all derived parameters.

Description

Return the baseline parameter values, including all derived parameters.

Usage

baseline_parameters(species = c("Pf", "Pv"), nospleen = FALSE, derived = TRUE)

Arguments

species

The malaria species: 'Pf' or 'Pv'.

nospleen

Whether the spleen has been removed.

derived

Whether to define parameters whose values are derived from other parameters.


Age-dependent merozoite preference for uninfected RBCs.

Description

Age-dependent merozoite preference for uninfected RBCs.

Usage

beta(p, age)

Arguments

p

The parameter values for the scenario.

age

The RBC age.


Calculate the ratio of (a) the fraction of RBCs in the spleen that are infected; to (b) the fraction of RBCs in the circulation that are infected.

Description

Calculate the ratio of (a) the fraction of RBCs in the spleen that are infected; to (b) the fraction of RBCs in the circulation that are infected.

Usage

calculate_irbc_ratio(results)

Arguments

results

A dataframe of simulation results.

Value

A dataframe that includes the following columns, in addition those in results:

iRBC_Ratio

The ratio of infected cell fractions in the spleen and circulation.


Calculate credible intervals for each column, except "time" and "scenario".

Description

Calculate credible intervals for each column, except "time" and "scenario".

Usage

credible_intervals(results, pcnt = c(50, 60, 70, 80, 90, 95))

Arguments

results

A dataframe of simulation results.

pcnt

The credible intervals to calculate, expressed as percentages.

Value

A dataframe with the following columns:

name

The statistic name (character)

time

The time (numeric, hours)

cred_int

The credible interval (ordered factor, widest to narrowest)

ci_min

The credible interval lower bound (numeric)

ci_max

The credible interval upper bound (numeric)


Define parameters whose values are derived from other parameters.

Description

Define parameters whose values are derived from other parameters.

Usage

define_derived_parameters(p)

Arguments

p

The parameter values for the scenario.


Rate of infected RBC removal from the circulation into the spleen.

Description

Rate of infected RBC removal from the circulation into the spleen.

Usage

delta_i(p, age)

Arguments

p

The parameter values for the scenario.

age

The RBC age.


Increase in infected RBC removal into the spleen due to RBC congestion.

Description

Increase in infected RBC removal into the spleen due to RBC congestion.

Usage

delta_i_fold(p, net_u_rbc, net_i_rbc)

Arguments

p

The parameter values for the scenario.

net_u_rbc

The total number of uninfected RBCs in the circulation.

net_i_rbc

The total number of infected RBCs in the circulation.


Rate of infected RBC reentry into the circulation from the spleen.

Description

Rate of infected RBC reentry into the circulation from the spleen.

Usage

delta_i_prime(p, age)

Arguments

p

The parameter values for the scenario.

age

The infected RBC age(s).


Rate of uninfected RBC removal from the circulation into the spleen.

Description

Rate of uninfected RBC removal from the circulation into the spleen.

Usage

delta_u(p, age)

Arguments

p

The parameter values for the scenario.

age

The RBC age.


Increase in uninfected RBC removal into the spleen due to RBC congestion.

Description

Increase in uninfected RBC removal into the spleen due to RBC congestion.

Usage

delta_u_fold(p, net_u_rbc, net_i_rbc)

Arguments

p

The parameter values for the scenario.

net_u_rbc

The total number of uninfected RBCs in the circulation.

net_i_rbc

The total number of infected RBCs in the circulation.


Rate of uninfected RBC reentry into the circulation from the spleen.

Description

Rate of uninfected RBC reentry into the circulation from the spleen.

Usage

delta_u_prime(p, age)

Arguments

p

The parameter values for the scenario.

age

The RBC age.


Rate of RBC production.

Description

Rate of RBC production.

Usage

erythropoiesis(p, u_rbc)

Arguments

p

The parameter values for the scenario.

u_rbc

The RBC count.


Red blood cell counts collected from asymptomatic Papuans who reported no fever within the preceding 24 hours (708 uninfected, 50 Pf infections, 45 Pv infections) in a cross-sectional household survey conducted in southern Papua, Indonesia.

Description

See Pava et al., 2016 for details.

Usage

hhs_asymp

Format

hhs_asymp

A data frame with 803 rows and the following columns:

species

One of "Pf", "Pv", or "neg"

total_rbc

The red blood cell count


Record key outputs for a single scenario.

Description

Record key outputs for a single scenario.

Usage

individual_results(p, keep)

Arguments

p

The scenario parameters.

keep

The model state at each of the relevant time-steps.

Value

A data frame that includes the following columns:

scenario

The scenario number

time

The simulation time (hours)

U_t

The number of uRBCs in the circulation

Ur_t

The number of uRBCs in the spleen

Retic_c_t

The number of reticulocytes in the circulation

Retic_r_t

The number of reticulocytes in the spleen

I_t

The number of iRBCs in the circulation

Ir_t

The number of iRBCs in the spleen

Iq_t

The number of iRBCs in the microvasculature

M_t

The number of macrophages in the spleen

E_t

The erythropoiesis rate

r_t

The number of reticulocytes in the bone marrow

pmr_c_t_1

The number of merozoites released in the circulation

pmr_r_t_1

The number of merozoites released in the spleen

flow_r_to_c

The number of reticulocytes released from the bone marrow

flow_uc_to_r

The number of uRBCs removed from the circulation into the spleen

flow_uc_to_r_no_inf

The number of uRBCs that would have been removed from the circulation into the spleen, in the absence of a malaria infection

flow_ur_to_c

The number of uRBCs released from the spleen into the circulation

flow_ur_out

The number of uRBCs phagocytised in the spleen

flow_ic_to_r

The number of iRBCs removed from the circulation into the spleen

flow_ic_to_q

The number of iRBCs sequestered into the microvasculature

flow_ir_to_c

The number of iRBCs released from the spleen into the circulation

flow_ir_out

The number of iRBCs phagocytised in the spleen

flow_uc_to_ic

The number of uRBCs in the circulation that became infected

flow_ur_to_ir

The number of uRBCs in the spleen that became infected

inf_from_ic

The number of RBCs infected from iRBCs in the circulation

inf_from_iq

The number of RBCs infected from iRBCs in the microvasculature

inf_from_ir

The number of RBCs infected from iRBCs in the spleen

rho_t

The release rate of the youngest reticulocytes

deltaUfold

The fold increase in uRBC removal from the circulation

deltaIfold

The fold increase in iRBC removal from the circulation

Ur_frac_inf

The fraction of RBCs in the spleen that become infected


Calculate quantities related to uRBC infection and retention in the spleen due to malaria infection.

Description

Calculate quantities related to uRBC infection and retention in the spleen due to malaria infection.

Usage

infection_flows_and_loss(results)

Arguments

results

A dataframe of simulation results.

Value

A dataframe that includes the following columns, in addition those in results:

U_and_I_t

The value of Uc(t)+Ic(t)U_c(t) + I_c(t)

Ur_frac_U

the fraction of uRBCs that are retained in the spleen

flow_uc_to_r_inf

The retention of uRBCs due to malaria infection

flow_uc_to_r_ratio

The rate of uRBC retention that is due to malaria infection, relative to baseline uRBC retention

Uc_loss_ratio_c

The ratio of uRBC retention due to malaria loss, relative to the infection of uRBCs in the circulation

Uc_loss_ratio_cr

The ratio of uRBC retention due to malaria loss, relative to the infection of uRBCs in the circulation and the spleen

inf_total

The number of uRBC infections in the circulation and spleen

inf_from_icq

The number of uRBC infection in the circulation due to merozoites released in the circulation and microvasculature


Construct the initial model state.

Description

Construct the initial model state.

Usage

initial_spleenrbc_state(p)

Arguments

p

The parameter values for the scenario.


Phagocytosis rate of infected RBCs in the spleen.

Description

Phagocytosis rate of infected RBCs in the spleen.

Usage

lambda_i(p, macrophages)

Arguments

p

The parameter values for the scenario.

macrophages

The macrophage count.


Phagocytosis rate of uninfected RBCs in the spleen.

Description

Phagocytosis rate of uninfected RBCs in the spleen.

Usage

lambda_u(p, macrophages, age)

Arguments

p

The parameter values for the scenario.

macrophages

The macrophage count.

age

The RBC age.


Define the distributions from which to sample values for each parameter.

Description

Define the distributions from which to sample values for each parameter.

Usage

lhs_distributions(params, lower = 0.8, upper = 1.2)

Arguments

params

A data frame that defines the parameters to be sampled.

lower

The lower bound for triangle distributions, relative to the baseline values.

upper

The upper bound for triangle distributions, relative to the baseline values.


Pf parameter values for each scenario.

Description

Pf parameter values for each scenario.

Usage

parameters_pf

Format

parameters_pf

A data frame with 34 rows and 3 columns:

name

Parameter name

baseline

Baseline value

dist

Sampling distribution: 'constant' or 'triangle'


Pv parameter values for each scenario.

Description

Pv parameter values for each scenario.

Usage

parameters_pv

Format

parameters_pv

A data frame with 34 rows and 3 columns:

name

Parameter name

baseline

Baseline value

dist

Sampling distribution: 'constant' or 'triangle'


Construct a list that will record the model state over time.

Description

Construct a list that will record the model state over time.

Usage

prepare_spleenrbc_snapshot(p, time_steps)

Arguments

p

The parameter values for the scenario.

time_steps

The number of time-steps (hours).


Convert red blood cell counts into haemoglobin (g/dL).

Description

For this conversion, we assume that 15 g/dL of haemoglobin corresponds to 2.5×10132.5 \times 10^{13} RBCs.

Usage

rbc_counts_to_haemoglobin(rbc_counts)

Arguments

rbc_counts

One or more RBC counts.

Value

Haemoglobin levels (g/dL).

Examples

rbc_counts_to_haemoglobin(1e15 * c(2.3, 2.4, 2.5, 2.6, 2.7))

The red blood cell count at homeostasis.

Description

Defined as the median red blood cell count for uninfected Papuans in the hhs_asymp data set.

Usage

rbc_steady_state

Format

rbc_steady_state

A scalar value.


Subtract negative U values from other (positive) U values.

Description

Subtract negative U values from other (positive) U values.

Usage

resolve_negative_rbcs(u, t_urbc, pmf, beta_a, alpha_fun)

Arguments

u

A population of red blood cells.

t_urbc

The RBC lifetime.

pmf

The parasite multiplication factor.

beta_a

The (age-dependent) merozoite preference for uninfected RBCs.

alpha_fun

The function that calculates RBC infections.


The reticulocyte production rate at homeostasis.

Description

Returns the steady-state values for:

  • normoblast population (gamma);

  • reticulocyte population in the bone marrow (r_a);

  • reticulocyte population in the circulation (R_a);

  • normoctye population in the circulation (N_a);

  • RBC population in the spleen (Ur_a); and

  • circulating RBC imbalance wrt homeostasis (difference).

Usage

retic_steady_state(p)

Arguments

p

The parameter values for the scenario.


The reticulocyte production rate for the given normoblast population.

Description

The reticulocyte production rate for the given normoblast population.

Usage

reticulocyte_prod(p, rho_ss, lambdaU, deltaU_a, gamma, z = 0)

Arguments

p

The parameter values for the scenario.

rho_ss

The release rate of reticulocytes from the bone marrow into the circulation at homeostasis.

lambdaU

The phagocytosis rate of uninfected RBCs in the spleen.

deltaU_a

The rate of uninfected RBC removal from the circulation into the spleen.

gamma

The normoblast population in the bone marrow.

z

The initial number of circulating reticulocytes (age of 1 hour).


Age-structured release rate of reticulocytes from the bone marrow into the circulation.

Description

Age-structured release rate of reticulocytes from the bone marrow into the circulation.

Usage

rho(p, age, u_rbc)

Arguments

p

The parameter values for the scenario.

age

The reticulocyte age.

u_rbc

The RBC count (must be a scalar).


The minimum age at which reticulocytes are released from the bone marrow into the circulation.

Description

The minimum age at which reticulocytes are released from the bone marrow into the circulation.

Usage

rho_release_age(p, u_rbc)

Arguments

p

The parameter values for the scenario.

u_rbc

The RBC count (must be a scalar).


Run model scenarios.

Description

Run model scenarios.

Usage

run_spleenrbc(
  scenarios = NULL,
  days = 50,
  time_steps = days * 24,
  verbose = FALSE
)

Arguments

scenarios

A dataframe of parameter combinations for each scenario.

days

The number of days to simulate.

time_steps

The number of time-steps (hours).

verbose

Whether to print a message when starting each scenario.

Value

A data frame whose columns capture model state variables at each time-step.

See Also

individual_results() for a description of the returned data frame.


Run a single scenario and return the model state history.

Description

Run a single scenario and return the model state history.

Usage

run_spleenrbc_model(p, time_steps, debug = FALSE)

Arguments

p

The parameter values for the scenario.

time_steps

The number of time-steps (hours).

debug

Whether to check invariant properties after each time-step.

Value

A data frame whose columns capture model state variables at each time-step.

See Also

individual_results() for a description of the returned data frame.


Create parameter samples for each scenario.

Description

Create parameter samples for each scenario.

Usage

sample_parameters(
  species = c("Pf", "Pv"),
  nospleen = FALSE,
  dists = NULL,
  rbc_ss = NULL,
  n_samples = 1000,
  seed = 1691987
)

Arguments

species

The malaria species: 'Pf' or 'Pv'.

nospleen

Whether the spleen has been removed.

dists

The parameter distributions from which to draw samples.

rbc_ss

The red blood cell count at homeostasis.

n_samples

The number of scenarios.

seed

The seed for the random number generator.


Uninfected and infected RBC counts in the circulation and spleen of 15 asymptomatic adults in Papua, Indonesia (9 Pf infections, 6 Pv infections) who underwent splenectomy, mostly due to trauma.

Description

See Kho et al., 2021 for details.

Usage

splenectomised

Format

splenectomised

A data frame with 17 rows and the following columns:

patient

Patient identifier

infection

One of "Pf", "Pv", or "neg"

irbc_peri

Infected RBC count in the peripheral circulation

irbc_spleen

Infected RBC count in the spleen

urbc_peri

Uninfected RBC count in the peripheral circulation

urbc_spleen

Uninfected RBC count in the spleen


Update the model state by simulating forward one time-step.

Description

Update the model state by simulating forward one time-step.

Usage

step_spleenrbc_model(p, s, t)

Arguments

p

The parameter values for the scenario.

s

The current model state.

t

The time for which to calculate the model state.


Age-structured rate of RBC sequestration into the microvasculature.

Description

Age-structured rate of RBC sequestration into the microvasculature.

Usage

zeta(p, age)

Arguments

p

The parameter values for the scenario.

age

The RBC age.