MIHS VirusCompetition

MIHS VirusCompetition preview image

1 collaborator

Larry_bencivengo Larry Bencivengo (Author)

Tags

arbitrium 

Tagged by Larry Bencivengo over 2 years ago

competition 

Tagged by Larry Bencivengo over 2 years ago

cooperation 

Tagged by Larry Bencivengo over 2 years ago

virus 

Tagged by Larry Bencivengo over 2 years ago

Visible to everyone | Changeable by the author
Model was written in NetLogo 6.1.1 • Viewed 299 times • Downloaded 42 times • Run 0 times
Download the 'MIHS VirusCompetition' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


WHAT IS IT?

A model of different virus strains infecting a host organism. There are two strains (Virus-1 and Virus-2) competing to become the dominant strain without killing the host.

HOW IT WORKS

Cells of the host are modeled by patches. Virus particles are modeled with turtles.

Free virus particles diffuse randomly and can enter an uninfected host cell when they encounter it. The particles only survive for a short time outside of a host cell.

Once inside the host cell, the virus may enter a lytic (i.e. reproductive) cycle or a lysogenic cycle where it copies its DNA into the host cell's DNA and becomes dormant for a time. The lytic cycle produces new virus copies and eventually kills the host cell, releasing free virus particles to infect other host cells. The lysogenic cycle allows the host cell to survive and reproduce, making copies of the viral DNA in the process. Eventually the dormant viral genes will "awaken" and enter a lytic cycle, reproducing and killing the host cell.

Different strains of the virus have different probabilities of entering the lytic or lysogenic cycle, and will remain dormant in the lysogenic cycle for various amounts of time. Healthy, uninfected cells are Gray. Cells with active (lytic cycle) infections of either strain are Red. Cells with dormant (lysogenoc cycle) infections are Green or Blue (depending onwhether they are infected by Virus-1 or Virus-2 strains, respectively).

If too many host cells die, the virus will be unable to reproduce and will also die off. The model attempts to capture the dynamic behavior of virus strains which are competing to reproduce as fast as possible without killing off the host (and each other) in the process.

HOW TO USE IT

Click Setup, then Go, to see the model run. You can change several variables using the sliders, including the starting number of host cells, starting number of virus particles, relative amounts of the two strains (Virus-1 vs Virus-2), and the probability that each strain will enter the lysogenic (dormant) life-cycle.

The model will automatically end if either of these conditions are met:

  1. There are no virus particles of either strain remaining and the cells have reached their maximum value.
  2. There are no cells and no virus particles of either strain remaining.

Various Monitors allow the user to see important values in the model, as explained below:

Total Cells: Total # of host cells Infected: Total # of host cells with infected by either strain of the virus Virus-1, Virus-2 & arbtrm: Total # of particles of each strain or # of arbitrium molecules

-Infected-1, #-Infected-2: Total # of host cells with an infection by each strain of the virus (this # includes both lytic and lysogenic infections)

-Lyso-1, #-Lyso-2: Total # of cells with lysogenic infections by each strain (this # excludes lytic infections)

THINGS TO NOTICE

Changing the probability that a virus strain enters the lysogenic (dormant) cycle will have the biggest effect on viral behavior: decreasing the probability will produce more active infections and tend to kill off the host cells more quickly, while increasing the probability will produce fewer active infections and allow host cells to survive and reproduce (perhaps with viral DNA stowing away inside them!).

Changing the starting number of host cells, number of virus particles or ratio of the two strains will primarily alter the chance that the host cells die off or survive.

Can you figure out what is happening with the mysterious arbitrium?

THINGS TO TRY

Which settings will tend to kill off the host most rapidly? Which ones will allow the host cells and virus to survive in a sort of equilibrium? What advantage does the virus gain by entering the lysogenic cycle? What happens when the two viral strains have very different probabilities of entering the lysogenic phase? Is this outcome affected by the starting numbers of cells and/or virus particles? The relative amounts of the two strains at the start?

Try stopping the model at various times to see how the levels of arbitrium are related to the number of virus particles. How are the level of arbitrium and the number of cells with lysogenic infections related?

Read the following article from Nature which is the basis for this model: https://www.nature.com/articles/d41586-019-01880-6

It will help you to understand the role of arbitrium in viral behavior. Is there a way to set up the two strains of the virus to simulate how a strain could "cheat" by ignoring the arbitrium signal, thereby gaining a competitive advantage over theo other strain? Over what range of settings is it possible for this "strategy" to be successful? Over what range is it doomed to failure?

EXTENDING THE MODEL

The model could be altered to allow multiple virus strains to infect the same host cell. Additional strains of the virus could be introduced.

The host cells currently have no defenses against viral infection; the behavior of the model would be dramatically altered if host cells could fight off infection by virus particles.

