This app allows exploration of the impact of different model formulations on simulation results. Read about the model in The Model tab. Then, work through the tasks described in the What To Do tab.
For this model, we track uninfected cells, infected cells and (free) virus. Additionally we model the innate and adaptive immune response - which is of course a very simplified approximation to the real immune response.
We track the following entities by assigning each to a compartment:
In addition to specifying the compartments of a model, we need to specify the dynamics determining the changes for each compartment. Broadly speaking, there are processes that increase the numbers in a given compartment/stage, and processes that lead to a reduction. Those processes are sometimes called in-flows and out-flows.
For the purpose of this app, we specify several alternative processes that allow us to explore different model variants by ‘turning on and off’ specific components of the model.
We specify the following processes/flows:
Both the innate and adaptive response are modeled in a rather abstract manner. We could think of them as some kind of cumulative representation of each arm of the immune response, or alternatively a single dominant innate response component, e.g. interferon for the innate and CD8 T-cells for the adaptive response.
The idea explored in this app and implemented by this model is that results sometimes, but not always, change depending on different (biologically reasonable) ways the immune response is modeled. We can explore those different models by setting certain parameters describing alternative processes to a non-zero value, and all others to zero. We can then study how different model alternatives affect the outcome.
Obviously, the number of alternative models we could make that are biologically reasonable is virtually endless. The better the underlying biology of a given infection is known, the easier it is to pick one model formulation over another. In the end, for most infections, we still don’t know enough to pick the “right” model. We often have to choose one or a few reasonable model candidates and hope that they approximate the underlying processes reasonably well.
Implementing the above described processes as a set of ordinary differential equations leads to the following model:
\[\begin{align} \dot U &= n - d_U U - bVU - k_1FU \\ \dot I &= bVU - d_II - k_2FI - k_4 A I - k_5 \frac{A I}{A+s_A} \\ \dot V &= \frac{pI}{1+k_3 F} - d_VV - bVU - k_6AV \\ \dot F &= p_F - d_F F + f_1 V (F_{max} - F) + f_2 \frac{V}{V+s_V} F + f_3 \frac{VI}{VI+s_V} F \\ \dot A &= a_1 F A + a_2\frac{V}{V+h_V}F + a_3 \frac{F V}{ F V + h_V} A - d_A A \end{align}\]
The rather messy looking model diagram is here:
Model Diagram
Since this is already a fairly complex model, it is worth spending some time mapping each component in the equations to the arrows and boxes in the diagram and the written description. By going back and forth between verbal formulation and mathematical notation, you will start to build some expertise in going from one to the other.
For the tasks below, it is assumed that the model is run in units of days.
We’ll begin with the basic virus model by turning off any immune response related component. Set all parameter values related to the immune response such that there is no F and A present at any time during the simulation. Set initial conditions to 105 uninfected cells, no infected cells, and 10 virions. Set the infection rate to 10-5, no production or death of uninfected cells, lifespan of infected cells and virus of 1 day and 6 hours, respectively. The rate of virus production should be 100 per day. You should get a single acute viral infection with no immune response present and a maximum of 70217 infected cells.
Record
Let’s explore different mechanisms for the innate response. Keep initial level of innate response at 0, but set innate production and removal rate to 1. Set all innate growth parameters (the fi) and all innate actions (k1, k2, k3) to 0. Run the simulation, confirm that you get an innate response that settles at a steady state (balance between production and removal), but that there is no further increase and that the rest of the dynamics doesn’t change (i.e. you should get the same maximum number of infected cells as above).
Record
Maximum number of infected cells
Value for innate response at steady state
Now, let’s explore the different types of innate response induction by playing with the fi parameters and the saturation parameter, sV. First, set f1 to 10-5 and Fmax to 1000. Relate what you see in the plots to the equations so you get an idea of how different terms in the equations behave. Continue to keep the ki at 0. This means the rest of the variables should not change. Make ten-fold changes to f1 and Fmax. Try to predict what will happen and then test your predictions by running the simulation.
Record
Peak of F with f1 = 10-5 and Fmax = 1000
Day at which F peaks with f1 = 10-5 and FMAX = 1000
Peak of F with f1 = 10-6 and Fmax = 1000
Day at which F peaks with f1 = 10-6 and Fmax = 1000
Peak of F with f1 = 10-5 and Fmax = 10000
Day at which F peaks with f1 = 10-5 and Fmax = 10000
Let’s switch to the alternative innate response induction proceses. Set f1 back to zero. Then, set f2 to 3 and sV to 105. Play around with different values for f2 and sV, each time trying to predict how changes in the parameters will affect the model.
Next, set f2 to zero and set f3 to 2. For any given value of sV, how does switching between innate response induction via f2 differ from f3? (Hint: take another look at the model equations.) Play around with different values for f3 and sV, again trying to predict the output and then running the simulation to confirm. Remember, each time you switch processes, ‘turn off’ the alternative ones.
Record
Peak of F with f2 = 3 and sV = 105
Peak of F with f2 = 3 and sV = 107
Peak of F with f3 = 2 and sV = 105
Peak of F with f3 = 2 and sV = 107
Explore the alternative representations of innate response induction by switching modeled process. Do you think that any of the modeled processes is more biologically reasonable than the others? Why or why not? Are you able to recreate similar dynamics regardless of which process is modeled? What happens if you turn more than one of the alternative processes on at once; is this biologically reasonable? Can you think of improvements to the parameterization?
Record
Now, let’s explore what happens when you have non-zero ki. First, set the innate induction parameters as follows: f3 = 5, f1 = f2 = 0, and sV = 105 (this way we can explore the ki effects using the same innate activation processes). Try different values for the ki parameters. At first, turn on one process at a time; after, mix and match.
You’ll find that the action of the innate response now impacts the other variables, which in turn can impact further innate activation. Some of the resulting dynamics can get complex. Pay attention to how different processes of innate activation and innate action do or don’t produce different overall dynamics.
Record
Peak of I with k1 = 0.001, other ki = 0
Peak of I with k2 = 0.001, other ki = 0
Peak of I with k3 = 0.001, other ki = 0
TRUE or FALSE: you can track the extent of the infection (i.e., how many total cells were infected) by calculating the difference between the number of uninfected cells at the beginning and the end of the simulation for all non-zero values of k1, k2, and k3.
Finally, turn on the adaptive response. Note that in this model, there is no adaptive response without innate response (check it by setting the innate response to 0 while having non-zero adaptive growth rates, ai). Also, note that the alternative adaptive growth processes for a1 and a3 further need an initial non-zero value for the adaptive immune response to be able to grow (again, check it for yourself either by reviewing the model equations or running the simulation).
Turn the innate response back on as in Task 6 with k2 = 0.001 and k1 = k3 = 0. Explore how different non-zero adaptive growth rates, ai, affect the adaptive response dynamics. Start by leaving the adaptive action parameters at 0. Then, fiddle with those parameters as well and set them to non-zero values. Also, pay attention to the impact of the saturation constants.
Record
Now that we have played with each of the immune response processes, let’s see if we can put together a bit more complicated model.
Set dF = 10, the innate response growth parameters to f3 = 15, f1 = f2 = 0, and sV = 105, and the innate response action parameters to k2 = 0.001 and k1 = k3 = 0. Set the adaptive response initial value to 1, adaptive response growth parameters to a3 = 5, a1 = a2 = 0, and hV = 107, and the adaptive response action parameters to k4 = 0, k5= 0.01, k6 = 0.1, and sA = 1000. Can you intuit what the model output will look like? Run the simulation for 100 days. You should have about 3 uninfected cells remaining at the end of the simulation.
Now, let’s add some processes for the birth and death of uninfected cells. Set the rate of uninfected cell production, n, to 10000 and the rate of natural death of uninfected cells to a value that would, in the absence of infection, equate to a constant 105 number of uninfected cells throughout the simulation. If you have difficulty determining the corresponding value for dU, you can review steady states in the Basic Virus app. Run the simulation. You should get a pretty interesting pattern. How would you interpret this? Does this model, parameter or dynamics, seem biologically reasonable?
Record
As you’ll notice, some of the specific model choices (i.e. specific parameters/terms in the model being turned on or off) lead to similar results, while other times results are quite different. For a specific system under study, some ways to formulate the immune response and the dynamics one gets might be better than others. Think about a system you are familiar with and consider which (if any) of the possible mechanisms implemented in this model might best describe that system. Keep playing with the model and see if you can recreate the system!
Record
This app (and all others) are structured such that the Shiny part (the graphical interface you see and the server-side function that goes with it) calls an underlying R script (or several) which runs the simulation for the model of interest and returns the results.
For this app, the underlying function running the simulation is
called simulate_modelvariants_ode
. You can call them
directly, without going through the shiny app. Use the
help()
command for more information on how to use the
functions directly. If you go that route, you need to use the results
returned from this function and produce useful output (such as a plot)
yourself.
You can also download all simulator functions and modify them for your own purposes. Of course to modify these functions, you’ll need to do some coding.
For examples on using the simulators directly and how to modify them,
read the package vignette by typing vignette('DSAIRM')
into
the R console.
Explorations of different models and their impacts on outcomes for acute virus infections in general can be found in e.g. (Li and Handel 2014) and a more detailed discussion of previously published models and comparison to data for influenza can be found in (Dobrovolny et al. 2013).