NetLogo host versus pathogens model
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
Ed LeGrand 10 Dec 2013
HOST-VERSUS-PATHOGENS MODEL: USE OF STRESSORS FOR DEFENSE
WHAT IS IT?
This is a host-versus-pathogens model that explores how the host can use stressors (harmful conditions) to fight pathogens. The struggle, from the host's viewpoint, is built around harming the pathogens relatively more than the host. In this program energy is used as the currency for survival and replication by the host cells and pathogens.
The program models life-threatening infections, where the host uses stressors to fight an infection but may be killed by being overwhelmed by the pathogens or by its own vigorous defense (sepsis). The host has a number of potential defenses, from invoking: 1) direct toxicity to the pathogen, 2) localized stressful conditions for all nearby cells, 3) regionally stressful conditions, to 4) systemic stressors which harm the entire host including the pathogen cells contained within. In the program the pathogen phenotype can be varied according to 1) the amount of harm pathogen cells can do to adjacent host cells, 2) the amount of energy they can obtain when adjacent to host cells, 3) the amount of energy they need to survive, and 4) whether or not they can wander to adjacent vacant spaces. The pathogens can be thought of as a large extracellular pathogens (comparable in size and energy requirements as a host cell) or as infected cells taken over by pathogens. Similarly, the pathogens can be viewed as tumor cells.
Levels of Host Defense
1) The "local-host-directed" defense mechanism models the standard view of immune defenses where defense is directed specifically at the pathogen with little, if any, host damage (e.g., phagocytosis with killing within the phagolysosome, and direct pathogen killing via complement, antimicrobial peptides, antibodies, etc.). The only cost to the host is the energy involved in creating this defense. In this program there is no additional cost for "local-host-directed" defense since these costs are already incorporated into the routine functioning of the host cells. Note that in this program there are no specialized immune cells; rather, any host cell has the ability to respond to the pathogens.
2) The "local-host-stressor" defense component is typically ignored in discussions of host defense. However, this program was developed to show how even non-specific self-harm can be utilized in host defense. In inflammatory sites all local cells, including pathogens, can be harmed by a variety of non-specific stressors such as: lactic acidosis, hypoxia, reduced energy-providing nutrients such as glucose and glutamine, reduced iron and zinc, and even slightly increased local heat (beyond that caused by vasodilation and fever) (Refs). Inflammatory cells utilize both glucose and glutamine, key sources of nutrition for pathogens and host cells, in what appears to be a deliberately wasteful manner (Refs). The waste of glucose contributes to the local lactic acidosis. In the program, "local-host-stressors" reduces energy from all cells adjacent to any host cell which is in contact with a pathogen.
3) Regional stressors are modeled by two mechanisms. The first is similar to "local-host-stressor" in that it reduces energy from all cells within 5 spaces of the contact between a host cell and a pathogen. This roughly models the reduced blood flow in zones of inflammation due to thrombosis (a feature co-induced by inflammatory mediators), extracellular fibrin formation, and edema (vascular leakage leading to tissue compression) (Alcock J, Brainard AH. Hemostatic containment - an evolutionary hypothesis of injury by innate immune cells. Med. Hypotheses 2008, 71:960-8). An additional regional stressor, "regional-amputation", reduces energy to a 6 x 16 space region in the lower right corner of the screen/host. This is comparable to the host's abandonment of a region of tissue through amputation. In plants the hypersensitive response involves programmed cell death of host cells in a zone around an infection to deprive the pathogen of nutrients.
4) "Systemic-host-stressor" models endogenous stressors of the acute-phase response, such as fever, nutrient restriction, anemia/hypoxia, etc. which affect all cells within the host. By analogy, it models exogenous systemic therapies which have substantial host toxicity.
It is important to note that in this program, except for "local-host-directed", the defense offered by every host-induced stressor harms host cells as much as pathogens. Any efficacy is due to the pathogens being relatively more vulnerable to the stressor than the host cells or the host as a whole. The primary vulnerability of the pathogens is that upon replication, they must split their energy between the two daughter cells, such that both cells have less energy reserves to weather stressful events. There are 3 outcomes (besides stalemate) in this program: 1) the host wins by eliminating all pathogens, 2) the pathogen wins by overrunning and killing the host, or 3) both lose when the host dies because of too vigorous a defense (sepsis).
HOW IT WORKS
The screen starts with 1089 host cells (1057 gray circles and 22 orange flags) and with 10 pathogens (red triangles) along the surface (though the number and location of the pathogens can be modified with sliders). These cells (turtles) represent an organism with a small infection at its surface. Each cell sits on one of the 1089 green patches, representing extracellular space. The cells derive approximately 14 units of energy per time interval (tick) and expend approximately 10 units of energy per tick. The randomness of the model is based on slight randomness in the amount of energy received and spent by each cell at each tick.
The central 22 orange flags represent "key host cells" which are unable to replicate, but which can store more energy than the gray circles ("host cells", which are able to replicate if they have enough energy and are adjacent to a vacant space). The key host cells represent a critical organ such as the heart or brain. In this program the key host cells have no function, but enough of them (at least 20) must survive for the host to survive. The shape of the key organ is such that dead key host cells can each be replaced by adjacent replicating host cells.
Vulnerability of the cells depends on energy, related to differences in their parameters.
Parameters of host cells (gray circles) and key host cells (orange flags):
initial number = 1057 host cells and 22 key host cells
number needed for host survival ≥ 700 host cells and 20 key host cells
start-energy = 300 units (energy the program starts with)
max-energy = 300 units (energy above this value can't be stored)
energy gained per tick = 14 units (approximate due to slight randomness)
energy lost per tick = 10 units (approximate due to slight randomness)
energy for replication ≥ 180 units AND a vacant space in one of the 8 neighboring patches. Energy is split between the two daughter cells.
energy-to-survive = 40 units for host cells and 30 units for key host cells (these can survive at lower energy since they are not replaceable).
There is an on-off switch which allows host cells to move to vacant adjacent spaces without replicating.
Parameters of pathogens (red triangles):
initial number = 10 (but number and location can be varied)
start-energy = 300 units (energy the program starts with)
max-energy = 300 units (energy above this value can't be stored)
energy gained per tick = 14 units (approximate due to slight randomness)
energy lost per tick = 10 units (approximate due to slight randomness)
energy for replication ≥ 120 units AND a vacant space in one of the 8 neighboring patches. Energy is split between the two daughter cells.
energy-to-survive = 40 units (but can be lowered to 10 units for increased virulence)
There is an on-off switch which allows host cells to move to vacant adjacent patches without replicating.
Note that the lower energy for replication is the only essential difference between pathogens and host cells.
Pathogen virulence factors:
pathogen-harm-hostcells: the value of this parameter (0 to 50) is subtracted from the energy level of each adjacent host cell (and key host cell), adjusted by a slight randomness factor. For example, a setting of 20 will remove approximately 20 units from each affected host cell’s energy stores during that tick.
pathogen-take-up-energy: the value of this parameter (0 to 50) is added to the pathogen’s energy level, adjusted by a slight randomness factor, if it is in contact with any host cells (or key host cells) during that tick.
pathogen-survive-low-energy: the energy threshold for survival can be lowered from 40 units (same as host cells) to as low as 10 units to increase virulence.
pathogen-wander?: a switch, that when On, has pathogens move to an adjacent vacant patch without any energy cost
Host defenses:
local-host-directed: the value of this parameter (0 to 50) is subtracted from the energy level of each adjacent pathogen, adjusted by a slight randomness factor. For example, a setting of 20 will remove approximately 20 units from each affected pathogen’s energy stores during that tick.
local-host-stressor: when in contact with an adjacent pathogen the value of this parameter (0 to 50) is subtracted from the energy level of each adjacent cell (pathogen and host cell alike), adjusted by a slight randomness factor.
SEE BELOW FOR REGIONAL STRESSORS
systemic-host-stressor: when ON this reduces the energy that every cell (host and pathogen) gains each tick (typically approximately 14 units) by the percent amount shown (0 to 500). A setting of 60 reduces the energy gained that tick by 60%, allowing 40% of 14 units to get to each cell. A setting of 100 permits 0 energy gain, a setting of 200 causes 14 units to be lost, and a setting of 300 causes 28 units to be lost. This is in addition to the 10 units of energy always lost per tick.
auto-systemic-stressor-hostcell#?: this strategy turns the systemic-host-stressor on when the number of host cells drops from 1057 to 1030. It stays on until there are ≤ 925 host cells. It stays off until the host recovers to ≥ 925 cells, and cycles off and on around 925, typically overshooting. Key host cells are not monitored—only regular host cells, so the host may kill itself when too many key host cells die._
auto-systemic-stressor-pathogen#?: this strategy turns on when there are ≥ 30 pathogens and off when the pathogen numbers have been reduced to ≤ 5. Then the On and Off thresholds are halved to 15 and 2.5 for the next cycle, then halved again and again until all pathogens are eliminated or until the host kills itself.
Rationale for selected parameters
The energy-to-survive for the key host cells is set lower than for the host cells since they are irreplaceable. This is consistent with the resistance to apoptosis of cardiomyocytes and neurons.
The energy-to-survive and start-energy of the pathogens is set the same as for host cells (though the pathogens' energy-to-survive can be lowered to enhance their virulence). This permits demonstration that other differences in susceptibility to stressors can be used for host defense. Additionally, the pathogens could be modeled as infected host cells or host-derived tumor cells having similar basic physiology as host cells.
Pathogens are adapted for rapid replication, hence they require less energy to replicate and have less need for energy storage than host cells. This rapid replication is their main vulnerability in this program.
Starting with 10 pathogens along the edge is the recommended starting point. It is harder to get an infection started with smaller numbers of pathogens, especially since chance plays a larger role. Additionally, with smaller numbers of pathogens there is more contact with host cells and exposure to their pathogen-harming defenses.
The host wins when the pathogen is eliminated and it has sufficient host cells and key host cells to survive. It is possible to adjust the stressor levels such that the pathogen numbers can be kept under control indefinitely, but the host will never have its full number of host cells and thus will remain impaired and vulnerable to other threats, besides the threat of pathogen re-emergence.
Discussion of Pathogen Phenotypes and Host Defenses
Pathogen Phenotypes
pathogen-harm-hostcell This slider harms host cells and key host cells that are in contact with the pathogen by reducing energy to those cells. A setting of 10 or 20 is recommended for starters.
pathogen-take-up-energy This slider adds energy to pathogens that are in contact with a host cell, but does not harm the host cells. it is recommended that the setting of this slider be kept the same as that for "pathogen-harm-hostcell" since in real-life a pathogen would tend to harm the adjacent host cells and gain energy in the process. If this slider is used while "pathogen-harm-hostcell" is set to 0, the number of pathogens will be unchanged, with all cells getting to their maximum (or temporarily more, based on the how the program is coded). "pathogen-harm-hostcell" must be set to at least 2 for these high-energy pathogens to be able to break out and spread.
pathogen-survive-low-energy With this slider, the lower value of 10 provides a little more pathogenicity by letting the pathogens survive down to 10 units of energy, rather than the default of 40 units (same as the host cells). This can be demonstrated at settings of "pathogen-harm-hostcell" = 20, "pathogen-take-up-energy" = 20, "pathogen-wander?" = on, "local-host-directed" = 10, and "local-host-stressor" = 10. At the default setting of 40, the host typically wins (pathogens destroyed), while at 10, the pathogen typically wins (pathogens overrun the host).
pathogen-wander? This switch allows pathogens to randomly move to vacant adjacent spaces. Without it being on, only the pathogen daughter cells can to an adjacent vacant space upon replication. The ability to wander lets virulent pathogens become more aggressive, while less virulent pathogens become more vulnerable because of their more frequent contact with more aggressive host cells.
When unopposed (all host defenses set at 0) the full extent of pathogenicity leads to the pathogens winning (overrunning the host to the point of the host dying) in 65-70 ticks.
Host Defenses
The host defenses are ordered from most specific to least specific.
local-host-directed This slider removes energy units from adjacent pathogens. A recommended setting is half of the "pathogen-harm-hostcell" setting.
local-host-stressor This slider removes energy units from all cells within a radius of 1 from the host cell in contact with a pathogen. A recommended setting is that it be the same as "local-host-directed". Interestingly, this defense is comparable to or slightly more effective than "local-host-directed".
regional-host-stressor When a host cell is within 2 patches of a pathogen, this slider reduces energy gained by a percentage for all cells in a radius of 2 spaces from the host cell. The background color changes from green to olive, indicating a clot or zone of vascular disturbance. Upon recovery, the clot can be removed if there are no pathogens within 4 patches of the host cells. The effect of this defense becomes apparent at a setting of about 30 or higher (30% reduction of the 14 units of energy gained per tick to cells in the affected area).
regional-amputation This slider reduces energy by a direct percentage for all cells in the lower right region of the host. While it is highly effective early on, once pathogens have spread from this region, it has little value.
systemic-host-stressor This slider reduces energy gained each tick by a percentage for all cells in the host. This slider allows modeling of sepsis, the condition where the host defense, rather than the pathogen, has killed the host. In this program a failure of the other defenses simply allows overgrowth of the pathogens leading to host death. However, this slider has the ability to kill the host while only a few pathogens are present. This slider can reverse a losing battle, but it is difficult to use effectively, and it is suggested that the action be slowed down with the slider at the top of the screen.
auto-systemic-stressor-hostcells# This switch was developed from a generally winning strategy of using the "systemic-host-stressor" slider. The host is prevented from killing itself (sepsis) while trying to maximize the harm that is done to the pathogens. Once there is a significant threat (when the number of host cells drops from 1057 to 1030 the "systemic-host-stressor" slider moves to 60. This quickly drains the cells of energy, with the pathogens being relatively more affected since they've spent their spare energy on replication. When the number of host cells drops to 925, the slider moves back to 0, allowing all cells to recover. This will cycle again and again. Sometimes the pathogens can be eliminated with one bout of "fever", and other times it may take several cycles. However, if the pathogen is so aggressive that the host never gets more than 925 cells again, the auto-stressor will not turn back on. Then the host will die because of pathogen overgrowth.
Because of the cell-by-cell calculations involved in running the program and creating a tick of time, there can be considerable lag and overshooting in the auto-stressor. Setting the lower safe zone closer to the required 700 surviving host cells (thus killing more pathogens as well as host cells) would lead to frequent overshooting and host death (sepsis).
In the course of playing with the "systemic-host-stressor" slider, it became clear that it is best to rapidly apply the systemic stress. It is anxiety-producing to slowly increase the systemic stress while watching the pathogens continue to spread, thus making success that much more difficult. Likewise, a rapid reprieve from systemic stress is useful when one watches more and more host cells dying. Even with the instantaneoous stress and relief from stress in this program, there is still a lag time for the effects to be apparent. This was not apparent to me before using the program.
hostcell-wander? When on, this switch allows host cells to wander to a vacant adjacent cell. It has limited utility. If host cells are set to be aggressive relative to the pathogens, then it will have some efficacy.
THINGS TO NOTICE
The primary vulnerability of the pathogens in this program is that they replicate rapidly. In doing so, they convert one well-energized cell with considerable reserves into two cells with low energy levels (low reserves). This reflects real-life since replication requires acquiring the material and energy resources to duplicate oneself. Additionally, DNA is vulnerable during replication, as are newly forming and folding proteins. The reasonable strategy during stressful conditions is to inhibit growth and reproduction by undergoing quiescence.
The only movement of cells in this program is reproduction into vacant spaces (only one cell is permitted in a space). Key host cells, in not replicating, never move. One of the pathogen strategy choices allows pathogen cells to move to empty adjacent spaces even when not replicating. Under most situations movement of pathogens can enhance pathogenicity by increasing the spread of the infection. However, if the pathogens are less toxic than the host cells, the increased contact with host cells will tend to be harmful to the motile pathogens. The converse is true for host cell movement when that option is turned on.
THINGS TO TRY
For a given pathogen phenotype, one can be an active participant by adjusting the sliders for the various host defenses. Most notably one can play with the systemic-host-stressor switch to try to use the stressors of the acute-phase response (fever, etc.). The auto-systemic-stressor switch was developed to simplify host defense without killing the host from excessive stress. The settings were developed through trial-and-error and have not been optimized, so it should be possible to improve upon it.
The effect of dual infections can be modeled by using the second pathogen with a differing phenotype. For a mouse model of concomitant infection see Lundqvist J, et al. Concomitant infection decreases the malaria burden but escalates relapsing fever borreliosis. Infect. Immun. 2010, 78:1924-30.
NETLOGO FEATURES
CREDITS AND REFERENCES
If you mention this model in a publication, we ask that you include these citations for the model itself and for the NetLogo software:
Wilensky, U. (1999). NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.
COPYRIGHT AND LICENSE
Copyright 2013 Edmund K. LeGrand and Judy Day.
EXTENDING THE MODEL
The model can be extended by studying tolerance, evolution of pathogens by selection among various pathogen types during an infection, by adding in specialized defense cells, and by allowing and rewarding pathogen transmission.
Comments and Questions
breed [ circles circle ] ;; Host cells breed [ flags flag ] ;; Key host cells breed [ triangles triangle ] ;; Pathogens A breed [ stars star ] ;; Pathogens B turtles-own [energy max-energy start-energy birth-energy] ;; All turtles have energy and a maximum amount of energy they can take on. patches-own [countdown patch-energy] ;; Countdown makes it run. Patch-energy is new to the program. circles-own [circle-energy-to-survive] flags-own [flag-energy-to-survive] triangles-own [triangle-energy-to-survive] stars-own [star-energy-to-survive] globals [cumulative-energy-deficit pathB report-pathogen-eliminated-ticks report-pathogens-overrun-host] to setup clear-all set pathB 1 ;; Turns the pathB switch in the code to "on" in the setup. The user must still physically turn on the switch at the interface screen. set report-pathogen-eliminated-ticks 1 ;; Needed to have the Results display be able to display "Pathogens eliminated in ____ ticks." only once instead of repeatedly. set report-pathogens-overrun-host 1 ;; Needed to have the Results display be able to display "Pathogens overrun host." only once instead of repeatedly. ;; The latter two lines are used in the code for the Go buttons. set systemic-host-stressor 0 ;; Always starts it at 0 so you don't have to remember to manually reset it. ADDED MAY 23 set upper-systemic-stressor-threshold 30 ;; ditto, May 23 set lower-systemic-stressor-threshold 5 ;; ditto, May23 ask patches [ set pcolor green set patch-energy 100] set-default-shape circles "circle" ;; Host cells ask patches [ sprout-circles 1 [set color blue set start-energy 300 set birth-energy 90 set max-energy 300 set circle-energy-to-survive 40] ] ;; START-ENERGY HAD BEEN 120 FOR ALL CELLS set-default-shape flags "flag" ;; key host cells such as heart cells ask patches with [(pycor < 3) and (pycor > -3 ) and (pxcor < 3) and (pxcor > 0)] [sprout-flags 1 [ set color orange set start-energy 300 set max-energy 300 set flag-energy-to-survive 30] ] ;; Can store lots of energy; not prone to apoptosis since irreplaceable. ask circles with [ (pycor < 3) and (pycor > -3 ) and (pxcor < 3) and (pxcor > 0)] [ die ] ;; This clears out the circles underneath the flags. ;; for the flag area (the "heart"), I've divided it into 3 domains, so each of these 3 sets of code are needed to create it so that host cells can migrate in if needed. set-default-shape flags "flag" ;; Needed to make sure that host cells could always have a chance of replacing dead key host cells, so needed to "hollow out" the core of the key host organ. ;; There were rare instances when, with a solid key host organ, a central key host cell died but it couldn't be rplaced by a host cell. ;; In those instances, the host could never regenerate the full 1089 cells and recovery would never occur. ask patches with [(pycor < 3) and (pycor > -3 ) and (pxcor < 0) and (pxcor > -3)] [sprout-flags 1 [ set color orange set start-energy 300 set max-energy 300 set flag-energy-to-survive 30] ] ;; Can store lots of energy; not prone to apoptosis since irreplaceable. ask circles with [ (pycor < 3) and (pycor > -3 ) and (pxcor < 0) and (pxcor > -3)] [ die ] ;; This clears out the circles underneath the flags. set-default-shape flags "flag" ;; This lets host cells always be adjacent to a key host cell so recovery is possible. ask patches with [(pycor < 3) and (pycor > 0) and (pxcor = 0)] [sprout-flags 1 [ set color orange set start-energy 300 set max-energy 300 set flag-energy-to-survive 30] ] ;; Can store lots of energy; not prone to apoptosis since irreplaceable. ask circles with [ (pycor < 3) and (pycor > 0) and (pxcor = 0)] [ die ] ;; This clears out the circles underneath the flags. set-default-shape triangles "triangle" ;; Pathogens A (these are like large extracellular pathogens) ask circles with [ (pycor <= start-upper-pathogen-pycor) and (pycor > start-lower-pathogen-pycor) and (pxcor <= start-upper-pathogen-pxcor) and (pxcor > start-lower-pathogen-pxcor) ] [ die ] ;; This clears out the circles underneath where the triangles will be. ask patches with [ (pycor <= start-upper-pathogen-pycor) and (pycor > start-lower-pathogen-pycor) and (pxcor <= start-upper-pathogen-pxcor) and (pxcor > start-lower-pathogen-pxcor)] [sprout-triangles 1 [ set color red set start-energy 300 set birth-energy 60 set max-energy 300 set triangle-energy-to-survive 40] ] ;; Low energy storage compared to host cells is a vulnerability; same energy to survive as host cells. ;; The pathogens' energy to survive can be modified by the slider (see below). ask turtles [ set energy start-energy ] ;; Even though start-energy is mentioned above for each breed, this code is needed to actually impart the energy. reset-ticks end to go set cumulative-energy-deficit 326700 - ((sum [energy] of circles) + (sum [energy] of flags)) + cumulative-energy-deficit ;; There are 1089 potential host cells and key host cell x 300 max energy units per cell. ;; Note that the host starts with a deficit of 3000 because the of the initial infection (e.g. a bite wound). ;; The host must recover to its full 1089 cells. ;; Also changed the formula from 323700 to 326700 in the instantaneous-energy-deficit monitor on the interface. stop-adding-energy keep-turtles-still invoke-pathogen-harm invoke-pathogen-take-energy invoke-pathogen-low-energy invoke-pathogen-wander if auto-infect-with-pathogenB? and pathB = 1 ;; This is a switch in the code that permits turning off the secondary infection (pathogen B) after one tick. [if count circles <= 1000 ;;and mean [energy] of circles <= 90 ;; I added the mean energy statement, but this could have been instantaneoud-energy-deficit. [invoke-auto-infection-pathogenB] ] ;; This code for pathogenB, the secondary infection, is farther down. invoke-pathogenB-harm invoke-pathogenB-take-energy invoke-pathogenB-low-energy invoke-pathogenB-wander invoke-local-directed invoke-local-stressor invoke-clot-stressor invoke-amputation invoke-amputationB invoke-hostcell-wander invoke-auto-systemic-stressor-hostcell# invoke-auto-systemic-stressor-pathogen# invoke-auto-systemic-stressor-combined replicate check-death tick end to stop-adding-energy ;; Limits the amount of energy each cell can store, but there can be temporary overshooting of the amount. ask turtles [ if energy >= max-energy [set energy max-energy ]] end to keep-turtles-still ;; This sets the action. The switches on the interface screen allow movement to adjacent vacant spacesfor either pathogens or host cells. ask turtles [ right random 360 forward 0 ;; This gets the turtles, especially the flags, to move in place; therefore no visible movement but it lets time occur (ticks go). ;; All turtles derive energy from the patches as patch-energy at each tick and lose a little less energy (metabolic energy) with each tick. set energy (random-normal 1 0.02) * (energy + ((patch-energy * 0.14) * ((100 - systemic-host-stressor) / 100))) ;; The systemic host stressor is here. ; set energy (random-normal 1 0.02) * (energy + (14 * (100 - systemic-host-stressor) / 100)) ;; This was old code where the turtles were simply given energy at each tick. set energy (random-normal 1 0.02) * (energy - 10) ;; Every tick costs the turtles about 10 units of energy. ;; This is the energy gain and loss per tick; the random-normal (mean of 1 and SD of 0.02) gives a bit of randomness to the whole program. ;; I don't want too much randomness since all turtles are bathed in the same fluid of patch-energy and are superficially identical ;; There's additional randomness in the pathogen damage routine and in the host defense routines. ;; The systemic host stressor represents the acute-phase response: fever, iron & zinc sequestration, anorexia/nutrient restriction, anemia/hypoxia, systemic acidosis, etc. ifelse show-energy? ;; This is for the switch on the interface screen. Best to have it on. [ set label round energy] ;; "round" rounds the energy value on the screen to a readable integer. [ set label ""] ;; If set to "No", no energy values show on the screen ] end ;; PATHOGEN PHENOTYPE SLIDERS & SWITCH to invoke-pathogen-harm ;; This acts like a toxin to harm adjacent host cells. ask triangles [ ask circles in-radius 1 [ set energy (random-normal 1 0.02) * (energy - pathogen-harm-hostcells) ]] ask triangles [ ask flags in-radius 1 [ set energy (random-normal 1 0.02) * (energy - pathogen-harm-hostcells) ]] end to invoke-pathogen-take-energy ;; This gives the pathogen energy when it's adjacent to a host cell. ask triangles [ if any? circles in-radius 1 [ set energy (random-normal 1 0.02) * (energy + pathogen-take-up-energy) ]] ask triangles [ if any? flags in-radius 1 [ set energy (random-normal 1 0.02) * (energy + pathogen-take-up-energy) ]] end to invoke-pathogen-low-energy ;; Lowering the "pathogen-survive-low-energy" number lets them survive better. They still need 120 energy units to reproduce (2 * birth-energy). ask triangles [ set triangle-energy-to-survive pathogen-survive-low-energy ] ask triangles [ set max-energy pathogen-survive-low-energy + 260 ] ;; As a minor handicap for enhanced survival, I've also reduced the max-energy they can store. end to invoke-pathogen-wander ;; In this model, letting the pathogens move to free spaces helps them only if they are more lethal than host cells; otherwise they're more vulnerable. ifelse pathogen-wander? [ ask triangles [ let empty-patches neighbors with [ not any? turtles-here ] if pcolor = green [ if any? empty-patches [ let target one-of empty-patches face target move-to target ]] if pcolor = 43 and random (clot-restrict-motion + 1) = 0 ;; When pathogen-wander? is on this lets the clot restrict the motion. ;; "random 1" makes one random number which is always 0; random 2 makes either a 0 or 1; ... ; random 5 makes 0,1,2,3 or 4. ;; Therefore the slider set at 0 makes random 1, which always produces 0, so there is no motion restriction. ;; When the slider is set to 1, the turtle moves approx. 50% of the time; when slider is set to 4, the turtle moves 20% of the time (1 tick in 5). [ if any? empty-patches [ let target one-of empty-patches face target move-to target ]] ] ] [ ] end ;; PATHOGEN B PHENOTYPE SLIDERS & SWITCH to invoke-auto-infection-pathogenB ;; The parameters needed to start this secondary infection are coded earlier in the program. ask circles with [ (pycor <= start-upper-pathogenB-pycor) and (pycor > start-lower-pathogenB-pycor) and (pxcor <= start-upper-pathogenB-pxcor) and (pxcor > start-lower-pathogenB-pxcor)] [die] ;; This clears out the host cells at the site before pathogen B comes along (otherwise the pathogens and the host cells are on the same patch and most pathogens die). ask patches with [ (pycor <= start-upper-pathogenB-pycor) and (pycor > start-lower-pathogenB-pycor) and (pxcor <= start-upper-pathogenB-pxcor) and (pxcor > start-lower-pathogenB-pxcor)] [sprout-stars 1 [ set color red set start-energy 300 set birth-energy 60 set max-energy 300 set star-energy-to-survive 40] ] ask stars [ set energy start-energy ] set pathB 0 ;; This turns off the infection with pathogen B after a single round. end to invoke-pathogenB-harm ;; This acts like a toxin to harm adjacent host cells ask stars [ ask circles in-radius 1 [ set energy (random-normal 1 0.02) * (energy - pathogenB-harm-hostcells) ]] ask stars [ ask flags in-radius 1 [ set energy (random-normal 1 0.02) * (energy - pathogenB-harm-hostcells) ]] end to invoke-pathogenB-take-energy ;; This gives pathogen B energy when adjacent to host cell ask stars [ if any? circles in-radius 1 [ set energy (random-normal 1 0.02) * (energy + pathogenB-take-up-energy) ]] ask stars [ if any? flags in-radius 1 [ set energy (random-normal 1 0.02) * (energy + pathogenB-take-up-energy) ]] end to invoke-pathogenB-low-energy ;; Lowering the "pathogenB-survive-low-energy" number lets them survive better ask stars [ set star-energy-to-survive pathogenB-survive-low-energy ] ask stars [set max-energy pathogenB-survive-low-energy + 160 ] ;; I've linked the max-energy they can use to the survival energy threshold as a minor handicap end to invoke-pathogenB-wander ;; In this model, letting the pathogens move to free spaces helps them only if they are more lethal than host cells; otherwise they're more vulnerable. ifelse pathogenB-wander? [ ask stars [ let empty-patches neighbors with [ not any? turtles-here ] if pcolor = green [ if any? empty-patches [ let target one-of empty-patches face target move-to target ]] if pcolor = 43 and random (clot-restrict-motion + 1) = 0 ;; When pathogenB-wander? is on this lets the clot restrict the motion. ;; "random 1" makes one random number which is always 0; random 2 makes either a 0 or 1; ... ; random 5 makes 0,1,2,3 or 4. ;; Therefore the slider set at 0 makes random 1, which always produces 0, so there is no motion restriction. ;; When the slider is set to 1, the turtle moves approx. 50% of the time; when slider is set to 4, the turtle moves 20% of the time (1 tick in 5). [ if any? empty-patches [ let target one-of empty-patches face target move-to target ]] ] ] [ ] end ;; HOST DEFENSES: SLIDERS & SWITCHES (Systemic stressor slider is already incorporated above) to invoke-local-directed ;; Host cells directly harm adjacent pathogens (as if injecting a toxin). ask circles [ ask triangles in-radius 1 [ set energy (random-normal 1 0.02) * (energy - local-host-directed) ]] ask circles [ ask stars in-radius 1 [ set energy (random-normal 1 0.02) * (energy - local-host-directed) ]] end to invoke-local-stressor ;; Harms all adjacent cells if the host cell is in contact with a pathogen as if depriving the area of nutrients or causing acidosis. ask triangles [ ask circles in-radius 1 [ ask turtles in-radius 1 [ set energy (random-normal 1 0.02) * (energy - local-host-stressor) ]]] ask stars [ ask circles in-radius 1 [ ask turtles in-radius 1 [ set energy (random-normal 1 0.02) * (energy - local-host-stressor) ]]] end to invoke-clot-stressor ;; Makes a "clot" at the inflammatory site to reduce patch energy (blood replacement) and reduce cell movement. ;; The effect of the clot on energy is controlled by the slider "%-reduced-clot-patch-energy", though I'm not sure exactly what it's doing. ;; The effect on motion (so far on the pathogen) is set at "invoke-pathogen-wander" above. Need a switch or slider for that and do the same for pathogen B and host cells. ask circles [if any? triangles in-radius 1 [ask patches in-radius 2 [set pcolor 43]]] ask circles [if any? stars in-radius 1 [ask patches in-radius 2 [set pcolor 43]]] ask patches [ifelse pcolor = 43 [ set patch-energy (100 - %-reduced-clot-patch-energy)] [ set patch-energy 100]] ask circles [if not any? triangles in-radius 4 and not any? stars in-radius 4 [ask patches in-radius 1 [set pcolor green]]] ;; Lets recovering host cells clear the clot, allowing host recovery. end to invoke-amputation ;; This code harms all cells in the lower right region as if using a tourniquet (or hypersensitive reaction in plants). ask turtles with [ (pycor < 0) and (pxcor > 10)] [ set energy (random-normal 1 0.02) * (energy * ((100 - regional-amputation) / 100)) ] end to invoke-amputationB ;; This code harms all cells in the lower left region as if using a tourniquet (or hypersensitive reaction in plants). ask turtles with [ (pycor < 0) and (pxcor < -10)] [ set energy (random-normal 1 0.02) * (energy * ((100 - regional-amputationB) / 100)) ] end to invoke-hostcell-wander ;; Lets the host cells move to free spaces. ifelse hostcell-wander? ;; This slightly helps the host IF the host cells can harm the pathogens either directly or by local stressing. [ ask circles [ let empty-patches neighbors with [ not any? turtles-here ] if pcolor = green [ if any? empty-patches [ let target one-of empty-patches face target move-to target ]] if pcolor = 43 and random (clot-restrict-motion + 1) = 0 ;; When hostcell-wander? is on this lets the clot restrict the motion. ;; "random 1" makes one random number which is always 0; random 2 makes either a 0 or 1; ... ; random 5 makes 0,1,2,3 or 4. ;; Therefore the slider set at 0 makes random 1, which always produces 0, so there is no motion restriction. ;; When the slider is set to 1, the turtle moves approx. 50% of the time; when slider is set to 4, the turtle moves 20% of the time (1 tick in 5). ;; When the slider is set to 9, the turtle moves 1 tick in 10 or 10% of the time. [ if any? empty-patches [ let target one-of empty-patches face target move-to target ]] ] ] [ ] end to invoke-auto-systemic-stressor-hostcell# ;; An automatic device that quickly turns the systemic stressor on and then off, etc. Lots of overshooting with this strategy. ifelse auto-systemic-stressor-hostcell#? ;; However, once the pathogen invades enough that there are less than 925 host cells, it won't turn on anymore. [ if count circles <= 1030 ;;and (count triangles + count stars) >= 5 ;; This works better with it in (allows more recovery), BUT IT'S A DIFFERENT MODEL. -May 23 2013 [ set systemic-host-stressor 60 ] if (count circles <= 925) ;; and count triangles < 5) ;;This lets the stress continue below 925 if pathogens still present (better defense) [ set systemic-host-stressor 0 ]] [ ] if (count triangles + count stars) = 0 ;; These 2 lines allow the host to recover after eliminating the pathogens (otherwise the stressor stays at 60). [set systemic-host-stressor 0] end ;; This defense is helpless if the number of host cells can't get back up tp 925, unlike the cycling that depends on pathogen numbers (below). to invoke-auto-systemic-stressor-pathogen# ;; Based on pathogen numbers. The lower threshold guarantees the systemic stressing will cycle. ifelse auto-systemic-stressor-pathogen#? [ if (count triangles + count stars) >= upper-systemic-stressor-threshold ;; threshold is set with a slider (recommend a setting of 30 [comparable to having 1030 host cells]) [ set systemic-host-stressor 60 ] if (count triangles + count stars) <= lower-systemic-stressor-threshold ;; threshold is set with a slider (recommmend a setting of 5) [ set systemic-host-stressor 0 set upper-systemic-stressor-threshold 0.5 * upper-systemic-stressor-threshold set lower-systemic-stressor-threshold 0.5 * lower-systemic-stressor-threshold]] [ ] if (count triangles + count stars) = 0 ;; These 2 lines allow the host to recover after eliminating the pathogens (otherwise the stressor stays at 60). [set systemic-host-stressor 0] end ;;May 23, 2013. THIS WORKS FAIRLY WELL BECAUSE OF THE "AND" 5 LINES DOWN. to invoke-auto-systemic-stressor-combined ;; An automatic device that combines knowledge of pathogen numbers and host status to balance death due to sepsis and due to pathogen overgrowth. ifelse auto-systemic-stressor-combined? ;; [ if (count circles <= 1030 and (count triangles + count stars) >= 15) or ((count triangles + count stars) >= upper-systemic-stressor-threshold) ;;This requires host damage as well as pathogens to set it off (rather than just host damage alone). It works better and is more biologically relevant. [ set systemic-host-stressor 60 ] if ((count triangles + count stars) <= lower-systemic-stressor-threshold) or (count circles <= 925) ;; PUTTING "and" here is more aggressive; putting "or" should make it less aggressive--better for host ;; The systemic stressor stays on longer (well below 925 host cells) so sepsis can eventually be due to not enough host cells (as well as key host cells). [ set systemic-host-stressor 0 set upper-systemic-stressor-threshold 0.5 * upper-systemic-stressor-threshold set lower-systemic-stressor-threshold 0.5 * lower-systemic-stressor-threshold]] [ ] if (count triangles + count stars) = 0 ;; These 2 lines allow the host to recover after eliminating the pathogens (otherwise the stressor stays at 60). [set systemic-host-stressor 0] end ;; This defense is helpless if the number of host cells can't get back up tp 925, unlike the cycling that depends on pathogen numbers (below). to replicate ask triangles ;; Pathogens replicate if they have 2x birth-energy (60 units) and a vacant patch for the hatchling to move to. [ if energy > 2 * birth-energy and any? neighbors with [not any? turtles-here] [ set energy energy / 2 ;; This cuts the energy in half before hatching. hatch 1 [set energy birth-energy ;; There's a little lost energy since mother may have more than 2x birth-energy, let target one-of neighbors with [not any? turtles-here] ;; but daughter cell (hatchling) only gets the birth-energy. face target move-to target ] ] ] ask stars [ ;; Pathogen B replicate if they have 2x birth-energy (60 units) and a vacant patch for the hatchling to move to. if energy > 2 * birth-energy and any? neighbors with [not any? turtles-here] [ set energy energy / 2 ;; This cuts the energy in half before hatching. hatch 1 [set energy birth-energy ;; There's a little lost energy since mother may have more than 2x birth-energy, let target one-of neighbors with [not any? turtles-here] ;; but daughter cell (hatchling) only gets the birth-energy. face target move-to target ] ] ] ask circles [ if energy > 2 * birth-energy and any? neighbors with [not any? turtles-here] ;; Host cells replicate if they have 2x birth-energy (90 units) and a vacant patch for the hatchling to move to. [ set energy energy / 2 ;; This cuts the energy before hatching. hatch 1 [set energy birth-energy ;; There's a little lost energy since mother may have more than 2x birth-energy, let target one-of neighbors with [not any? turtles-here] ;; but daughter cell (hatchling) only gets the birth-energy. face target move-to target ] ] ] ;; Flags (key host cells) don't replicate end to check-death ask circles [ if energy <= circle-energy-to-survive [ die ]] ask flags [ if energy <= flag-energy-to-survive [ die ]] ask triangles [ if energy <= triangle-energy-to-survive [ die ]] ask stars [ if energy <= star-energy-to-survive [ die ]] end
There is only one version of this model, created over 11 years ago by Edmund LeGrand.
Attached files
File | Type | Description | Last updated | |
---|---|---|---|---|
NetLogo host versus pathogens model.png | preview | Red pathogens invading the host (host cells as gray circles) | over 11 years ago, by Edmund LeGrand | Download |
Edmund LeGrand
Extra features on far right side of interface
Note that on the extreme right side of the interface screen of the model there are additional sliders and settings that have been hidden to make a clean interface. These features, such as making an additional pathogen and moving the starting location of the pathogens, are functional.
Posted over 11 years ago