It could be interesting to explore an evolutionary model by giving the viruses genes which can mutate as the host cells produce new virus particles during lytic cycles. Thus, new strains of the virus would tend to emerge spntaneousy and begin competing with each other. Some interesting "genes" might control the lysogenic probability, replication speed, arbitrium sensitivity, etc.

NETLOGO FEATURES

One interesting feature of this model is the use of patches to represent cells and turtles to represent molecules/virus particle which are diffusing.

RELATED MODELS

This model is based upon an earlier model called "Cells in a Petri Dish".

CREDITS AND REFERENCES

Larry Bencivengo - Mercer Island High School (2022).

Dolgin, Elie (2019). "The Secret Social Lives of Viruses" in Nature, 18 June 2019. https://www.nature.com/articles/d41586-019-01880-6

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

;; *********************************************************************************
;; *************  Virus Competition Model                    ***********************
;; *************  By Larry Bencivengo                        ***********************
;; *************  May, 2022 - Mercer Island High School  ***********************
;; *********************************************************************************

;; This model simulates virus strains competing to reproduce without killing the host


globals [
  #-cells #-infected-cells #-virus-1 #-virus-2
  #-Infected-1 #-Infected-2 #-Lyso-1 #-Lyso-2
  virus-1-decay-rate virus-2-decay-rate arbitrium-decay-rate
  #-new-virus-1 #-new-virus-2 #-new-arbitrium
]
patches-own [cell? infected-1? infected-2? lytic? arbitrium-absorbed]
breed [viruses virus]
breed [arbitria arbitrium]
turtles-own [decay-rate]
viruses-own [virus-strain]

to setup
  clear-all
  ask patches [set pcolor white] ;; create a white background
  setup-cells                    ;; randomly identify start-#-cells patches as cells
  set #-infected-cells 0
  set #-Infected-1 0
  set #-Lyso-1 0
  set #-Infected-2 0
  set #-Lyso-2 0

  ;; set up virus shapes, starting numbers, decay-rate, etc.
  set #-virus-1 0
  set #-virus-2 0
  set virus-1-decay-rate 20
  set virus-2-decay-rate 20

  ;; generate starting viruses
  set-default-shape viruses "pentagon"
  setup-viruses

  ;; set up arbitrium shape, decay-rate, etc.
  set-default-shape arbitria "dot"
  set arbitrium-decay-rate 30

  reset-ticks
end 

  ;;  ****** coded to here ******
  ;;  ***************************

to setup-cells
  ;; generate cells by selecting random patches and setting cell? to true
  ;; repeat until the correct number of cells has been generated
  set #-cells 0
  while [#-cells < start-#-cells] [
    ;; select a random patch - if it is not already a cell, make it a cell
      ask patch random-pxcor random-pycor [if cell? = 0 [
      become-cell
      set #-cells #-cells + 1
      ]
    ]
  ]
end 

to become-cell  ;; this routine only called for starting cells
  set cell? 1
  set infected-1? 0          ;; change when infected virus
  set infected-2? 0          ;; change when infected
  set lytic? 0               ;; change when infected by virus in lytic cycle
  set pcolor gray
end 

to setup-viruses
  ;; use Virus-1_to_Virus-2_Ratio slider to create the initial virus population
  ;; create virus-1 particles
  set #-new-virus-1 start-#-viruses * (Virus-1_to_Virus-2_Ratio / 100)
  create-viruses #-new-virus-1 [
    set color green
    set size 0.5
    set virus-strain 1
    set decay-rate virus-1-decay-rate
    setxy random-xcor random-ycor
  ]
  ;; update #-virus-1
  set #-virus-1 #-new-virus-1

  ;; create virus-2 particles
  set #-new-virus-2 start-#-viruses - #-new-virus-1
  create-viruses #-new-virus-2 [
    set color blue
    set size 0.5
    set virus-strain 2
    set decay-rate virus-2-decay-rate
    setxy random-xcor random-ycor
  ]
  ;; update #-virus-2
  set #-virus-2 #-new-virus-2

  ;; update #-all-viruses and reset #-new-virus values to 0
  set #-new-virus-1 0
  set #-new-virus-2 0
end 


