The authors have declared that no competing interests exist.

Hybrid deterministic-stochastic methods provide an efficient alternative to a fully stochastic treatment of models which include components with disparate levels of stochasticity. However, general-purpose hybrid solvers for spatially resolved simulations of reaction-diffusion systems are not widely available. Here we describe fundamentals of a general-purpose spatial hybrid method. The method generates realizations of a spatially inhomogeneous hybrid system by appropriately integrating capabilities of a deterministic partial differential equation solver with a popular particle-based stochastic simulator, Smoldyn. Rigorous validation of the algorithm is detailed, using a simple model of calcium ‘sparks’ as a testbed. The solver is then applied to a deterministic-stochastic model of spontaneous emergence of cell polarity. The approach is general enough to be implemented within biologist-friendly software frameworks such as Virtual Cell.

Mechanisms of some cellular phenomena involve interactions of molecular systems of which one can be described deterministically, while the other is inherently stochastic. Calcium ‘sparks’ in cardiomyocytes is one such example, in which dynamics of calcium ions, which are usually present in large numbers, can be described deterministically, whereas the channels open and close stochastically. The calcium influx through the channels renders the entire system stochastic, but a fully stochastic treatment accounting for each calcium ion is computationally expensive. Fortunately, such systems can be efficiently solved by hybrid methods in which deterministic and stochastic algorithms are appropriately integrated. Here we describe fundamentals of a general-purpose deterministic-stochastic method for simulating spatially resolved systems. The internal workings of the method are explained and illustrated by applications to very different phenomena such as calcium ‘sparks’, stochastically gated reactions, and spontaneous cell polarization.

