Difference between revisions of "Team:KU Leuven/Modeling/Hybrid"
Line 298: | Line 298: | ||
However, the physical “chemotactic force” that propel bacteria is not easily | However, the physical “chemotactic force” that propel bacteria is not easily | ||
measured or derived. Therefore, we base the equation of motion in one dimension | measured or derived. Therefore, we base the equation of motion in one dimension | ||
− | on ( | + | on (6), a stochastic differential equation (SDE) that describes the motion |
of a single particle in a N-particle system that is governed by a Keller-Segel | of a single particle in a N-particle system that is governed by a Keller-Segel | ||
− | type PDE in the limit of N | + | type PDE in the limit of $N \rightarrow \infty$, |
+ | more precisely the (7) PDE for chemotaxis | ||
+ | towards some chemoattractant S. | ||
$$ \frac{\partial n(\vec{r},t)}{\partial t}=D_n \cdot \nabla^2 n - \nabla (n \cdot \chi(S(\vec{r},t)) | $$ \frac{\partial n(\vec{r},t)}{\partial t}=D_n \cdot \nabla^2 n - \nabla (n \cdot \chi(S(\vec{r},t)) | ||
\cdot\nabla S(\vec{r},t)) \;\;\; (7) $$ | \cdot\nabla S(\vec{r},t)) \;\;\; (7) $$ | ||
− | + | That means that when infinitely many particles | |
− | + | obey (6), they will exhibit Keller-Segel type spatial dynamics. In a sense, | |
− | obey ( | + | |
we’re using a “reverse-engineered” particle equation that corresponds to the | we’re using a “reverse-engineered” particle equation that corresponds to the | ||
− | Keller-Segel field equation. A detailed theoretical treatment of ( | + | Keller-Segel field equation. A detailed theoretical treatment of (6) is |
outside the scope of this model description because it contains a stochastic | outside the scope of this model description because it contains a stochastic | ||
variable. The traditional rules of calculus do not apply anymore for stochastic | variable. The traditional rules of calculus do not apply anymore for stochastic | ||
Line 314: | Line 315: | ||
for Brownian motion in the form of random noise added to the displacement of the | for Brownian motion in the form of random noise added to the displacement of the | ||
agents, causing them to diffuse, and that it is governed by the diffusion | agents, causing them to diffuse, and that it is governed by the diffusion | ||
− | coefficient $\mu A$. The first term in ( | + | coefficient $\mu A$. The first term in (6) on the other hand is easily understood |
as an advective or drift term (net motion) depending on S, pushing the agents | as an advective or drift term (net motion) depending on S, pushing the agents | ||
along a positive gradient (for negative chemotaxis the sign is reversed). The | along a positive gradient (for negative chemotaxis the sign is reversed). The | ||
Line 320: | Line 321: | ||
chemoattractant. The advective properties are governed by the chemotactic | chemoattractant. The advective properties are governed by the chemotactic | ||
sensitivity function $\chi (S)$. For our model we defined the chemotactic sensitivity | sensitivity function $\chi (S)$. For our model we defined the chemotactic sensitivity | ||
− | function as in ( | + | function as in (8). |
$$ \chi(S(\vec{r},t))=\mu \cdot \frac{\kappa}{S(\vec{r},t)} \;\;\; (8) $$ | $$ \chi(S(\vec{r},t))=\mu \cdot \frac{\kappa}{S(\vec{r},t)} \;\;\; (8) $$ | ||
The first important thing to note is that we assumed | The first important thing to note is that we assumed | ||
Line 349: | Line 350: | ||
interaction of cell A with another cell A. The interaction between two cells is | interaction of cell A with another cell A. The interaction between two cells is | ||
usually expressed by a potential energy curve defined over the distance between | usually expressed by a potential energy curve defined over the distance between | ||
− | the centers of mass of the two cells | + | the centers of mass of the two cells. Note that the potential energy |
remains constant after a certain distance, which means that the cells stop | remains constant after a certain distance, which means that the cells stop | ||
interacting. Also, as two cells move closer together, they hit a wall where the | interacting. Also, as two cells move closer together, they hit a wall where the | ||
Line 357: | Line 358: | ||
not possible because the bacteria are stochastic and could randomly jump beyond | not possible because the bacteria are stochastic and could randomly jump beyond | ||
the potential wall, where the force is ill defined. Practically, we’ve decided | the potential wall, where the force is ill defined. Practically, we’ve decided | ||
− | to define a piecewise quadratic potential ( | + | to define a piecewise quadratic potential (9a), |
$$ E_{p,attraction}(r_{ij})=\left\{\begin{matrix} | $$ E_{p,attraction}(r_{ij})=\left\{\begin{matrix} | ||
0 & 2\cdot r_{cutoff}\leq r_{ij}\\ | 0 & 2\cdot r_{cutoff}\leq r_{ij}\\ | ||
Line 368: | Line 369: | ||
-\frac{1}{2}\cdot k_2 \cdot(r_{ij}-2\cdot r_0)^2 & r_0 \leq r_{ij} < 2\cdot r_0\\ | -\frac{1}{2}\cdot k_2 \cdot(r_{ij}-2\cdot r_0)^2 & r_0 \leq r_{ij} < 2\cdot r_0\\ | ||
-\frac{1}{2}\cdot k_1 \cdot(r_{ij}-\frac{k_1+k_2}{k_1}\cdot r_0)^2 & 0 \leq r_{ij} < r_0 | -\frac{1}{2}\cdot k_1 \cdot(r_{ij}-\frac{k_1+k_2}{k_1}\cdot r_0)^2 & 0 \leq r_{ij} < r_0 | ||
− | \end{matrix}\right. \;\;\; ( | + | \end{matrix}\right. \;\;\; (9a) $$ |
$$ \vec{F}_{ij,attraction}(r_{ij})=\left\{\begin{matrix} | $$ \vec{F}_{ij,attraction}(r_{ij})=\left\{\begin{matrix} | ||
\vec{0} & 2\cdot r_{cutoff}\leq r_{ij}\\ | \vec{0} & 2\cdot r_{cutoff}\leq r_{ij}\\ | ||
Line 380: | Line 381: | ||
k_2 \cdot(r_{ij}-2\cdot r_0) \cdot \vec{e}_{ij}& r_0 \leq r_{ij} < 2\cdot r_0\\ | k_2 \cdot(r_{ij}-2\cdot r_0) \cdot \vec{e}_{ij}& r_0 \leq r_{ij} < 2\cdot r_0\\ | ||
k_1 \cdot(r_{ij}-\frac{k_1+k_2}{k_1}\cdot r_0) \cdot \vec{e}_{ij}& 0 \leq r_{ij} < r_0 | k_1 \cdot(r_{ij}-\frac{k_1+k_2}{k_1}\cdot r_0) \cdot \vec{e}_{ij}& 0 \leq r_{ij} < r_0 | ||
− | \end{matrix}\right. \;\;\; ( | + | \end{matrix}\right. \;\;\; (9b) |
$$ | $$ | ||
which results in a piecewise | which results in a piecewise | ||
linear force that resembles Hooke’s law, but with three different “spring | linear force that resembles Hooke’s law, but with three different “spring | ||
− | constants” acting in different intervals of intercellular distances ( | + | constants” acting in different intervals of intercellular distances (9b). |
Between A type cells, there is a region of attraction (2*r0 < r < 2*rcutoff), | Between A type cells, there is a region of attraction (2*r0 < r < 2*rcutoff), | ||
where the force points towards the other cell, hence moving them closer together. | where the force points towards the other cell, hence moving them closer together. | ||
Line 400: | Line 401: | ||
</b><br/> | </b><br/> | ||
Now we are ready to construct the equation of motion for cell type A and B as a | Now we are ready to construct the equation of motion for cell type A and B as a | ||
− | superposition of the Keller-Segel SDE ( | + | superposition of the Keller-Segel SDE (6) and the cell interaction forces, |
− | yielding ( | + | yielding (10). |
$$ d\vec{r}_{A_i}(t)= \sqrt{2 \cdot \mu_A}\cdot d\vec{W} + \frac{1}{\gamma}\cdot\Bigg( \sum^{A | $$ d\vec{r}_{A_i}(t)= \sqrt{2 \cdot \mu_A}\cdot d\vec{W} + \frac{1}{\gamma}\cdot\Bigg( \sum^{A | ||
\backslash \{ A_i\}}_j \frac{dE_{p,attraction}(r_{ij}(t))}{dr_{ij}}\cdot \vec{e}_{ij}+\sum^{B}_j | \backslash \{ A_i\}}_j \frac{dE_{p,attraction}(r_{ij}(t))}{dr_{ij}}\cdot \vec{e}_{ij}+\sum^{B}_j | ||
− | \frac{dE_{p,repulsion}(r_{ij}(t))}{dr_{ij}}\cdot \vec{e}_{ij} \Bigg)\cdot dt \;\;\; ( | + | \frac{dE_{p,repulsion}(r_{ij}(t))}{dr_{ij}}\cdot \vec{e}_{ij} \Bigg)\cdot dt \;\;\; (10a) |
$$ | $$ | ||
$$ | $$ | ||
Line 425: | Line 426: | ||
\mu_{B,high} & H(\vec{r},t) < H_{B,threshold}\\ | \mu_{B,high} & H(\vec{r},t) < H_{B,threshold}\\ | ||
\mu_{B,low} & H(\vec{r},t) \geq H_{B,threshold} | \mu_{B,low} & H(\vec{r},t) \geq H_{B,threshold} | ||
− | \end{matrix}\right. \;\;\; \text{( | + | \end{matrix}\right. \;\;\; \text{(10b)} |
$$ | $$ | ||
Line 452: | Line 453: | ||
<h2> Heat equation </h2> | <h2> Heat equation </h2> | ||
<p> | <p> | ||
− | The left-hand side of (1) is the rate of accumulation of a chemical and the right-hand side is the second | + | The left-hand side of (1) is the rate of accumulation of a chemical and the right-hand side is the second spatial derivative of its concentration field. The equation can be understood by considering a one-dimensional concentration profile: if the concentration can be approximated as a convex parabolic function, the second derivative is positive and therefore the rate of accumulation is positive (i.e. more accumulation). If on the other hand the concentration resembles a concave parabolic function, the second derivative is negative and the rate of accumulation as well (i.e. depletion). A special case occurs when the concentration profile takes on a linear form. Everything that moves into the point goes out to the other side and a result there is no accumulation over time. |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
</p> | </p> | ||
Line 532: | Line 522: | ||
KDE is used in statistics to estimate the probability density of a set discrete | 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 | data derived from a random process. The basic idea consists of defining a | ||
− | kernel function | + | kernel function that represents the density of a single data point, then |
− | + | centering kernel functions on every data point and summing them all up to | |
achieve a smooth overall density function, as demonstrated in the figure below. </p> | achieve a smooth overall density function, as demonstrated in the figure below. </p> | ||
<div class="center"> | <div class="center"> | ||
Line 550: | Line 540: | ||
Some of the most common kernel functions include gaussian kernels, triangular | Some of the most common kernel functions include gaussian kernels, triangular | ||
kernels and epanechnikov kernels. | kernels and epanechnikov kernels. | ||
− | During our simulations we have found the | + | During our simulations we have found the epanechnikov kernel particularly useful. |
In two dimensions these are defined as: | 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 + | $$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 \\ | (y/h)^2) \leq 1 \\ | ||
− | 0 & \text{else} \end{matrix}\right. \;\;\; ( | + | 0 & \text{else} \end{matrix}\right. \;\;\; (11) $$ |
Importantly, the scaled functions inherit the kernel function | Importantly, the scaled functions inherit the kernel function | ||
properties, but are either broader or narrower. The degree to which the shape of | 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 | a kernel function is stretched or squeezed depends on the scaling factor h | ||
− | + | , 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 | freedom to define how far the influence of an agent reaches and how smooth the | ||
resulting density function looks like. Using a KDE allows us to define the agent density at any | resulting density function looks like. Using a KDE allows us to define the agent density at any | ||
Line 611: | Line 601: | ||
<p> | <p> | ||
− | <b>Nearest- | + | <b>Nearest-Neighbor Algorithm</b><br/> |
− | The cell-cell interactions have already been fully described in the paragraphs above. However, solving the equation of motion of an agent in its current form requires the computation of the force due to every other agent. If we take N to be the number of agents, that means $N*(N-1)$ amount of force computations are needed in total and therefore the computation time grows as $O( | + | The cell-cell interactions have already been fully described in the paragraphs above. However, solving the equation of motion of an agent in its current form requires the computation of the force due to every other agent. If we take N to be the number of agents, that means $N*(N-1)$ amount of force computations are needed in total and therefore the computation time grows as $O(N^2)$. To put this in perspective, if we simulate a thousand agents, the amount of interactions adds up to around one million. This puts a heavy computational load on the model which can be reduced greatly by using a smarter algorithm. The crucial observation here is that the force goes to zero when the distance between two cells is larger than $2\cdot r_{cutoff}$. An agent therefore only interacts with its nearest neighbors, meaning that the naive implementation wastes a lot of time computing interactions which have no effect anyways. Moreover, as the simulation progresses, an agent’s neighbors do not vary greatly from one timestep to another. A more efficient approach then consists of periodically searching for the nearest neighbors within a fixed radius, storing them in a list for every agent and updating their coordinates for all intermediate timesteps. |
Since the agents are programmed to repel each other when they approach each other too closely, they will evolve to a rather uniform distribution. The most appropriate fixed-radius nearest neighbor search algorithm in that case is the cell technique. In this algorithm, the agents are structured by placing a rectangular grid of cells over the domain and assigning every agent to a cell (fig9). Determining which cell an agent belongs to is easily done by rounding down the x and y-coordinates to the nearest multiple of the grid spacing. If the grid spacing is chosen so that interactions do not reach further than adjacent cells, every agent only needs to look for neighbors in 9 cells (its own cells plus 8 adjacent cells) instead of the entire domain. | Since the agents are programmed to repel each other when they approach each other too closely, they will evolve to a rather uniform distribution. The most appropriate fixed-radius nearest neighbor search algorithm in that case is the cell technique. In this algorithm, the agents are structured by placing a rectangular grid of cells over the domain and assigning every agent to a cell (fig9). Determining which cell an agent belongs to is easily done by rounding down the x and y-coordinates to the nearest multiple of the grid spacing. If the grid spacing is chosen so that interactions do not reach further than adjacent cells, every agent only needs to look for neighbors in 9 cells (its own cells plus 8 adjacent cells) instead of the entire domain. | ||
Line 619: | Line 609: | ||
</p> | </p> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</div> | </div> | ||
</div> | </div> |
Revision as of 03:56, 19 September 2015
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.
Model Description
Implementation
1-D Hybrid Model
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 Hybrid Model
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 ] |
Equations
Contact
Address: Celestijnenlaan 200G room 00.08 - 3001 Heverlee
Telephone: +32(0)16 32 73 19
Email: igem@chem.kuleuven.be