;; to go
;; arbitria molecules and virus particles move randomly
;; arbitria and viruses are "absorbed" by cells as they pass through patches
;; when viruses enter a cell, they will transition to a lytic or lysogenic cycle
;; depending on their lysogenic-probabilty and the level of arbitrium-absorbed
;; when cells accumulate enough viruses [lytic? = # of virus particles], they die ...
;; ... producing a number of new virus particles of the infecting strain equal to lytic?
;; if #-cells is less than 500, all cells with lytic? = 0 have a chance to reproduce
;; free viruses and arbitrium in cells will decay/die at a set rate
;; if #-cells with lytic? = 0 ever falls to zero, the host dies and the simulation ends

to go
  ;; stop when all uninfected cells and viruses dead
  if count patches with [cell? = 1] <= 0 and count viruses <= 0 [stop]
  ;; stop when viruses eradicated and cells take over
  if count viruses <= 0 and #-infected-cells = 0 and count patches with [cell? = 1] >= 500 [stop]
  ask turtles [move]
  ask patches [metabolize]
  add-viruses
  add-arbitrium
  ask patches [reproduce]
  ask patches [update-status]
  tick
end 

to move
  ;; molecules and virus particles decay at random intervals
  if random 100 <= decay-rate [
    ifelse is-arbitrium? self [die] [
      if virus-strain = 1 [set #-virus-1 #-virus-1 - 1]
      if virus-strain = 2 [set #-virus-2 #-virus-2 - 1]
      die
    ]
  ]
  ;; arbitrium molecules and viruses diffuse randomly
  right random 30
  left random 30
  forward 1
end 

to metabolize  ;; absorb viruses and arbitrium, metabolize arbitrium, generate new viruses, etc.
  ;; only cells metabolize
  if cell? = 1 [
    ;; absorb arbitrium from surroundings - arbitrium builds up and decays over time
    absorb-arbitrium
    if arbitrium-absorbed > 2 [set arbitrium-absorbed arbitrium-absorbed / 2]
    ;; absorb free viruses and become infected
    if infected-1? = 0 and infected-2? = 0 [become-infected]
    ;; if in lytic cycle of infection, produce new virus particles
    if lytic? != 0 [lytic-cycle]
  ]
end 

to absorb-arbitrium  ; cell procedure
  let available-arbitrium one-of arbitria-here              ; grab a random arbitrium molecule
  if available-arbitrium != nobody  [
    ask available-arbitrium [die]
    set arbitrium-absorbed arbitrium-absorbed + 1
  ]
  while [count arbitria-here > 1] [
    set available-arbitrium one-of arbitria-here            ; keep absorbing arbitrium
    if available-arbitrium != nobody  [
      ask available-arbitrium [die]
      set arbitrium-absorbed arbitrium-absorbed + 1
    ]
  ]
end 

to become-infected  ; cell procedure
  ; grab a random virus molecule
  let available-virus one-of viruses-here
  if available-virus != nobody  [                    ; if viruses present ...
    if [virus-strain] of available-virus = 1 [       ; ... become infected
      set infected-1? 1
      set #-Infected-1 #-Infected-1 + 1
      set #-Lyso-1 #-Lyso-1 + 1
      set #-virus-1 #-virus-1 - 1]
    if [virus-strain] of available-virus = 2 [
      set infected-2? 1
      set #-Infected-2 #-Infected-2 + 1
      set #-Lyso-2 #-Lyso-2 + 1
      set #-virus-2 #-virus-2 - 1]
    ask available-virus [die]                         ; original virus dies
    set #-infected-cells #-infected-cells + 1
    update-infection-status
  ]
end 

to lytic-cycle
  ;; if viruses in cell too high, cell dies ...
  ifelse lytic? >= 5 [                  ;; ... and releases free viruses of correct strain
    ;; if infected with strain-1, add new viruses of strain-1
    if infected-1? = 1 [set #-new-virus-1 #-new-virus-1 + lytic?]
    ;; else add new viruses of strain-2
    if infected-2? = 1 [set #-new-virus-2 #-new-virus-2 + lytic?]
    cell-death
    ]
    [ ;; keep producing viruses and arbitrium.
      ;; Rate of virus production inversely proportional to Lysogenic-Probability
      if infected-1? = 1 [
        (ifelse Virus-1-%-Lysogenic <= 25 [set lytic? lytic? + 3]
          Virus-1-%-Lysogenic <= 50 [set lytic? lytic? + 2]
          [set lytic? lytic? + 1])]
      if infected-2? = 1 [
        (ifelse Virus-2-%-Lysogenic <= 25 [set lytic? lytic? + 3]
          Virus-2-%-Lysogenic <= 50 [set lytic? lytic? + 2]
          [set lytic? lytic? + 1])]
      set #-new-arbitrium #-new-arbitrium + lytic?
    ]
end 

to update-infection-status
  let chance-lytic 0
  if lytic? = 0 [
    if infected-1? = 1 [
      ifelse arbitrium-absorbed > 1 [
        set chance-lytic (Virus-1-%-Lysogenic * arbitrium-absorbed)]
        [set chance-lytic Virus-1-%-Lysogenic]
      if random 101 > chance-lytic [
        set lytic? 1
        set #-Lyso-1 #-Lyso-1 - 1
      ]
    ]
    if infected-2? = 1 [
      ifelse arbitrium-absorbed > 1 [
        set chance-lytic (Virus-2-%-Lysogenic * arbitrium-absorbed)]
        [set chance-lytic Virus-2-%-Lysogenic]
      if random 101 > chance-lytic [
        set lytic? 1
        set #-Lyso-2 #-Lyso-2 - 1
      ]
    ]
  ]
end 

to cell-death
  set cell? 0
  set pcolor white
  if infected-1? = 1 [
    set infected-1? 0
    set #-Infected-1 #-Infected-1 - 1
  ]
  if infected-2? = 1 [
    set infected-2? 0
    set #-Infected-2 #-Infected-2 - 1
  ]
  set lytic? 0
  set arbitrium-absorbed 0
  set #-cells #-cells - 1
  set #-infected-cells #-infected-cells - 1
end 

to add-viruses
  ;; create new viruses of strain-1 based on #-new-virus-1
  if #-new-virus-1 > 0 [
    create-viruses #-new-virus-1 [
      set virus-strain 1
      set decay-rate virus-1-decay-rate
      set color green
      set size 0.5
      setxy random-xcor random-ycor
    ]
    set #-virus-1 #-virus-1 + #-new-virus-1
  ]
  ;; create new viruses of strain-2 based on #-new-virus-2
  if #-new-virus-2 > 0 [
    create-viruses #-new-virus-2 [
      set virus-strain 2
      set decay-rate virus-2-decay-rate
      set color blue
      set size 0.5
      setxy random-xcor random-ycor
    ]
    set #-virus-2 #-virus-2 + #-new-virus-2
  ]
  ;; reset values of #-new-virus-1 and #-new-virus-2 for next tick
  set #-new-virus-1 0
  set #-new-virus-2 0
end 

to add-arbitrium
  ;; produce new arbitrium molecules based on #-new-arbitrium
  if #-new-arbitrium > 0 [
    create-arbitria #-new-arbitrium [
      set decay-rate arbitrium-decay-rate
      set color black
      set size 0.5
      setxy random-xcor random-ycor
    ]
  ]
  ;; reset value of #-new-arbitrium for next tick
  set #-new-arbitrium 0
end 

to reproduce
  ;; only cells reproduce
  if cell? = 1 and lytic? = 0 [     ;; if not in lytic phase, chance to divide
    ;; check for empty adjacent patch
    if any? neighbors with [cell? = 0] [
      ;; probability of dividing decreases as #-cells approaches 500
      if random 500 < ((1 - #-cells / 500) * 100) [
        ;; create a new cell in an adjacent patch
        ;; new cell inherits infection status of original and one half of arbitrium-absorbed
        let virus-1-status infected-1?
        let virus-2-status infected-2?
        set arbitrium-absorbed arbitrium-absorbed / 2
        let amount-arbitrium arbitrium-absorbed
        ;; turn a neighboring patch into a cell
        ask one-of neighbors with [cell? = 0] [
          set cell? 1
          set lytic? 0
          set infected-1? virus-1-status
          set infected-2? virus-2-status
          set arbitrium-absorbed amount-arbitrium
        ]
        ;; update global variables
        set #-cells #-cells + 1
        if infected-1? = 1 or infected-2? = 1 [set #-infected-cells #-infected-cells + 1]
        if infected-1? = 1 [
          set #-Infected-1 #-Infected-1 + 1
          set #-Lyso-1 #-Lyso-1 + 1]
        if infected-2? = 1 [
          set #-Infected-2 #-Infected-2 + 1
          set #-Lyso-2 #-Lyso-2 + 1]
      ]
    ]
  ]
end 

to update-status
  ;; update each cell's pcolor to indicate its status:
  ;; healthy = gray, lytic = red, lysogenic = green (virus-1) or blue (virus-2)
  if cell? = 1 [
    update-infection-status
    ifelse lytic? > 0 [
      set pcolor red
    ]
    [(ifelse infected-1? = 1 [
      set pcolor green]
      infected-2? = 1 [
        set pcolor blue]
      [set pcolor gray])
    ]
  ]
end 

There are 5 versions of this model.

Uploaded by When Description Download
Larry Bencivengo over 2 years ago Edited Info Tab and added/improved sliders Download this version
Larry Bencivengo over 2 years ago Fixed start values of sliders Download this version
Larry Bencivengo over 2 years ago Fixed bug that caused virus to stay lysogenic permanently; now it will always eventually switch back to lytic cycle Download this version
Larry Bencivengo over 2 years ago Improved Data Collection and End-Model behaviors Download this version
Larry Bencivengo over 2 years ago Initial upload Download this version

Attached files

File Type Description Last updated
MIHS VirusCompetition.png preview Preview for 'MIHS VirusCompetition' over 2 years ago, by Larry Bencivengo Download

This model does not have any ancestors.

This model does not have any descendants.