This tutorial walks through the Cellular Potts Model (CPM) in its basic form. It requires no upfront knowledge on the CPM and contains interactive components to illustrate how the algorithm works.
This explorable was published in: Wortel & Textor. eLife 2021;10:e61288. doi:10.7554/eLife.61288.
The Cellular Potts Model (CPM) is what we call discrete in space: it essentially describes space like a photograph, zoomed in far enough that you can see the individual pixels. Each pixel $p$ belongs to either the empty "background" or to a "cell" on that surface:
CPM cells move because they continuously try to "conquer" pixels from other cells (or from the background). This is why the grid state $\text{cell} (p,t)$ changes over time. These changes are stochastic but not completely random: in their competition for pixels, cells try to minimize the global energy of the system, defined by the Hamiltonian $H$. (Mostly, this minimization does not actually "work" in the sense that the model never reaches a steady state, but it does guide behaviour in the model).
How these energies are computed depends on the exact model and will be discussed in more detail below; but the idea is that this general mechanism allows us to define a set of "rules" or "physical laws". The CPM cells tend to follow these in their dynamic game of conquering pixels.
The question remains: how does this energy minimization work?
The CPM controls its global energy $H$ through the so-called Metropolis algorithm:
You can walk through these dynamics below; click "step" to perform the next step of the algorithm manually, or click the play symbol to automatically perform the steps at a faster pace. (Don't worry about the value of ΔH for now; that is discussed in the next section.)
We have already talked briefly about the Hamiltonian $H$, the global energy that the system tries to minimize. Typically, this Hamiltonian contains different terms to encourage different processes. For example:
This would give the following Hamiltonian:
In the following, we'll see what these terms look like.
The adhesive energy is a contact energy that ensures that pixels from the same cell stay together. For a CPM with a single cell, where there are only two identities (0 for the background, 1 for the cell), this is defined as:
To get $\Delta H$ for a proposed copy attempt, we then compute:
Below, these contacts are visualized; click "step()" to complete an MCS in the grid and to see the adhesion energy after the changes (note that every pair is counted twice).
Note that the simulation start with random assignment of pixels to the "cell" or "background". Over time, pixels with the same identity tend to cluster together in space. This happens because the system tries to minimize its energy, and therefore its number of interfaces: the number of different cell contacts (and thus the energetic penalty) decreases when pixels of the same cell cluster together. Finally, as time progresses, the grid has only one identity left (it is then either empty, or completely filled with one cell)—after all, the best way to minimize contact energy is to have no interfaces at all!
The same principle applies when there is more than one cell, except now we have to define multiple contact energies $J$: the interface between two different cells gets a different energy $(J_\text{cell,cell})$ than the interface between one of the cells and the background $(J_\text{cell,bg})$:
Again, after enough time passes, the grid ends up homogeneous because it is energetically beneficial to remove all the interfaces. With the tendency of the CPM to minimize the global energy, we eventually end up in this minimum energy, steady state scenario. If we wish to have real cells that don't just disappear, we need to expand our Hamiltonian.
To describe units that look more like cells, the Hamiltonian of a Cellular Potts Model (CPM) typically contains a volume term that ensures that cells roughly maintain their size (measured in number of pixels):
Once again, what we actually use is the energy difference:
This result in an elastic-like behavior. There is no complete conservation of mass because cells can deviate from their target volume by stretching or compressing a little, but these deviations remain small due to the quadratic penalty they carry with them. If a cell is already too large, it won't easily gain more pixels. And vice versa, if it is too small, it won't easily lose them.
The following example illustrates this for a simple cell with a target volume of 9 pixels and λvolume = 20:
(Note here that the grid has a periodic boundary, such that a cell leaving on the right enters the grid on the left.)
To control the cell shape, we can add another term to the Hamiltonian that constrains the cells "perimeter" or circumference in a similar way as we did with the volume constraint:
We then use the energy difference to bias copy attempts:
This result in an elastic-like behavior of the cell's perimeter or "membrane". Cells with a small perimeter (compared to their volume) tend to stay round, while cells with a large perimeter have more flexible borders and a more dynamic cell shape.
The following example illustrates this for a simple cell with a target volume of 4 pixels, a target perimeter of 15 and λperimeter = 1:
(Note here that the grid has a periodic boundary, such that the left-right and top-bottom of the grid are linked; thus, a pixel at the border of the cell on the far right of the grid can have pixels on the far left contributing to its perimeter.)
Combining the different constraints in one Hamiltonian, we get:
Below, you can explore the basic CPM rules by toggling the different rules (adhesion, maintaining volume, and maintaining perimeter). You can also set the size of the volume or perimeter the cell tries to maintain.
Suggestions to try:
All in all, we have seen here how the CPM consists of a discrete grid combined with energy-based kinetics. The energy "rules" like adhesion, volume and perimeter interact to yield cell behaviour. Even the three basic terms discussed here already allow us to model interesting behaviours such as cell sorting, and we can make even more complex models by inventing new kinds of energy terms. For example, the cell we have simulated here has dynamic borders and can kind of float around (especially if you give it a large perimeter), but there is no real "active" motion; that is the topic of a later tutorial.