Evolution of antibiotic resistance

Evolution of antibiotic resistance preview image

1 collaborator

Default-person Jeewoen Shin (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by the author
Model was written in NetLogo 6.0.4 • Viewed 355 times • Downloaded 16 times • Run 0 times
Download the 'Evolution of antibiotic resistance' 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?

NOTE: This is a transformed model of the Bacterial Infection model in the NetLogo Models Library. Additional model information can be found in the Info tab in the original model. The model shows bacterial growth and antibiotic resistance through membrane permeability changes. Bacterial mutation rate is very high compared to that of human cells. The administration of antibiotics causes a selection pressure on bacteria and induces the evolution of antibiotic resistance. The model explains how bacteria evolve antibiotic resistance through the mutations which change membrane permeability.

HOW IT WORKS

A patient is infected with four different strains of bacteria, each with different membrane permeability level. The bacterial mutation changes membrane pereability, which is represented by the number of holes in the bacterial cell membrane. Also, the number of holes in the bacterial cell membrane indicates susceptibility to antibiotics. A random mutation can add one hole or remove one hole. Mutations to the number of holes exceeding the range between three and six do not occur.

Bacterial natural death is considered in the model.

A patient can take antibiotics repeatedly. Antibiotic molecules enter the patient's bloodstream and kill bacteria as they travel through the patient's body. The space is the patient's bloodstream. Antibiotics are given by placing moleucles at random positions in the space. The molecules move around the bloodstream until they decompose and exit the space. The half of exising antibiotic molecules decomposes every half-life.

HOW TO USE IT

MUTATIONP: During the asexual reproduction, mutations can occur which change the number of holes in the bacterial cell membrane. MUTATIONP is a probability of a mutation that changes membrane permeability per reproduction.

BACTERIA-DEATH-PROB: Bacterial natural death occurs with a given probability, BACTERIA-DEATH-PROB at every time point.

HALF-LIFE: When antibiotics enter the patient's bloodstream, the half of the existing antibiotic molecules decompose and are removed from the space at every HALF-LIFE.

THINGS TO TRY

At first, try bacteria reproduction without mutations (set REPRODUCE? to "on" and set MUTATIONP to 0). Then, increase MUTATIONP and allow bacteria to change their membrane permeability and observe changes in bacterial growth and the distribution of different strains (permeability).

Fix all bacteria traits to represent certain bacteria. Imagine developing new antibiotic treatment. Antibiotics have three parameters: dosage, frequency, and half-life. Change these three parameters to find successful combinations, i.e., successful treatments killing all bacteria.

EXTENDING THE MODEL

Considering that bacteria can move with flagella, the model could be extended to allow bacteria to move in the space.

RELATED MODELS

Bacterial Infection model in the NetLogo Models Library.

CREDITS AND REFERENCES

The original model is authored by Uri Wilensky (Copyright 2016 Uri Wilensky).

References: Novak, M. and Quigley, D and Wilensky, U. (2016). NetLogo Bacterial Infection model. http://ccl.northwestern.edu/netlogo/models/BacterialInfection. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.

Wilensky, U. (1999). NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.

Comments and Questions

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

Click to Run Model

breed [ antibiotics antibiotic ]
breed [ bacterias bacteria ]

bacterias-own [
  variation
  age
  my-target-patch
]

patches-own [
  my-bacteria
]

globals [
  antibiotic-flow-rate
  fever-factor?
  #-minutes
  #-hours
  #-days
  bacteria-counts
  given-doses
  wiped-out?
  tick-entered ; each antibiotics entering time
]

;;;;;;;;; initial setup procedures ;;;;;;;;;

to setup
  clear-all

  set-default-shape bacterias "bacteria"

  set fever-factor? false
  set antibiotic-flow-rate 0.8
  set #-hours 0
  set #-days 0
  set #-minutes 0
  set given-doses 0
  set wiped-out? false

  ask patches [
    set pcolor white
    set my-bacteria nobody
  ]

  setup-initial-bacteria

  reset-ticks
end 

to setup-initial-bacteria
  let which-variations (list 3 4 5 6) ; four types of bacteria
  let #init-of-each-variation (list init#-3pores init#-4pores init#-5pores init#-6pores)
  (foreach #init-of-each-variation which-variations [ [n v] -> make-bacteria n v ])

  update-bacteria-counts
end 

to make-bacteria [ number-of-bacteria which-variation ]
  create-bacterias number-of-bacteria [
    let this-bacteria self
    set variation which-variation
    set shape (word "bacteria-holes-" variation)
    set my-target-patch one-of patches with [ my-bacteria = nobody ]
    move-to my-target-patch
    ask my-target-patch [ set my-bacteria this-bacteria ]
    set age (reproduce-every * 60) ; initial bacteria are aged enough to be reproductive
    set size 1
    set color variation-color variation
  ]
end 

;;;;;;;;;;;;;;;;;;;;;; runtime procedures ;;;;;;;;;;;;;;;;;;;;;;

to go
  reproduce-bacteria-into-available-space
  let count-of-bacteria count bacterias
  ask bacterias [
    move-bacteria  ; do age ++
    natural-death-bacteria
  ]
  move-antibiotics
  antibiotics-remove ; half of antibiotic molecules are removed at every half-life
  dose-admin
  update-bacteria-counts
  tick
  update-time
end 

to dose-admin
  if not any? bacterias with [ not wiped-out? ] [
    set wiped-out? true
  ]
  auto-dose
end 

to update-bacteria-counts
  ; count each type of bacteria. used for output plots.
  let cnt [ 0 0 0 0 ]
  ask bacterias [
    let i variation - 3
    set cnt replace-item i cnt (item i cnt + 1)
  ]
  set bacteria-counts cnt
end 

to update-time
  ; one tick = 1 minute in simulated time
  set #-minutes ticks
  set #-hours floor (ticks / 60)
  set #-days (floor (#-hours / 2.4) / 10)
end 

;;;;;;;;;;;;;;;;;;; antibiotic procedures ;;;;;;;;;;;;;;;;;;;

to auto-dose
  if give-dose? [
    dose-enter dosage
    set given-doses given-doses + 1
    set tick-entered ticks
  ]
end 

to-report give-dose?
  report
    ticks mod (dose-every * 60) = 0 and
    not wiped-out? and (
      (auto-dose? = "yes, skip no doses")
    )
end 

to dose-enter [ amount ]
  create-antibiotics amount[
    set shape "molecule"
    set size 1
    set color red
    setxy random-xcor random-ycor ; an antibiotic molecule is assigned to a random position.
  ]
end 

to move-antibiotics
  ask antibiotics [
    forward antibiotic-flow-rate
    check-antibiotic-interaction

    set heading random-float 360 ; freely change its direction as it moves around the space.
  ]
end 

to check-antibiotic-interaction
  let this-molecule self
  if any? bacterias-here [
    ask one-of bacterias-here [
      if kill-this-bacteria? [
        ask this-molecule [ die ]
        bacteria-death
      ]
    ]
    die
  ]
end 

to antibiotics-remove ; every half-life
  if (ticks - tick-entered) mod (half-life * 60) = 0 [
    let count-of-antibiotics count antibiotics
    ask n-of (0.5 * count-of-antibiotics) antibiotics [ die ]
  ]
end 

;;;;;;;;;;;;;;;;;;; bacteria  procedures ;;;;;;;;;;;;;;;;;;;;

to bacteria-death
  let this-bacteria self
  if is-patch-set? my-target-patch [
    ask my-target-patch [
      set my-bacteria nobody
    ]
  ]
  die
end 

to natural-death-bacteria
  if random-float 1 < bacteria-death-prob [
    bacteria-death
  ]
end 

to move-bacteria
  let my-distance-to-my-patch-center distance my-target-patch
  let speed-scalar 0.15 ; scales the speed of motion of the bacteria
  if my-distance-to-my-patch-center > 0.2 [
    set heading towards my-target-patch
    forward 0.1 * speed-scalar
    set age 0
  ]
  set age age + 1
end 

to reproduce-bacteria-into-available-space
  let count-of-bacteria count bacterias
  let all-bacteria-that-can-reproduce bacterias with [ can-reproduce? count-of-bacteria ]
  let this-fever-factor 1

  if reproduce? [
    ask all-bacteria-that-can-reproduce [
      let available-patches neighbors with [ my-bacteria = nobody ]
      let this-bacteria self
      if any? available-patches [
        hatch 1 [
          set my-target-patch one-of available-patches
          ask my-target-patch [ set my-bacteria this-bacteria ]

          let new_variation variation
          if random-float 1 < mutation_p [ ; mutate offspring variation: +1 or -1
            ifelse random-float 1 < 0.5[
              set new_variation variation - 1 ; mutation decreasing susceptibility
            ]
            [
              set new_variation variation + 1 ; mutation increasing susceptibility
            ]
            ; if new number of holes excedes the min or max number of holes,
            ; keep its original value (i.e., no mutation occurs).
            if new_variation >= 3 and new_variation <= 6 [
              set variation new_variation
              set color variation-color variation
              set shape (word "bacteria-holes-" variation)
            ]
          ]
        ]
      ]
    ]
  ]
end 

;;;;;;;;;;;;;;;;;;;;;;; reporters ;;;;;;;;;;;;;;;;;;;;;;;;

to-report kill-this-bacteria?
  ; variations go from 3 to 6, for the number of holes in the membrane,
  ; so the odds of getting into the bacteria are 30%, 40%, 50% and 60%
  report random 100 < (variation * 10)
end 

to-report can-reproduce? [ total-bacteria-count ]
  let result false
  let this-fever-factor 1
  ; total-bacteria-count is used to simulate a slower growth rate for bacteria as their numbers increase in the body
  ; due to an immune system response of raising the temperature of the body as more an more bacteria above a certain
  ; threshold are detected in the body
  if total-bacteria-count > 50 and fever-factor? [
    set this-fever-factor (1 + 2 * ((total-bacteria-count - 50) / 75))
  ]
  if age >= (reproduce-every * 60 * this-fever-factor) [
    if not any? other bacterias in-radius 0.75 and my-target-patch = patch-here [
      set result true
    ]
  ]
  report result
end 

;;;;;;;;;;;;;;;; visualization procedures ;;;;;;;;;;;;;;;;

to-report variation-color [ which-variation ]
  report item (which-variation - 3) [ violet green brown red orange ]
end 

;;;;;;;;;;;;;;;;; plotting procedures ;;;;;;;;;;;;;;;;;;;;;

to make-variation-pens [ plot-pen-mode ]
  foreach [ 3 4 5 6 ] [ v ->
    create-temporary-plot-pen (word v)
    set-plot-pen-mode plot-pen-mode ; bar mode
    set-plot-pen-color variation-color v
  ]
end 

There is only one version of this model, created about 5 years ago by Jeewoen Shin.

Attached files

File Type Description Last updated
Evolution of antibiotic resistance.png preview Preview for 'Evolution of antibiotic resistance' about 5 years ago, by Jeewoen Shin Download

This model does not have any ancestors.

This model does not have any descendants.