simulate_drugresistance_stochastic {DSAIRM}R Documentation

Stochastic simulation of a compartmental acute virus infection model with treatment and drug resistant strain

Description

Simulation of a stochastic model with the following compartments: Uninfected target cells (U), Infected with wild-type/sensitive and untreated (Is), infected with resistant (Ir), wild-type virus (Vs), resistant virus (Vr).

Usage

simulate_drugresistance_stochastic(
  U = 1e+05,
  Is = 0,
  Ir = 0,
  Vs = 10,
  Vr = 0,
  b = 1e-05,
  dI = 1,
  e = 0,
  m = 0.001,
  p = 100,
  c = 4,
  f = 0.1,
  rngseed = 100,
  tfinal = 30
)

Arguments

U

: initial number of target cells : numeric

Is

: initial number of wild-type infected cells : numeric

Ir

: initial number of resistant infected cells : numeric

Vs

: initial number of wild-type virus : numeric

Vr

: initial number of resistant virus : numeric

b

: level/rate of infection of cells : numeric

dI

: rate of infected cell death : numeric

e

: efficacy of drug : numeric

m

: fraction of resistant mutants created : numeric

p

: virus production rate : numeric

c

: virus removal rate : numeric

f

: fitness cost of resistant virus : numeric

rngseed

: seed for random number generator to allow reproducibility : numeric

tfinal

: maximum simulation time : numeric

Details

A compartmental ID model with several states/compartments is simulated as a stochastic model using the adaptive tau algorithm as implemented by ssa.adaptivetau in the adpativetau package. See the manual of this package for more details. The function returns the time series of the simulated disease as output matrix, with one column per compartment/variable. The first column is time.

Value

A list. The list has only one element called ts. ts contains the time-series of the simulation. The 1st column of ts is Time, the other columns are the model variables.

Warning

This function does not perform any error checking. So if you try to do something nonsensical (e.g. have I0 > PopSize or any negative values or fractions > 1), the code will likely abort with an error message.

Author(s)

Andreas Handel

References

See the manual for the adaptivetau package for details on the algorithm. The implemented model is loosely based on: Handel et al 2007 PLoS Comp Bio "Neuraminidase Inhibitor Resistance in Influenza: Assessing the Danger of Its Generation and Spread"

Examples

# To run the simulation with default parameters just call the function:
result <- simulate_drugresistance_stochastic()
# To choose parameter values other than the standard one, specify them, like such:
result <- simulate_drugresistance_stochastic(tfinal = 100, e = 0.5)
# You should then use the simulation result returned from the function, like this:
plot(result$ts[,"time"],result$ts[,"Vs"],xlab='Time',ylab='Uninfected cells',type='l')

[Package DSAIRM version 0.9.6 Index]