Before we start...

This lecture will start soon! To save time, please ensure the following:

  • You have these slides open in your browser
    (computational-immunology.org/inge/presentations/MIN04-2020)
  • You have the exercise sheet at hand
  • You have pen + paper at your disposal. If you have lined paper or even graph paper ("ruitjespapier"), this may come in useful today...
  • You have typed your name in the chat so I can see you are here

Camera rules:

  • Please turn your camera on (this lecture will be better if I can see your faces!)
  • If you have very strong objections to being recorded, let me know in the chat. (This lecture will only be accessible on brightspace, so no worries - your face won't be all over the world wide web 😀)
  • MIN04 Lecture, September 29th, 2020


    Cellular automata

    Simple models of dynamic interactions in 2D


    Inge Wortel
    inge.wortel@radboudumc.nl
    Department of Tumor Immunology, Radboudumc

    The ultimate question: what will happen next?

    What did we miss yesterday?

    Chat Brainstorm
    Thinking about the picture of the TME in the previous slide, do you think we could model this with the type of model discussed yesterday? What difficulties might we encounter?

    The tumor microenvironment (TME)



    • Consists of tumor, immune, and stromal cells

    The tumor microenvironment (TME)



    • Consists of tumor, immune, and stromal cells
    • These cells interact via direct contact or diffusing chemicals
    • Location matters!

    Modeling in time and space

    Yesterday:

    • ODE models can help predict how a system develops over time
    • We can use them e.g. to model how fast a tumor grows
    • But: these models contained no info on cell location!

    Today:

    • How do we make models with spatial information?
    • Morning: simple spatial models - cellular automata
    • Afternoon: more complex models - towards modeling the TME

    Cellular automata

    Cellular automata are simple spatial models:

    • They consist of pixels on a grid
    • These pixels can have different states
    • These states change over time according to some rules.

    Example: bacterial colony growth (very simple model):

    • Grid represents a 2D petridish
    • Pixels can have two states: they contain bacteria (black), or they don't (white)
    • Rule: any white pixel adjacent to a black pixel becomes black as well.
    Chat Brainstorm
    How will the colony in the upper right corner of this slide grow? Is that realistic? Can you think of some way to improve this model?

    Cellular automata

    The problem with our previous rule:

    So how do we fix this?

    Rules do not have to be deterministic

    You might argue that pixels with more infected (black) neighbors are more likely to become infected, so let's change our rule:
    $\rightarrow$ chance of becoming black = # black neighbors x 10%

    Definition
    We call a model deterministic if the same starting point always leads to the same result. Otherwise, we call it stochastic.
    .
    Key Point
    We can make many different cellular automata by inventing new rules.

    Another model: how does infection spread in a population?

    The SIR model: individuals can be

    • Susceptible
      (= healthy, but they can still become infected)
    • Infected
    • Resistant
      (= healthy, and can no longer be infected)
    Chat Brainstorm
    How would you convert this model into a cellular automaton? (What should the grid represent? And the states? What rules can you come up with, and are they deterministic or stochastic?)

    SIR model as cellular automaton

    Grid and states:

    • Each position on the grid is an individual
    • Three states: susceptible, infected, resistant

    Rules:

    • A susceptible individual becomes infected with a probability depending on #infected neighbors (like before)
    • An infected individual can spontaneously be cured and become resistant. The probability that this happens is a fixed chance pcure (also called recovery rate).

    Exercises

    Try it yourself
    Go to computational-immunology.org/sir/, and use the SIR model simulator to answer the questions in the exercise sheet (see Brightspace). Note that you have to click "run" before you'll see anything, and again "run" to reset the simulation (clicking the page will just pause/restart).

    Please skip 3.1.4 and 3.1.5.

    The game of life

    In Conway's "game of life", pixels on a grid follow 4 simple rules:

    1. Black pixels with 0-1 black neighbors: black $\rightarrow$ white
    2. Black pixels with 4-8 black neighbors: black $\rightarrow$ white
    3. White pixels with 3 black neighbors: white $\rightarrow$ black
    4. All other pixels stay the same color

    Example:Neighbors:Result:


    Question
    Is this model deterministic or stochastic?

    The game of life

    Exercise (5 min)
    What will the three grids below look like after one step? Rules:
    1. Black pixels with 0-1 black neighbors: black $\rightarrow$ white
    2. Black pixels with 4-8 black neighbors: black $\rightarrow$ white
    3. White pixels with 3 black neighbors: white $\rightarrow$ black
    4. All other pixels stay the same color
    . . .
    A
    B
    C

    Simple rules, simple behavior?

    The rules are pretty simple, so can we predict what will happen in the long run?

    Chat Brainstorm
    What will be the end result if we play the game of life long enough? Will we have only black, only white, or both black and white pixels? Will there even be an "end result", or will the grid keep changing?

    Simple rules, simple behavior?

    The same rules can yield very different behavior depending on initial setup:

    Static Oscillating Migrating

    Simple rules, simple behavior?

    The end result can be pretty complex...



    Key Point
    Even with simple rules, it can be hard to predict what happens over time!

    Exercises

    Try it yourself
    Go to https://bitstorm.org/gameoflife/, and use the game of life-simulator to answer the questions in the exercise sheet (see Brightspace).

    Please skip exercise 3.2.4.

    .

    Coffee break

    Question
    How do you think a zebra gets its stripes?

    Spatial patterns in biology

    Alan Turing


    • Mathematician, computer scientist
    • Invented some of the fundamental concepts of computer science, including the idea of a "programmable computer"
    • Famous for cracking the enigma code during WWII
    • Also the founding father of theoretical biology!
    Alan Turing
    (1912-1954)
    Movie
    (2014)

    Turing patterns

    Turing wondered how symmetry breaking can occur in an organism (morphogenesis). He predicted that a reaction-diffusion system could do the trick if:

    • Reaction R produces molecules A and I
    • Molecule A activates reaction R
    • Molecule I inhibits reaction R
    • Molecule I diffuses much faster than A

    These reactions exist: Belousov-Zhabotinsky reaction

    Turing patterns

    Turing himself had to do all computations by hand, but computers can now simulate patterns found in nature!

    The Gray-Scott model

    Another diffusion-reaction model that produces patterns: the Gray-Scott model

    • Molecule U reacts into molecule V
    • Reaction is catalyzed by 2 molecules of V
    • V decays into a waste product P at rate $k$
    • New U is supplied through a semi-permeable membrane at rate $F$
    • Both U and V can diffuse

    The Gray-Scott model as a cellular automaton



    The grid:

    • We now need 2 grids instead of 1 (1 for U, 1 for V)
    The states:

    • We have not just a few states, but many (states represent the amount of V and U)

    The Gray-Scott model as a cellular automaton


    So what about the rules? They should represent several processes:

    • New supply of U
    • Diffusion
    • Reaction of U to V
    • Decay of V
    Exercise (5 min)
    For each of the processes above, consider a position (pixel) p on the grid. On which grid(s) should the value G(p) at position p be updated (U, V, or both)? Which information (in the current grid of U, V, or both) should we use to determine what the updated value G*(p) should be?

    Worked example: Supply of U

    Supply of U:

    • New U is supplied by diffusion through the membrane
    • What info do we need? We're talking diffusion of U. V probably doesn't change that. So we don't need V(p).
    • But the diffusion is going to depend on how much Usupply(p) and U(p) there is, so we do need U(p)
    • Do we need other info on U? From other p? Probably not.
    • So for example, we might say: U*(p) $\sim$ average of U(p) and Usupply

    The Gray-Scott model as a cellular automaton


    So what about the rules? They should represent several processes:

    • New supply of U
    • Diffusion
    • Reaction of U to V
    • Decay of V
    Exercise (5 min)
    For each of the processes above, consider a position (pixel) p on the grid. On which grid(s) should the value G(p) at position p be updated (U, V, or both)? Which information (in the current grid of U, V, or both) should we use to determine what the updated value G*(p) should be?

    The Gray-Scott model as a cellular automaton

    Diffusion:

    • Molecules diffuse independently of each other (U $\rightarrow$ U* and V $\rightarrow$ V*)
    • G*(p) depends on G(p), but also on G(neighbors of p)
    • G*(p) $\sim$ average of G(pi), for pi = p and all its neighbors in current grid

    Supply of U:

    • New U is supplied by diffusion through a semi-permeable membrane!
    • U*(p) $\sim$ average of U(p) and Usupply

    The Gray-Scott model as a cellular automaton

    Reaction U $\rightarrow$ V:

    • Depends on amount U(p) and amount V(p) at p
    • A percentage x of U(p) reacts. This percentage depends on V(p).
    • U*(p) = U(p) - x,
      V*(p) = V(p) + x

    Decay of V:

    • Depends only on the current amount of V
    • New value at p = percentage of current value

    The Gray-Scott model: predictions

    Different patterns are possible in this model:

    Exercises

    Try it yourself
    Go to https://mrob.com/pub/comp/xmorphia/ogl/index.html, and use the Gray-Scott simulator to answer the questions in the exercise sheet (see Brightspace).

    Summary

    Cellular automata:

    • We can build a cellular automaton by defining a grid, the possible states, and some rules to determine what the next state will be
    • Rules can be deterministic or stochastic
    • They can depend only on one position p, or also on its neighbors
    • We can have multiple grids that communicate with each other

    This afternoon: discuss even more complex models to simulate migrating cells

    Final discussion: why model complex systems like the TME?

    Given some known "rules", eg:

    • if cells x and y interact, z happens
    • cell x moves towards cell y

    We hope to understand/predict what is going on, eg:

    • tumor killed if we have more cell x
    Discussion
    We have seen that a combination of simple rules can already yield complex behavior, so that it is not always intuitive to predict what will happen over time. What do you think that means for research into the TME?