It is not uncommon for a cell-biological model to include some components that might be stochastic in nature (small copy numbers, rare events), whereas others, if uncoupled, would behave deterministically (large copy numbers, fast reactions). Through their interaction, fluctuations in a stochastic subsystem may induce significant random perturbations in the ‘deterministic’ one, thus rendering the entire system stochastic. Calcium sparks in cardiomyocytes and other cells [

Simulating such systems as fully stochastic can be prohibitively slow. Indeed, simulating calcium sparks stochastically with an account of every single calcium ion would be computationally expensive because their number is typically large. But in the limit of large copy numbers, the intrinsic fluctuations due to discreteness of molecules are insignificant, and one can design faster hybrid algorithms, in which deterministic and stochastic approaches are appropriately combined. While these efficient methods are approximate, the larger the copy numbers in the ‘deterministic’ subsystem, the more accurate their outcome.

Numerical approaches to interacting systems with disparate levels of stochasticity are an area of active interdisciplinary research. In the context of cell-biological applications, various hybrid approaches were proposed for ‘well-mixed’ models of biochemical networks with fast and slow components [

A variety of algorithms were proposed for spatially uniform, or well-mixed, deterministic-stochastic models. Fixed time step methods, applied to hybrid models of membrane potential [

Numerical methods for spatially resolved deterministic-stochastic models are less common. A method described in [

Stochastic subsystems with relatively low copy numbers can be described in terms of states and spatial locations of individual molecules. The particle-based approach was used to simulate a simple model of assembly of RNA granules in which RNA molecules bind to core complexes [

States and positions of individual channels were also used to define stochastic subsystems in spatial versions of the deterministic-stochastic models of membrane potential [_{3})-receptor channels [_{3})-receptor channels, the problem entails coupling of a spatial deterministic description of calcium and stochastic kinetics of RyR channels and can be solved efficiently by a hybrid numerical method.

All of the above approaches were largely specific solutions to a specific modeling problem or a restricted domain of problems. In this article, we describe a general-purpose spatial deterministic-stochastic algorithm and discuss techniques used for its validation. The work was motivated by the need of providing tools for simulating spatial hybrid models to a wide range of cell scientists. The method is designed to be applicable to a broad spectrum of models, including those where continuous and discrete variables are defined both in volume and in the encompassing membranes. The current implementation of the method appropriately combines capabilities of one of the Virtual Cell (VCell) [

This article is focused on physical underpinnings of the method and its algorithmic details, with special emphasis on rigorous validation of its key elements. Hybrid algorithms, often proposed heuristically, may appear intuitive, but their rigorous analysis and validation constitute a challenging task [

The paper is organized as follows. The algorithm, along with its mathematical fundamentals, is described in Section

Mathematically, the algorithm is based on a formulation of a deterministic-stochastic system, which is somewhat similar to how Wiener processes are described in terms of Langevin equations. To illustrate the approach and explain the workings of the algorithm, we employ a simple model of calcium sparks, whose ‘deterministic’ subsystem consists of a single variable, the calcium concentration _{i}(_{i})_{i}(_{i}) define channel locations and the stochastic variables _{i}(_{i} ∈ _{cell}, where _{cell} denotes the space of a cell.

Dynamics of the continuous variable _{ch} is the total number of channels in the cell, _{p} is the calcium pump rate constant, and _{0} is the steady-state calcium concentration in the absence of open channels. Eq (_{cell}.

Dynamics of the stochastic subsystem are described by a two-component probability distribution function, _{i}(

Eqs (

Our spatial hybrid algorithm employs fixed time step integration due to its conceptual and logistical simplicity. The downside is that the stability constraints imposed on the time step, which should be sufficiently small to resolve fast ‘deterministic’ reactions, may result in slow performance. The inefficiency can be partially alleviated by applying an automatic pseudo-steady-state treatment [

A key element of a hybrid method is how the numerical treatments of the ‘deterministic’ and stochastic subsystems are merged. In our algorithm, the PDEs are discretized in space using a finite-volume scheme [_{ω} subvolumes: _{j}}, _{ω}. The _{j} ≡ _{j})}, where _{j} is the center of _{j} and _{j} has a meaning of a subvolume average: _{j}| stands for the volume of _{j}. Spatial histograms of stochastic variables that use the same subvolumes {_{j}} as bins would have the similar meaning. Indeed, let _{Ξ} be the number of particles of a given type _{j} or, more precisely, the number of particles _{i}|_{ξ = s} in _{j} divided by the volume of _{j} (_{st}(_{st}(_{j} is the number of open calcium channels inside _{j}. Then, as expected, _{j}/|_{j}| is the rate of change of calcium concentration due to the influx through open channels located in the vicinity of _{j}. As a result, both the deterministic and stochastic rates can now be expressed in terms of sets

A realization of a piecewise deterministic Markov process at time

The update of variables _{i}(_{i}(_{i}(

Note that bimolecular reactions, in which one of the participants is described by a _{j}, so the changes due to binding to, or unbinding from, discrete particles can be ignored. In other words, the molecules described in terms of concentrations could be treated as ‘catalysts’ in this type of interactions.

In summary, the algorithm includes the following steps:

Use initial conditions of the problem to initialize variables

Use

Compute initial binned densities for

Determine

Find

Use

Use

Accuracy of our spatial deterministic-stochastic solver is affected by truncation errors, arising from discretization of space and time, and statistical errors due to finite numbers of Monte Carlo realizations. The algorithm was validated against analytical results and through comparison with alternative methods. The calcium spark model introduced in the previous section was used as a testbed for the tests described below.

If transition parameters for

In this test, we used the hybrid method to solve Eqs (_{cell} = [0,10.1]×[0,2.1]×[0,0.5] μm^{3} with the arrangement of channels shown in ^{3}/s, _{0} = 0.1 μM, _{on} = 1 s^{-1}, _{off} = 5 s^{-1}, _{p} = 1 s^{-1}, ^{2}/s, and _{ch} = 24. Simulations, initialized at _{i}(0) = 0 (for all _{ch}) and _{0}, were run to

(A) Channel arrangement (upper panel) and a snapshot of simulation results for ^{4}).

The solution errors defined as _{N} denote averaging over

One way to validate a hybrid solver for conditions in which the variables are inseparable is to use a fully coupled calcium spark model in the limit of large

In the tests, the full coupling was achieved by replacing _{on} with _{on}_{0}, and the VCell hybrid solver was run with _{on} = 0.1 s^{-1}, ^{2}/s and

Time-dependent solutions obtained by the two solvers are illustrated in _{cell}, and the symbol _{i}},^{2}-norm for

Results from VCell hybrid (dots) are validated against a reference solution of the corresponding well-mixed system obtained by Gibson-Bruck nonspatial solver (solid line). Probability density functions of

As in

Similarly, ^{2}-norm are 0.0127 and 0.0017 for

Alternatively, reference solutions of coupled hybrid models in the limit _{cell} with the account of Eq (_{t}_{cell}| − _{p}(_{0}) with _{on} with _{on}_{0}. Upon nondimensionalization: _{p},

A corresponding joint probability density function _{0}(_{1}(_{1}(_{0}(_{0}(_{1}(_{ρ}_{0}|_{ρ = 0} = ∂_{ρ}_{1}|_{ρ = 0} = 0. Thus, in the limit of fast diffusion, the Fokker-Planck formulation is equivalent to a set of hyperbolic equations (Eq (

In the test, the single-channel hybrid system was solved by the VCell hybrid solver in 3D geometry, _{cell} = [−0.5,0.5]×[−0.5,0.5]×[−0.5,0.5], for _{p}^{2}) with ^{4}, and the simulations were run with the time step _{0}(_{1}(

Probability density function of dimensionless continuous variable _{max} = 0.004 (solid curve). The L^{2}-norm of the difference between the two solutions is 0.0137.

The idea of testing the hybrid solver against a fully stochastic simulator, which worked in the limit of fast diffusion (see previous subsection), turned out to be not particularly practical for testing spatially heterogeneous solutions of hybrid models. As discussed in

It is still possible to achieve fairly large local copy numbers for single-channel calcium spark models with low-dimensional geometries. We used Smoldyn to obtain fully stochastic solutions of a quasi-1D coupled model for different total copy numbers of calcium ions and compared them to the corresponding solution obtained by the hybrid solver. As expected, the probability distributions obtained with larger total numbers of particles were closer to the hybrid solution, but suppressing the errors due to the finiteness of the copy numbers describing the ‘deterministic’ variable and due to the finiteness of the number of Monte Carlo trials proved to be challenging because of the constraints described above.

For more accurate comparison, we used direct numerical solution of the Fokker-Planck equation, which, as mentioned earlier, is free of statistical error. In the case of finite _{0}(_{1}(

In Eq (_{max}] and for every _{max}(_{max}(_{1} − _{0}). Note that because the spatial coordinate _{0}(_{1}(

The direct numerical solutions of Eq (_{max} = 2 (_{max} = 4, _{i}),_{0}(_{i}),_{1}(_{i}),_{i}),_{max}(_{1}),_{max}(1)] is under-resolved, but

Solutions for probability density function ^{2}-norms of the differences of the two solutions are ≈ 1.9% (

These limitations are more restrictive for three-dimensional grids, so the reference data for _{max} = 3 were obtained by extrapolating to _{max} = 3 (_{max} = 6, _{i}),_{max}(

Solutions for probability density function _{s}^{-s}^{2}-norms of the differences of the two solutions are ≈ 1.3% (

The good agreement of the solutions obtained for the same spatial grids by the entirely different methods validates the hybrid solver for conditions of slow diffusion and full coupling of the stochastic and ‘deterministic’ components.

The tests described in the previous subsections verify key elements of the spatial hybrid method exemplified by a simple model of calcium sparks of Section

In the test examples, positions of the channels were fixed but in general, particles constituting a stochastic subsystem can diffuse and/or drift (see Section _{i} describing their positions could be continuous functions of time governed by a stochastic process. Also not included in the tests is the binding of discrete particles to one another (the channels in the test problems undergo first-order (unimolecular) reactions). The hybrid solver supports these additional capabilities via Smoldyn [

The bimolecular reactions are simulated by Smoldyn as diffusion-limited, i.e. two particles positioned within a binding distance connect instantaneously. By default, the binding distance is set automatically on the basis of a given

We now consider limitations in treating bimolecular reactions where a continuously described molecule binds to a discrete particle. Because the hybrid approach assumes that the molecules of the ‘deterministic’ subsystem are expressed in large copy numbers, one can ignore sequestration of a continuous variable in such reactions, i.e. approximate a continuously described species as a catalyst (see discussion in section

To test our method in the opposite limit of diffusion-influenced reactions that may result in significant depletion of the continuous component in the immediate vicinity of a particle, we applied it to a model of stochastically gated reactions, for which accurate numerical results and analytical asymptotics have been obtained in [_{c}; _{f}, _{r} are the forward (binding) and reverse (unbinding) rate constants, respectively. Of interest is the effect of slow diffusion on the relaxation function of reversible binding of the gated receptor, _{eq} = ^{−3/2} at _{D}, where

In a hybrid version of the model, the ligands are assumed to be expressed in large copy numbers and are described deterministically by their concentration _{i} ∈

In the corresponding ‘Langevin-like’ formulation, _{∂Ω} = _{0} = 1 μM ≈ 602 μm^{-3}, and realizations of ^{3} μm^{3}, with the diffusion coefficient ^{2}/s. Values of other parameters were correspond to Fig 2A in [_{c} = (0.3/(4π_{0}))^{1/3} ≈ 0.0341 μm; ^{−3} s; _{f} = 4_{c} ≈ 0.429 μm^{3} /s and ^{-1}. As in [_{eq}. The total number of macromolecules was ^{−2} μM, and the initial ligand concentration was _{0} = 1 μM.

The relaxation function, shown in ^{−5} s and mesh size _{eq} which was approximated as ^{3} μm^{3} with the same particle density, initial ligand concentration, and kinetic constants, and observed the maximal local depletion of ligands of about 75%. Still, the new solution differs noticeably from the result of [_{c}. We therefore conclude that in this application, the accuracy of our hybrid method is largely limited by the fact that particles are approximated as points. Note also that the handling of strong depletion of continuous variables in the vicinity of discrete particles might be improved by employing multiscale approaches proposed for cases with spatial separation of subsystems with disparate levels of stochasticity [

For _{D,} the probability that a macro-molecule remains unbound (dots with error bars) deviates from an exponential and approaches the power-law predicted in [

The VCell spatial hybrid solver also applies to models where continuous and discrete variables are defined both in the volume and in surrounding membranes. Subroutines supporting surface-bound stochastic sources were validated using a version of the model of calcium sparks, in which channels were placed on the cell membrane. For this case, the terms with stochastic variables move from the PDE to its boundary conditions. Diffusion on surfaces was rigorously validated separately in VCell [

In this section, we formulate a deterministic-stochastic model of spontaneous emergence of cell polarity and simulate it with our method. The model is a hybrid version of a fully stochastic mechanism originally proposed by Altschuler et al. [

Division, differentiation, and proliferation of living cells rely on mechanisms of symmetry breaking. A key element of these mechanisms is emergence of asymmetric (polar) distributions of signaling molecules, often in form of molecular clusters. While clustering may be spurred by external cues, many cell types can polarize spontaneously (see [

However, it is not uncommon for the membrane molecular clusters to involve large numbers of molecules. One such example is focal adhesions whose formation is initiated by membrane proteins called integrins. Activated by their binding to extracellular matrix, the integrins recruit many other molecules from the cytosol, which together form a focal adhesion. In our deterministic-stochastic model, the membrane receptor proteins that initiate clustering are distinguished from the cytosolic proteins recruited to the membrane. We assume that numbers of receptor proteins are sufficiently small to be represented by discrete variables, whereas copy numbers of cytosolic proteins, both recruited to the membrane and remaining in the cytoplasm, can be modeled continuously in terms of surface densities and volumetric concentrations. We then solve this hybrid model numerically using our method to determine if it retains the property of spontaneous polarization.

The corresponding ‘Langevin-like’ formulation of the problem is as follows. Consider a cell _{i}(_{i}(_{i}(_{r}, where _{r} is the total number of receptors in the membrane. The discrete random variables _{i}(_{i}(

Variables _{s} is the Laplace-Beltrami operator describing diffusion in ∂_{U} and _{S} are the corresponding diffusion constants. The two other terms in the equation for _{1}, _{2} are the corresponding on- and off- rate constants. The boundary condition for the equation describing

Realizations of _{i}(_{3}, _{4} are the on- and off- rate constants for receptor activation. Stochastic variables _{i}(_{i}(_{t} − _{Γ}_{s} on ∂_{i}(_{i}(0) are uniformly distributed in ∂

The model includes a positive feedback between _{i}(_{i}(_{i}(_{0} (_{0} is the initial uniform concentration of the cytosolic protein). For some parameter sets, however, the inactive steady state can become unstable or the model may exhibit multi-stability. These possibilities can be explored by solving the model with varying initial conditions. Alternatively, one can transiently perturb the inactive steady state used as an initial condition. The latter approach was implemented in the example below by adding a pre-activation pulse to the intrinsic activation rate _{0} and

The model has been solved by the spatial hybrid method in a spherical cell with radius _{0} = 1 μM, _{r} = 1000, _{U} = 10 μm^{2}/s, _{S} = _{Γ} = 0.1 μm^{2}/s, _{1} = 0.01 μM^{-1}s^{-1}, _{2} = 0.01 s^{-1}, _{3} = 0.01 μm^{-2}s^{-1}, _{4} = 0.1 s^{-1}. For this parameter set, the inactive state is unstable: activation of a single receptor drives the system to its active state with an average of about 800 active receptors. Interestingly, spatial averages of all variables have reached their active steady-state regimes relatively quickly (by _{0} = 10 s^{-1} and _{0} = 10 s^{-1} and

Distributions of proteins recruited to the membrane from the interior (top) and active receptors (bottom), obtained by solving the model of Eqs (

As in the original stochastic model [

The deterministic-stochastic algorithm described in this article integrates a spatial particle-based fixed time step Monte Carlo method (Smoldyn) and a conventional PDE solver with compatible time-stepping (one of the VCell solvers). The PDE solver utilizes finite-volume spatial discretization of PDEs [

Implementation in VCell Math workspace of the hybrid model of spontaneous cell polarization described in Section

Stochastic processes are ubiquitous in cellular systems. A deterministic-stochastic description of interacting components with disparate degrees of stochasticity provides an efficient alternative to a full stochastic treatment of the problem. In a hybrid numerical approach, an appropriate integration of deterministic and stochastic methods yields significant computational savings.

In this paper, we describe a general-purpose hybrid method for solving spatial deterministic-stochastic models in realistic cell geometries. The emphasis is placed on the physical fundamentals of the method and its testing. The method is based on a formulation in terms of stochastic variables of two types: continuous variables, described by partial differential equations with stochastic source terms, and discrete variables governed by stochastic jump processes. Numerically, the algorithm is a Monte Carlo fixed time step integrator generating realizations of the hybrid system. The current implementation utilizes a VCell fixed time step PDE solver coupled with a particle-based stochastic simulator Smoldyn.

Validating a hybrid deterministic-stochastic numerical scheme is conceptually nontrivial and logistically challenging. We tested our method against analytical results and numerical solutions obtained by alternative methods. The expected convergence of solution error was observed in tests with a separable stochastic subsystem. Testing of the method in conditions of full coupling was performed in the limit of fast diffusion against well-mixed solutions obtained with nonspatial Gibson-Bruck method and against a direct solution of a corresponding Fokker-Planck equation. The latter approach was also used for testing spatially heterogeneous solutions of fully coupled hybrid systems.

The method has been applied to a hybrid model of spontaneous cell polarization based on the original idea of Altschuler et al. [

While the VCell spatial hybrid solver is practical for many typical applications, its performance may become suboptimal for cases with disparate time scales (‘stiff’ problems), as the integration is done with a fixed time step. The handling of the discrete variables can be optimized by incorporating adaptive approaches, although potential savings should be weighed against costs associated with additional logistical complexity, particularly since the inefficiencies are often caused by stiffness of the deterministic subsystem. While the stiffness caused by fast reactions that persist throughout the time of interest can be addressed by applying the VCell automatic quasi-steady-state approximation (see discussion in Section

(DOCX)

(DOCX)

(DOCX)

We thank Leslie Loew for continuing support and stimulating discussions and gratefully acknowledge helpful discussions with Yung-Sze Choi, Diana Resasco, Steven Andrews, and Steven Altschuler. Frank Morgan, Gerard Weatherby, and Masoud Nickaeen kindly provided technical assistance at various stages of the project.