Team:KU Leuven/Modeling/Hybrid
The hybrid model
The hybrid model represents an intermediate level of detail in between the colony level model and the internal model. Bacteria are treated as individual agents that behave according to the Keller-Segel type discretized stochastic differential equations, while chemical species are modeled using partial differential equations.
Introduction
Spatial reaction-diffusion models that rely on Partial Differential Equations (PDEs) are based on the assumption that the collective behavior of individual entities, such as molecules or bacteria, can be abstracted to the behavior of a continuous field that represents the density of those entities. The brownian motion of molecules, for instance, is the result of inherently stochastic processes that take place at the individual molecule level, but is modeled at the density level by Fick’s laws of diffusion. These PDE-based models provide a robust method to predict the evolution of large-scale systems, but are only valid when the spatiotemporal scale is sufficiently large to neglect small-scale stochastic fluctuations and physical granularity. Moreover, such a continuous field approximation can only be made if the behavior of the individual entities is well described.
Agent-based models
Agent-based models on the other hand explicitly treat the entities as individual “agents” that behave according to a set of “agent rules”. An agent is an object that acts independently from other agents and is influenced only by its local environment. The goal in agent-based models is to study the emergent systems-level properties of a collection of individual agents that follow relatively simple rules. In smoothed particle hydrodynamics for example, fluids are simulated by calculating the trajectory of each individual fluid particle at every timestep. Fluid properties such as the momentum at a certain point can then be sampled by taking a weighted sum of the momenta of the surrounding fluid particles. A large advantage of agent-based models is that the agent rules are arbitrarily complex and thus they allow us to model systems that do not correspond to any existing or easily derivable PDE model. However, because every agent is stored in memory and needs to be processed individually, simulating agent-based models can be computationally intensive.
Hybrid modelling framework
In our system, there are both bacteria and chemical species that spread out
and interact on a petri dish to form patterns. On the one hand, the bacteria are
rather complex entities that move along chemical gradients and interact with one
another. Therefore they are ideally modeled using an agent-based model. On the
other hand, the diffusion and dynamics of the chemicals leucine and AHL are
easily described by well-established PDEs. To make use of the advantages of each
modelling approach, we decided to combine these two different types of modeling
in a hybrid modelling framework. In this framework we modeled the bacteria as
agents, while the chemical species were modeled using PDEs. There were two
challenges to our hybrid approach, namely coupling the models and matching them.
Coupling refers to the transfer of information between the models and matching
refers to dealing with different spatial and temporal scales to achieve
accurate, yet computationally tractable simulations.
In the following paragraphs we first introduce our hybrid model and its
coupling. Once the basic framework is established, the agent-based module and
PDE module are discussed in more depth and the issue of matching is highlighted.
We also expand on important aspects of the model and its implementation such as
boundary conditions and choice of timesteps. Then the results for the 1-D model
and 2-D model simulations are shown and summarized. Finally, the incorporation
of the internal model into the hybrid model is discussed and a proof of concept
is demonstrated.
Model description
Hybrid model
The main protagonists in our pattern-forming system are cell types A and B, AHL and leucine. Cells A produce AHL as well as leucine. They are unaffected by leucine, while cells B are repelled by leucine. AHL modulates the motility of both cell types A and B, but in opposite ways. High concentrations of AHL will render cell type A unable to swim but will activate cell type B’s motility. Conversely, low concentrations of AHL causes swimming of cell type A and incessant tumbling (thus immobility) of cell type B. Lastly, cells A express the adhesin membrane protein, which causes them to stick to each other. Simply said, our system should produce spots of immobile, sticky groups of A type cells, surrounded by rings of B type cells. Any cell that finds itself outside of the region that it should be in, is able to swim to their correct place and becomes immobile there. More details can be found in the research section.
Coupling
Agent-based to PDE
As described above, the agents’ effect in the PDE is modeled as a source term
that is proportional to the agent density. This approach is essentially the same
approach taken in the colony level model for the bacterial production of AHL and
leucine. However, in the colony level model the bacteria density is explicitly
calculated at the grid points, while the agent-based model essentially considers
a set of points in space. A simple first-order approach would be to determine
the closest grid point to any agent and simply increment a counter belonging to
that grid point. This results in a histogram, which can be used directly to
represent the agent density. However, the resulting density is a blocky,
nonsmooth function which poorly represents the underlying agent distribution.
The effect of a single agent is artificially confined to a single grid point,
while in reality an agent’s influence could reach much further than a single
grid point. The shape of a histogram is also very dependent on the bin size,
which in this case corresponds to the grid spacing so it cannot be independently
tuned. To decouple grid spacing and agent density and achieve a smoother density
function, we made use of a more sophisticated technique called kernel density
estimation (KDE).
KDE is used in statistics to estimate the probability density of a set discrete data derived from a random process. The basic idea consists of defining a kernel function $k(\vec(r))$ that represents the density of a single data point. Centering kernel functions on every data point and summing them all up to achieve a smooth overall density function, as demonstrated in (fig4).
This kernel function can be anything as long is it continuous, symmetric and integrates to 1, since it represents one data point or an agent in our case. Some of the most common kernel functions include gaussian kernels, triangular kernels and epanechnikov kernels. During our simulations we have found the Epanechnikov-Kernel particularly useful. In two dimensions these are defined as: $$k(x,y) = \left\{\begin{matrix} \frac{3}{4h} * (1 - ((x/h)^2 + (y/h)^2)) & \text{if } ((x/h)^2 + (y/h)^2) \leq 1 \\ 0 & \text{else} \end{matrix}\right. $$ Importantly, the scaled functions inherit the kernel function properties, but are either broader or narrower. The degree to which the shape of a kernel function is stretched or squeezed depends on the scaling factor h (fig6), which is why it is called the bandwidth. This parameter gives us the freedom to define how far the influence of an agent reaches and how smooth the resulting density function looks like (fig7 undersmoothed, oversmoothed, ideal). Using a KDE allows us to define the agent density at any point using (Eq. 13).
PDE to agent-based
The final component of our hybrid model is the mapping of the PDE model to the agent-based model. The latter model works with discrete objects that have continuous coordinates, which means that they can be located at any point of the domain. As we have seen, the agents need the local concentration of AHL and leucine, as well as the gradient of leucine in order to update their positions. In the PDE model however, the domain is discretized into a grid and concentrations are only defined at grid points. Therefore, in order to transfer information from the PDE model to the agent-based model we need to translate these grid values into values for any given position within the domain. We achieved this for the 1-D hybrid model by taking the two nearest grid points to any agent and employing linear interpolation to derive an approximate local field value. Similarly, for the 2-D hybrid model we took the four nearest grid points and employed bilinear interpolation, which is explained in box 4. The result is (Eq. 14) to derive the concentration or gradient of AHL or leucine at any point in the domain. Taken together, (Eq. 4), (Eq. 11), (Eq. 13) and (Eq. 14) collectively contain all the PDEs, agent-based SDEs and two-way information transfer functions to fully describe our hybrid model. All the equations are summarized schematically in (fig8).
Cell-Cell interactions
In order to solve the equations related to cell cell interaction we wrote nearest neighbour algorithm that finds all bacteria within a certain distance. And computes equation 10a and b.
Partial differential equations
As mentioned earlier the concentrations of AHL and Leucine are modeled using partial differential equations.
In the colony level model these equations are solved explicitly. Explicit schemes do not require a lot of
work per time step, but unfortunately are not unconditionally stable. In two dimensions the grid ratios
$dt/dx^2$ and $dt/dy^2$ can not exceed $dt/dx^2 + dt/dy^2 \leq \frac{1}{2}$ for the solver to be stable.
When computing the solution of the hybrid model this requrement forces us to spend a lot of CPU time solving
partial differential equations that could be better spent simulation the agents. Therefore an implicit ADI
Alternating direction implicit scheme has been implemented. ADI-schemes are unconditionally stable, which
allows it to take large time steps with the PDE solver. ADE-schemes are given by the formula:
$$ (1 - \frac{1}{2} \mu_x \delta_x^2) U^{n+\frac{1}{2}} = (1 + \frac{1}{2} \mu_y \delta_y^2) U^n $$
$$ (1 - \frac{1}{2} \mu_y \delta_y^2) U^{n+1} = (1 + \frac{1}{2} \mu_x \delta_x^2)U^{n+\frac{1}{2}} $$
In the equations above $\mu$ denotes grid ratios and $\delta^2$ central differences. The production and
degradation terms have been incorporated at every time level with a factor of $\frac{1}{4}$.
The image below shows the computational molecule of the ADI scheme we chose to implement:
Matching
In order to benefit from the implicit PDE-solver described above the agent's time steps are chosen smaller then the time steps of the PDE solver. However type A cells produce molecules continuously as they move trough space. Therefore we record their positions and average over the kernel functions centered at past positions since the last PDE evaluation. That way we avoid blurring the results of the PDE solver too much, when the time step of the agents is reduced. Last but not least we want to point out the relationship between kernel bandwidth and the grid on which the PDE is solved. The larger the kernel bandwidth $h$ is chosen the coarser the PDE grid can be without loosing cells between grid points. If the the diameter of the kernel functions is smaller then the distance between PDE grid points it can happen, that the kernel does not overlap with any PDE grid points. In this case a cells contribution to the molecule concentrations at the next time step could be lost. When the PDE grid is widened to save computing time it is thus necessary to increase the Kernel bandwidth as well. However this increase can lead to a situation where the Kernel function covers significantly more space then the actual diameter of a bacterium. In these cases the Kernel function can be interpreted as a probability function for a cells position. However we avoided too large bandwiths and PDE grids by running our 2-D simulations at the Flemish Supercomputer Center (VSC).
Results
1-D results
The video box above shows one dimensional simulation results for the hybrid model. A constant speed and random step simulation has been computed. We observe that the bacteria form a traveling wave in both cases, which is essential for pattern formation. These results are also similar to what we get from the continuous model, which confirms our results.
2-D Results
The videos above show simulation videos computed at the Flemish supercomputing center, for three different initial conditions similar to the ones we used for the colony level model. The first and second condition start from 9 mixed or 5 colonies of both cell types, arranged in a block or star shape. These first two gradually separate in a manner similar to what we would we also saw in the colony level model. The result for random initial data is fundamentally different. As the agent based approach allows for better implementation of adhesion large cell type A bands form. The AHL and Leucine produced by the type A bacteria causes the B type cells to move away leading to a pattern which we could not produce using PDEs alone, this beautifully illustrates the added value of hybrid modeling.
Incorporation of internal model
Up until now, we have largely ignored the inner life of the bacteria. This inner life consists of transcriptional networks and protein kinetics. Instead we assumed that AHL and leucine production is directly proportional to the density of type A cells. This only works in theory, since bacteria will be affected by their surroundings and the way their dynamics react to it. For example bacteria surrounded by a large concentration of AHL, will have more CheZ and will react more on the presence of Leucine. Also bacteria have different histories and will have different levels of transcription factors and different levels of proteins in their plasma. The proteins are not directly degraded and will still be present in the cytoplasm of the bacteria long after the network has been deactivated. From this, it is clear that 2 bacteria, although surrounded by the same AHL and leucine concentrations, can show different behavior and reaction kinetics.
This results in a heterogeneity of the bacterial population that has not yet been accounted for. To make up for this anomaly, we decided to add an internal model to every agent. This way we will get more realistic simulations. Every agent will get their own levels of CheZ, LuxR, LuxI and so on and will have individual reactions on their surroundings. We hope that this way we can get closer to the behavior of real bacteria.
References
[1] | Benjamin Franz and Radek Erban. Hybrid modelling of individual movement and collective behaviour. Lecture Notes in Mathematics, 2071:129-157, 2013. [ .pdf ] |
[2] | Zaiyi Guo, Peter M A Sloot, and Joc Cing Tay. A hybrid agent-based approach for modeling microbiological systems. Journal of Theoretical Biology, 255(2):163-175, 2008. [ DOI ] |
[3] | E F Keller and L A Segel. Traveling bands of chemotactic bacteria: a theoretical analysis. Journal of theoretical biology, 30(2):235-248, 1971. [ DOI ] |
[4] | E. M. Purcell. Life at low Reynolds number, 1977. [ DOI ] |
[5] | Angela Stevens. The Derivation of Chemotaxis Equations as Limit Dynamics of Moderately Interacting Stochastic Many-Particle Systems, 2000. [ DOI ] |
Contact
Address: Celestijnenlaan 200G room 00.08 - 3001 Heverlee
Telephone: +32(0)16 32 73 19
Email: igem@chem.kuleuven.be