Full text
Júlvez BMC Bioinformatics (2015) 16:333 DOI 10.1186/s12859-015-0765-z METHODOLOGY ARTICLE Open Access A straightforward method to compute average stochastic oscillations from data samples Jorge Júlvez1,2 Abstract Background: Many biological systems exhibit sustained stochastic oscillations in their steady state. Assessing these oscillations is usually a challenging task due to the potential variability of the amplitude and frequency of the oscillations over time. As a result of this variability, when several stochastic replications are averaged, the oscillations are flattened and can be overlooked. This can easily lead to the erroneous conclusion that the system reaches a constant steady state. Results: This paper proposes a straightforward method to detect and asses stochastic oscillations. The basis of the method is in the use of polar coordinates for systems with two species, and cylindrical coordinates for systems with more than two species. By slightly modifying these coordinate systems, it is possible to compute the total angular distance run by the system and the average Euclidean distance to a reference point. This allows us to compute confidence intervals, both for the average angular speed and for the distance to a reference point, from a set of replications. Conclusions: The use of polar (or cylindrical) coordinates provides a new perspective of the system dynamics. The mean trajectory that can be obtained by averaging the usual cartesian coordinates of the samples informs about the trajectory of the center of mass of the replications. In contrast to such a mean cartesian trajectory, the mean polar trajectory can be used to compute the average circular motion of those replications, and therefore, can yield evidence about sustained steady state oscillations. Both, the coordinate transformation and the computation of confidence intervals, can be carried out efficiently. This results in an efficient method to evaluate stochastic oscillations. Keywords: Population dynamics, Stochastic oscillations, Average behavior, Stochastic processes, Jump Markov processes Background Randomness plays a crucial role in the time evolution of most biological systems [1–3]. This implies that it is not possible to determine with absolute certainty how a givenbiologicalsystemwillevolveinthefuture.Thus,one can at most aim at performing some statistical analyses to establish the probabilities of the potential future evolutions. This is true for molecular systems, where each molecule in the system is taken into account, and for population systems, where molecules and cells are disregarded, and just organisms are considered. This fact Correspondence: [email protected] 1Cambridge Systems Biology Centre, University of Cambridge, Tennis Court Road, CB2 1GA Cambridge, United Kingdom 2Department of Computer Science and Systems Engineering, University of Zaragoza, María de Luna 1, 50018 Zaragoza, Spain makes particularly difficult the study of oscillations, which are essential to understand biological systems as the circadian clock [4], epidemiological and ecological systems exhibiting non-seasonal fluctuations [5] (as measless or chicken pox [6, 7]), gene regulation networks where the expression levels of proteins fluctuate [8], etc. Many biological systems are usually defined by a set of species and a set of reactions. At a given time instant, the state of the system is given by the number of individuals of each species, i.e., the state can be expressed as a vector of natural numbers in which each component of the vector is associated to a species. The occurrence of a reaction produces a change in the state of the system. As deducing the exact occurrence time of the reactions is nearly impossible, it is frequently assumed that they happen at random. This implies that many biological systems can be considered © 2015 Júlvez. Open Access This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made. The Creative Commons Public Domain Dedication waiver (http://creativecommons. org/publicdomain/zero/1.0/) applies to the data made available in this article, unless otherwise stated.
Júlvez BMC Bioinformatics (2015) 16:333 Page 2 of 17 to be inherently discrete and stochastic [1, 9–11], and the dynamics of the populations involved in these systems can be appropriately modeled by means of jump Markov processes on the natural numbers [12]. The master equation associated to these processes determines accurately the variation over time of the probabilities of the potential states of the system. Unfortunately, the master equation suffers from the curse of dimensionality and is hardly ever analytically solvable [13]. Thus, alternative approaches must be sought to study the system dynamics. A traditional approach consists in considering the reaction rate equation which is given by a system of Ordinary Differential Equations (ODE) [14–16]. Under some mild assumptions, the reaction rate equation determines the time evolution of the expected values of the system populations. The reaction rate equation has been intensively used to model and analyze systems in chemistry, biology and engineering, and offers the possibility to take advantage of the large existing toolbox for analysis purposes of dynamical systems described by differential equations [17]. This approach is also known as continuous approximation,fluid approximation,mean field approximation and deterministic limit [15, 18]. Notice that the state trajectories yielded by this approach are continuous and deterministic, while the system under study is discrete and stochastic. Although this approach provides accurate results for highly populated systems, it might fail at capturing important properties, as oscillations, commutations, and stochastic resonance in biological systems where the number of species is relatively low [5, 19, 20]. In such systems, stochasticity becomes increasingly important. An alternative approach is not to solve exactly the master equation, which can be computationally prohibitive even in small systems, but to deal with its first order moments [13]. When the considered system is nonlinear, each central moment depends on a higher order moment what would lead to an infinite number of equations [21]. In order to avoid this problem, the Taylor expansion can be truncated, or moment closure techniques [22] can be applied. This approach is computationally efficient and usually performs well in practice. The limitations of the approach lie in the difficulty to determine the number of moments to consider, and the stiff and unstable equations that can be obtained for high number of moments for some systems, e.g., a prey-predator system like the one given by Lotka-Volterra equations. Another approach is to consider drift and diffusion terms of continuous populations by means of stochastic differential equations [23, 24]. The inherent stochasticity of the system can now be captured and transient and steady state analysis can be carried out. Nevertheless, in this approach the mathematical model is still continuous what could lead to significant inaccuracies when the populations of the system are small. Many dynamical properties of biological systems can be verified by means of probabilistic model checking [25, 26], a formal verification technique for stochastic systems. Based on the specification of a property in temporal logic, a model of the system is constructed in which each state represents a possible configuration of the system. Although model checking techniques have been proved successful in many application domains, they suffer from the state explosion problem inherent to many discrete systems. The dynamics of a biological system can also be studied by stochastic simulation algorithms [27, 28]. These algorithms provide exact samples or replications of the evolution of the discrete stochastic system. Once several replications are computed, statistical analyses can be performed on the replications to extract quantitative information of interest, e.g., a confidence interval for the average population of a species in the steady state. Although stochastic simulation algorithms are increasingly efficient, they can be computationally expensive if small confidence intervals are required, as this usually requires a large number of samples. This work proposes a straightforward procedure to assess stochastic oscillations of biological systems. More precisely, the goal of the procedure is to obtain confidence intervals both for the average angular speed and for the average distance to a given reference point. These confidence intervals are obtained from a set of replications obtained by a stochastic simulation algorithm. Consider several replications of a system exhibiting sustained stochastic oscillations. Given that the replications are stochastically out of phase, if the trajectories of the populations of the different replications are averaged, the resulting trajectory will show damped oscillations and will eventually converge to a point. In other words, oscillations cancel out in the averaged trajectory. In order to overcome this problem, the procedure transforms the original cartesian coordinates of the computed samples, in which each dimension is associated to a species, to another coordinate system: polar coordinates for systems with two species [29], and cylindrical coordinates for systems with more than two species. In these coordinate systems, the angular coordinate will be computed in such a way that it represents the total angular distance run by the system, i.e., it is not constrained to the interval [ 0, 2π). Then, instead of computing the cartesian average of populations to obtain confidence intervals, the polar (or cylindrical) average is considered. This way, the average circular motion of the system state around a given reference point (or axis) can be computed without being affected by the replications being stochastically out of phase. Hence, the use of a polar coordinate system can
Júlvez BMC Bioinformatics (2015) 16:333 Page 3 of 17 easily uncover stochastic oscillations in the replications otherwise hidden to the cartesian coordinate system. Most of the existing methods to detect stochastic oscillations are based on the use of the power spectral density and the autocorrelation of the time series [30, 31]. Power spectra are, for instance, used in [32] to explore the relationship between noisy cycles and quasi-cycles, and in [33] to assess oscillations of quasi-cycles in discrete-time models. On the other hand, the autocorrelation function, together with marginal distributions of population sizes, is used in [34] to distinguish between noisy cycles and quasi-cycles, and in [35] to quantify the effect of noise on a periodic signal. An advantage of the method proposed here with respect to previous approaches is that it can detect oscillations in short time series. This is due to the fact that the method makes use of a description of the system dynamics in polar coordinates and, in consequence, it does not need to find repetitive patterns along the time series to detect an oscillation. An alternative method, not based on the power spectrum, to evaluate oscillations consists of making use of probabilistic model checking [36]. This method can provide relevant quantitative information of oscillations, but has to deal with the state explosion problem. The method proposed here does not perform an exhaustive state space exploration, and hence, it does not suffer from the state explosion problem. On the other hand, as discussed in the Methods section, the ODE given by the reaction rate equation (or deterministic limit) captures the evolution of the expected values of the cartesian coordinates of the system. Following the ideas presented above, an alternative ODE, namely ODE (11), can be designed to capture the evolution of the expected values of the polar coordinates. Such an ODE provides a different perspective of the system dynamics and can be used to quickly detect potential stochastic oscillations without the need of simulation. The method is described in detailed in the Methods sections. It is applied on four different case studies in the Results and discussion section. The obtained average polar trajectories are compared to the average cartesian coordinates and to the deterministic trajectory yielded by the reaction rate equation. Methods This section first introduces the notation for the system parameters and the ODE determining the deterministic limit of the system under consideration. Then, the assessment of the evolution of affine and quadratic functions by the deterministic limit is studied. Finally, the method to evaluate sustained oscillations in stochastic systems is presented. System parameters and deterministic limit The following parameters are used to describe the system dynamics (in these definitions, Aidenotes the ith component of vector A). •q∈Ndenotes the number of populations (or species). •n∈Ndenotes the number of events (or reactions). •X(t)∈Nq ≥0is the state of the system at time t (Xi(t) denotes the number of elements of population i at time t ) •ν∈Nq×n ≥0is the stoichiometry matrix, i.e., νj iis the change produced in population i by event j (νjwill denote the jth column of ν, i.e., stoichiometry vector of reaction j ,andνiwill denote the ith row of ν). •V∈R>0is the size (or volume) of the system. •Wj:Rq ≥0×R>0→R≥0is the transition rate function, i.e, Wj(X(t),V)is the rate associated to event j for population X(t)and system size V . It is assumed that each transition rate function Wj(X(t),V)is a differentiable nonnegative function that does not depend on time (for readability we will use X rather than X(t)). Further, following the notation in [20], it is assumed that Wj(X, V)satisfies the density dependence condition, i.e., Wj(X,V)=V·wj(X/V),wherewj(X/V) is a nonnegative function of real arguments on the system densities. This condition states that if the densities are kept constant while the system size changes from V to V, then the transition rates change by a factor V/V. In the following, Wj(X(t),V)is simplified to Wj(X)for clarity, and densities will be expressed in lowercase, e.g., x=X/V. The system is modeled as a jump Markov process in which events are exponentially distributed with rates Wj(X). The occurrence of an event jchanges the system state from Xto X+νj. Given that all rates are exponentially distributed, the next event time is also exponentially distributed with rate R(X)=n j=1Wj(X),andtheprobability that the next event is event jis Wj(X)/R(X). Given a sample path of a jump Markov process, the embedded process is the sequence of consecutive states {X0,X1,X2,...,Xk,...}of the path. From a sequence {X0,X1,X2,...,Xk,...}, sample paths of the Markov process can be built by producing times for each event with exponentially distributed random variables. Deterministic limit: Let Fi=n j=1νj iwj(x)be the vector field for species i, and assume that n j=1|νj i|wj(x)<∞ and Fis Lipschitz continuous, i.e., ∃M≥0such that |F(x)−F(y)|≤M|x−y|.Then,thedeterministic limit behaviour of the system when Vtends to infinity is given by the following ODE [15, 16]: dxi dt =Fi(x)=n j=1νj iwj(x). This ODE can be scaled by
Júlvez BMC Bioinformatics (2015) 16:333 Page 4 of 17 Vto obtain a deterministic continuous trajectory for a system with size V: dXi dt = n j=1 νj iWj(X)(1) Under the conditions assumed in this section, the limit trajectory of the system densities, as the populations sizes tend to infinity, is obtained by the solution of ODE (1). Although such a continuous and deterministic trajectory can be meaningful in highly populated systems, it might disregard relevant phenomena caused by the inherent discrete and stochastic nature of biochemical systems. In fact, as the limit is never attained in practice, the trajectory yielded by ODE (1) must be used with caution when evaluating the time evolution of functions of interest, e.g., the evolution of the contagion rate in the epidemic system, seeFig.1.Inthefollowing,itisshownthataffinefunctions are appropriately evaluated by ODE (1), but more general functions, as quadratic functions used to measure distances, are not. Affine functions and quadratic functions Affine functions Let f:Rq ≥0→Rbe an affine function of the type f(X)=AX+b(for clarity, we avoid the use of transpose symbols). Let us first evaluate the change rate of fin the deterministic continuous trajectory provided by ODE (1). Fig. 1 Deterministic and stochastic evolution of the contagion rate of the epidemic system. Evolution of the contagion rate according to ODE (1) (dotted line), and according to a single stochastic replication of the Markov process (solid line). In contrast to the deterministic evolution, the stochastic replication exhibits undamped oscillations By the chain rule and (1), the total derivative of fwith respect to time is: df dt = q i=1 ∂f ∂Xi dXi dt = q i=1 ∂f ∂Xi⎛ ⎝ n j=1 νj iWj(X)⎞ ⎠ = q i=1 Ai⎛ ⎝ n j=1 νj iWj(X)⎞ ⎠=AνW(X) (2) where Aiis the ith element of vector A,andW(X)is a vector whose jth element is Wj(X). In order to estimate the speed of change of function faccording to the Markov process, we will consider the expected increase of fproduced by the occurrence of an event, and the average frequency of events. All the considered expected values are conditional on the current state. For brevity, E[f(X)|X]isshortenedtoE[f(X)]to denote the expected increase of f,givenX, of the embedded Markov process after the occurrence of an event ( is the usual finite difference operator). At a given state X, the expected increase of function fafter the occurrence of an event is the weighted average of the increases of f produced by the different events: Ef(X)= n j=1 Wj(X) R(X)f(X+νj)−f(X) = n j=1 Wj(X) R(X)A(X+νj)+b−(AX+b) (3) Given that at Xthe average number of events per time unit, i.e, frequency, is R(X), the average speed of change of faccording to the Markov process can be approximated as: R(X)Ef(X)= n j=1 Wj(X)A(X+νj)+b−(AX+b) = n j=1 Wj(X)q i=1 Aiνj i = n j=1 q i=1 Aiνj iWj(X)=AνW(X) (4) Notice that the above equations are essentially the ones that the Dynkin formula [24] would produce. Hence, the affine function fis evaluated equally by ODE (1) and the Markov process (see (2) and (4)). Nevertheless, this is not the case for a more general function f.
Júlvez BMC Bioinformatics (2015) 16:333 Page 5 of 17 Quadratic functions Let fbe the product of two affine functions h(X)=CX+u and g(X)=DX+v, i.e., f(X)=h(X)g(X)=(CX)(DX)+ CXv+DXu+uv.ThesumCXv+DXu+uv is an affine function and will be equally evaluated by ODE (1) and the Markov process, thus, to simplify the presentation we will assume that u=v=0 and hence, f(X)=(CX)(DX).By using (1), and given that fis a product of functions, the total derivative of fis: df dt =dhg dt =hdg dt +gdh dt =h q i=1 ∂g ∂Xi dXi dt +g q i=1 ∂h ∂Xi dXi dt = q i=1 dXi dt h∂g ∂Xi +g∂h ∂Xi = q i=1 n j=1 νj iWj(X)(CXDi+DXCi) =((CX)D+(DX)C) n j=1 νjWj(X) (5) As for affine functions, the average speed of change of fcan be approximated by the expected increase of the Markov process, E[f(X)]=E[((CX)(DX))], times the average number of events per time unit, R(X).Bythe product rule of the finite difference operator (the product rule of the finite difference operator states: (hg)= hg+gh+hg) and given that the vector of expected increases of populations is E[X]= n j=1 νjWj(X) R(X),thefollowing equality is produced: R(X)E[((CX)(DX))] =R(X)E[(CX)(DX)+(DX)(CX)+(CX)(DX)] =R(X)(CX)DE[X]+R(X)(DX)CE[X]+R(X)E[(CX)(DX)] =(CX)D n j=1 νjWj(X)+(DX)C n j=1 νjWj(X)+R(X)E[(CX)(DX)] =((CX)D+(DX)C) n j=1 νjWj(X)+R(X)E[(CX)(DX)] (6) From (5) and (6), the following equality showing the different speeds of change resulting from the ODE (1) and the Markov process is derived: R(X)E[((CX)(DX))]=df dt +R(X)E[(CX)(DX)] Thus, fis, in general, evaluated differently by the ODE that represents the deterministic limit and the Markov process. Quadratic functions as f(X)=(CX)(DX)+ CXv+DXu+uv appear naturally when estimating the evolution of certain reaction rates (as the contagion rate in the epidemic system in the Results and discussion section), the product of populations that could activate other events, or the squared distance to a given point. For this last case, it can be shown that the deterministic limit underestimates the speed of change of the squareddistancewithrespecttoapointawith coordinates (a1,...,aq).LetLa(X)=q i=1(Xi−ai)2,then,the speed of change of Laprovided by ODE (1) is: dLa dt = q i=1 ∂La ∂Xi dXi dt = q i=1 2(Xi−ai)⎛ ⎝ n j=1 νj iWj(X)⎞ ⎠ (7) On the other hand, by the chain rule (z2)=2zz+ (z)2and given that the expected increase of population iis E[Xi]= n j=1 νj i Wj(X) R(X), the speed of change of La estimated by the Markov process is: R(X)E[La(X)]=R(X)E q i=1 (Xi−ai)2 =R(X) q i=1 E(Xi−ai)2 =R(X) q i=1 E2(Xi−ai)Xi+(Xi)2 =R(X) q i=1 2(Xi−ai)E[Xi] +R(X) q i=1 E(Xi)2 = q i=1 2(Xi−ai)⎛ ⎝ n j=1 νj iWj(X)⎞ ⎠ +R(X) q i=1 E(Xi)2(8) From (7) and (8), the following equality is obtained: R(X)E[La(X)]=dLa dt +R(X) q i=1 E(Xi)2(9) Thus, given that q i=1E[(Xi)2]≥0, the Markov process estimates that the system moves away faster from (or approaches slower) point aas long as events happen, i.e., as long as R(X)>0. In particular, if ais a fixed point it holds that dLa(a) dt =0, i.e., the effect of all the events cancels out, and hence, the trajectory given by the deterministic limit stays constant at a. However, according to the Markov process events will keep on occurring if ais
Júlvez BMC Bioinformatics (2015) 16:333 Page 6 of 17 not an extinction point, and hence, the system can move away from aat an average speed of R(X)q i=1E[(Xi)2] and describe a different trajectory. Notice that as Vincreases and tends to infinity while the concentrations are kept constant, the trajectory of the jump Markov process will converge to that of the deterministic limit [15, 16]. Nevertheless, in many systems of interest, the value of Vcannot be taken as infinity and just considering the deterministic limit can overlook important properties of the system dynamics. Systems with two species By using similar mathematical developments as in the previous subsection, the expected value of the embedded process can be used to provide a different view (polar instead of cartesian) of the system evolution. Such a view is the result of estimating the distance and angle of the state of the system to a given reference point. The focus of this subsection is on systems with two species, i.e., q=2. The trajectory yielded by ODE (1) in the phase space is tangent to the weighted average of the vectors νjaccording to their transition rates at each time instant. That is, the future positions of the system are computed according to the weighted average of the cartesian coordinates of the vectors νj. As the size Vtends to infinity, the evolution of the Markov process approaches the deterministic limit ODE (1). An alternative way to study the evolution of a process with size Vis to perform a number of replications (or sample paths) and compute the mean populations at given sampling times. Notice that, when computing the mean populations, one is averaging the cartesian coordinates. One can, however, consider other values to analyze the dynamical behaviour of the process. For instance, one could average the distance of the state to a given reference point. This average distance together with angular information with respect to the reference point would state the basis to extract dynamical information of the process in polar coordinates. Assume that two replications of a given system have been performed, and one desires to estimate the average system trajectory over time. A common approach would be to compute the mean values of the populations at same time instants. Assume that at a given time instant τ,the number of individuals of the first species Xgiven by the first replication is Uxand the number of individuals of the second species Yis Uy(Fig. 2). Let us also assume that the number of individuals given by the second replication at time τis Wxand Wy. The mean of these cartesian coordinatesyieldstheaverage state C. Nevertheless, one might desire to evaluate, not the average cartesian coordinate, but the average position with respect to a given reference point. Figure 2 shows how state Pis obtained as the mean polar coordinates of states U(with cartesian coordinates Fig. 2 Average cartesian (point C) and polar (point P) coordinates of points Uand Wwith respect to reference point a.Xand Yare the increments in cartesian coordinates; ρ and ψ are the increments in distance and angle. These two averages provide different perspectives about the dynamics of the stochastic system (Ux,Uy))andW(with cartesian coordinates (Wx,Wy)) with respect to reference point a: the polar coordinates of Pare simply the mean polar coordinates, i.e., angle and distance, of the polar coordinates of Uand W. The procedure to compute the average polar coordinates of a number of replications could be stated as follows: 1. Assume that M replications have been performed and the trajectories have been resampled at same sampling times. Let X0 q,Y0 q,X1 q,Y1 q,...,Xk q,Yk q, ...be the cartesian coordinates of replication q at sampling times 0, 1, ...,k,.... 2. Let the origin of the polar coordinate system be the reference point a with cartesian coordinates (ax,ay). 3. Each Xk q,Yk qcan be transformed to polar coordinates ρk q,φk qwith origin at a by using: ρk q=Xk q−ax2+Yk q−ay2, φk q=atan Yk q−ay,Xk q−axwhere atan(y,x): R×R→Ris the arctangent of a point with cartesian coordinates (x,y)that takes into account the quadrant. We will assume that the range of atan(y,x) is (−π,π]and that atan(0, 0)=0. This straightforward transformation to polar coordinates poses a problem when averaging the angle φof replications. Assume that at a given step k,thestatesof two trajectories iand jare on the left half plane defined
Júlvez BMC Bioinformatics (2015) 16:333 Page 7 of 17 by ax, i.e., Xk i<axand Xk j<ax,andYk iis slightly higher than aywhile Yk jis slightly lower than ay.Thus,φk iwill be positive and close to πwhile φk jwill be negative and close to −π. Hence, the mean of φk iand φk iwill be close to 0 whatisnotusefulasaverageangle. In order to overcome this problem, we define a new value ψk qto account for the overall angular distance run by the trajectory. Let us define ψ0 q=φ0 q,andforeach k≥0, let us express ψk qas ψk q=zk q2π+hk q,with zk q∈Zand −π<hk q≤π,i.e,zk qis an integer representing the rounded number of completed loops and hk qis the angular distance run on the current loop. The value of zk qis positive(negative) if the angular distance was run anticlockwise(clockwise). In Fig. 3, state Xk+1 i,Yk+1 iis reached after Xk i,Yk i, thus the total angular distance run at Xk+1 i,Yk+1 iis ψk+1 qand not φk+1 q.Moreover,the number of completed loops at Xk+1 i,Yk+1 iis zk+1 q=1 as it was anticlockwise and hk+1 qis a negative value not lower than −π. More formally, the value of ψk qfor k≥0canbe computed as follows: ψk q=⎧ ⎪ ⎪ ⎪ ⎨ ⎪ ⎪ ⎪ ⎩ φ0 qif k=0 z(k−1) q2π+φk q+2πif k>0 and h(k−1) q>π 2and φk q<−π 2 z(k−1) q2π+φk q−2πif k>0 and h(k−1) q<−π 2and φk q>π 2 z(k−1) q2π+φk qotherwise (10) where φk q=atanYk q−ay,Xk q−axfor every k≥0. The first case of the above expression sets the initial value Fig. 3 Polar average of points with angular coordinate close to π.The angular coordinates φof the consecutive points Xk q,Yk qand Xk+1 q,Yk+1 qof the qth replication have opposite signs and absolute values close to π. As this can cause problems when averaging angles of different replications, the total angular distance run ψis used instead of φ of φ0 q. The second and third cases take into account the discontinuity of the angle returned by atan when the trajectory moves from the second to the third quadrant, and from the third to the second quadrant respectively. The forth case does not have to handle a change of quadrant and just computes the overall angular distance run by the system. Thus, in the following the polar coordinates of the qth replication at the kth sampling time will be expressed as ρk q,ψk q. Once ψk qis computed for every kand every replication, an average trajectory in polar coordinates can be obtained by computing the mean of ρk qand ψk qover all replications. The average polar trajectories reported in the Results and discussion section have been obtained by the described procedure. The steps required to perform statistical analyses of steady state parameters of the polar trajectory are similar to the standard ones [37]. The focus will be on estimating the steady state mean values of the polar coordinates of the system within a given confidence interval with respect to a given reference point (ax,ay).Inparticular,(ax,ay) is taken as the average cartesian coordinates of the performed replications. It must be noticed that at the steady state of an oscillating system, the angular coordinate does not tend to a constant value but increases or decreases monotonically over time. In order to take into account this fact, instead of the mean angle ψ, the mean angular speed, which will be denoted as ξ, will be estimated. Given two parameters αand Maxerr, Algorithm 1 summarizes the tasks required to build αpercent confidence intervals with MaxErr relative error for the mean distance and angular speed of the system with respect to (ax,ay). Algorithm 1: Computing average distance and angular speed Input: System parameters, Percent confidence interval (α), Maximum relative error (MaxErr) Output: Confidence intervals for mean distance (ρ)and angular speed (ξ) 1) compute initial transient by means of Welch’s procedure; repeat 2) perform a replication of the system; 3) resample the performed replication at equal sampling intervals; 4) let (ax,ay)be the average cartesian coordinates over time of the performed replications; 5) apply (10) to transform each replication to polar coordinates (ρ,ψ) with origin at (ax,ay); 6) compute the average distance, ρ, and average polar angular speed, ξ, of each replication; 7) compute αpercent confidence intervals for the mean of ρand ξ; until the relative errors of the confidence intervals are less than MaxErr;
Júlvez BMC Bioinformatics (2015) 16:333 Page 8 of 17 As the interest is in estimating steady state means, the first step, (step 1), of Algorithm 1 is to determine the length of the transient state (or warm-up period) to make easier the initial-data deletion when computing averages. This task has been achieved by means of the Welch’s procedure [37, 38]. In order to compute confidence intervals that satisfy the requirements of the input parameters αand MaxErr, the replication/deletion approach for means [37] has been adopted. In the proposed iterative design, a new replication is carried out in each iteration, what eventually decreases the variance of the parameters. Thus, new simulations are performed until the computed confidence intervals satisfy the parameters. The simulation algorithm used to perform the simulations (both for the Welch’s procedure and step 2) is the exact stochastic simulation algorithm proposed by Gillespie [39]. Once a new replication is performed, it is resampled at equal sampling intervals by applying a linear interpolation (step 3). The sampling interval is the same for all replications, and it is set to the average time interval between events of the first replication. The average coordinates referred in steps 4 and 6 are computed just on the steady state, i.e., the transient state determined in the first step is disregarded. Once the origin (ax,ay)of the polar coordinates is obtained (step 4), the transformation to polar coordinates can be carried out (step 5). Finally, the average ρand polar angular speed ξ are computed (step 6), and the confidence intervals for ρ and ξcan be calculated (step 7). ODE in polar coordinates. A similar approach to the one discussed above can be taken to describe the system dynamics in terms of an ODE in polar coordinates. According to the following ODE, the system evolution is characterized by its expected changes in distance and angle to a reference point a: dρ dt =R(X)Efρ(X)= n j=1 Wj(X)fρ(X+νj)−R(X)fρ(X) dψ dt =R(X)Efψ(X)= n j=1 Wj(X)fφ(X+νj) +g(X,νj,a)−R(X)fφ(X) (11) where X=(X,Y)are the cartesian coordinates, (ρ,ψ) are the polar coordinates with origin at (ax,ay),fρ(X)and fψ(X)are defined as fρ(X)=(X−ax)2+(Y−ay)2and fψ(X)=atan(Y−ay,X−ax),and: g(X,νj,a)=⎧ ⎨ ⎩ +2πif fψ(X)>π/2andfψ(X+νj)<−π/2 −2πif fψ(X)<−π/2andfψ(X+νj)>π/2 0otherwise As in (4), the above ODE makes use of the expected increments of the coordinates and number of events per time unit to express the derivatives. The first(second) case of the above expression avoids the discontinuity of the angle returned by atan when the trajectory moves from the second to the third quadrant(from the third to the second quadrant). While the average of polar coordinates of replications can be used to estimate the mean circular motion, ODE (11) provides information of the instantaneous speed of change of the polar coordinates at each possible state of the system. Systems with more than two species The previous subsection has discussed how stochastic oscillations can be detected in systems with two species, i.e., q=2, be means of polar coordinates. One might expect that for systems comprising more than two species, spherical coordinates for q=3, and hyperspherical coordinates for q>3 could be used. Nevertheless, these coordinates pose difficulties when trying to assess oscillations. Let us illustrate this by considering a system with three species. The state of the system at a given time can be expressed in the spherical coordinates (ρ,θ,φ),where ρis the radial distance, θis the polar angle, and φis the azimuthal angle. The range of θis usually restricted to the interval [ 0, π], and the range of φto [ 0, 2π]. Assume that a system oscillates around a reference point which has been taken as the origin of the spherical coordinates, see Fig. 4. Assume further that the projection of the system trajectory on the plane z=0 moves anticlockwise if seen from a positive z.Asthesystemtrajectory evolves, the value of φincreases until it reaches 2π.Asin Fig. 4 Assumed trajectory of a system with 3 species oscillating around a given reference point. As shown in Fig. 5 the time evolution of the polar angle θexhibits no discontinuity for this trajectory
Júlvez BMC Bioinformatics (2015) 16:333 Page 9 of 17 the previous subsection, in order to avoid discontinuities when the value of φis close to 2πand 0, coordinate φcan be transformed to a new coordinate ψthat accounts for the overall angular distance run, see Fig. 5. By proceeding as in the previous subsection, one can average the value of this new coordinate over several replications, to estimate the system oscillations on the species associated to axes X and Y. On the other hand, the value of the polar angle θoscillates within the interval [ 0, π] and does not reach any of the limits of the interval, neither 0 nor π.Thus,thereis no discontinuity in the polar angle to fix.Figure5shows the potential evolution of θover time. Assume that several replications are performed, and the mean value of θis estimated on the basis of its average value over the replications. As the system is stochastic, there will exist phase shifts among replications that will eventually involve a constant value of their average value. This renders the polar angle not useful to detect oscillations on the species associated to axis Z. A feasible way to overcome this difficulty is to consider cylindrical coordinates instead of spherical coordinates. To determine the position of a point, cylindrical coordinates establish a reference (or longitudinal) axis and a reference plane perpendicular to the axis, see Fig. 6. The origin is the intersection between the reference plane and the reference axis. The state of a system with three species is expressed in cylindrical coordinates as (ρ,φ,z),where (ρ,φ) are called polar coordinates (as they correspond to the polar coordinates on a plane parallel to the reference plane), and zis the height with respect to the reference plane. Fig. 5 Potential time evolution of the overall azimuthal angle ψand the polar angle θof the oscillating system. In contrast to the angular coordinate in systems with two species, the polar angle in this trajectory presents no discontinuity. This fact hinders the use of spherical coordinates to assess oscillations in systems with more than two species Fig. 6 Cylindrical coordinates can be used to detect oscillations in systems with more than 2 species. According to this coordinate system, one cartesian coordinate and a tuple (ρ,φ) are used for systems with 3 species. In general, for systems with q>2species, q−2 cartesian coordinates and a tuple (ρ,φ) are required. The choice of species associated to (ρ,φ) determines on which species the oscillation are to be assessed In a system with 3 species (a,b,c), a natural choice is to associate one species, e.g. c, to the reference axis of the cylindrical coordinates. This way, the polar coordinates of (a,b)is (ρ,φ) which can be handled as in the previous subsection to avoid discontinuities, and estimate the stochastic oscillations on the populations of aand b.The same process can be repeated two more times: one with the reference axis associated to a,andoneassociatedto b. This will uncover the oscillations on populations band c,andaand crespectively. Thus, cylindrical coordinates allow us to decouple the oscillations between the different pairs of species involved in the system. Notice that, although the process is repeated 3 times for a system with 3, the same set of replications can be used in all three cases. For systems with more than 3 species, a very similar approach can be taken. The height zin cylindrical coordinates can be interpreted as the cartesian coordinate of the system. If more species are involved, more cartesian coordinates must be considered, while just one tuple (ρ,φ) of polar coordinates must be considered. For instance, if the number of species is 5, three cartesian coordinates (z1,z2,z3)will be considered together with the polar coordinates (ρ,φ). The choice of species associated to (ρ,φ) determines on which species the oscillation are to be assessed. ODE in cylindrical coordinates. The use of cylindrical coordinates enables us to use almost in a straightforward way the ODE (11) in polar coordinates presented in the previous subsection. For instance, the ODE in cylindrical coordinates for a system with 3 species X=(X,Y,Z)in
Júlvez BMC Bioinformatics (2015) 16:333 Page 16 of 17 Fig. 20 Trajectories of the average cartesian and cylindrical coordinates of 297 stochastic replications in the phase space (PX,PY) of the repressilator model with n=1.5. While the average cartesian coordinates tend to a fixed point, the average cylindrical coordinates show sustained oscillations straightforwardly used to obtain confidence intervals for the mean angular speed and distance to the reference axis. Competing interests The author declares that he has no competing interests. Authors’ contributions JJ wrote the paper. The authors read and approved the final manuscript. Acknowledgements The author is grateful to Marta Kwiatkowska, Gethin Norman and David Parker for their valuable suggestions and ideas in preliminary works. This research was supported by a Marie Curie Intra European Fellowship within the 7th European Community Framework Programme. Call reference: FP7-PEOPLE-2013-IEF. Project number: 623995. Project acronym: FormalBio. Received: 4 February 2015 Accepted: 7 October 2015 References 1. Fedoroff N, Fontana W. Small numbers of big molecules. Science. 2002;297(5584):1129–1131. 2. Kepler TB, Elston TC. Stochasticity in transcriptional regulation: Origins, consequences, and mathematical representations. Biophys J. 2001;81(6): 3116–136. doi:10.1016/S0006-3495(01)75949-8. 3. Kaufmann BB, Van Oudenaarden A. Stochastic gene expression: from single molecules to the proteome. Curr Opin Genet Dev. 2007;17(2): 107–12. 4. Forger DB, Peskin CS. Stochastic simulation of the mammalian circadian clock. Proc Natl Acad Sci U S A. 2005;102(2):321–4. doi:10.1073/pnas.0408465102. 5. Abramson G, Risau-Gusman S. Assessing the Quality of Stochastic Oscillations. Pramana, J Phys. 2008;70(6):1047–1054. 6. Wilson EB, Lombard OM. Cycles in measles and chicken pox. Proc Natl Acad Sci U S A. 1945;31:367–71. 7. Bartlett MS. Measles periodicity and community size. 1957. doi:10.2307/ 2342553. 8. Barrio M, Burrage K, Leier A, Tian T. Oscillatory regulation of hes1: Discrete stochastic delay modelling and simulation. PLoS Comput Biol. 2006;2(9):117. doi:10.1371/journal.pcbi.0020117. 9. Hume DA. Probability in transcriptional regulation and its implications for leukocyte differentiation and inducible gene expression. Blood. 2000;96(7):2323–328. http://bloodjournal.hematologylibrary.org/ content/96/7/2323.full.pdf. 10. McAdams HH, Arkin A. It’s a noisy business! Genetic regulation at the nanomolar scale. Trends Genet. 1999;15(2):65–9. doi:10.1016/S0168- 9525(98)01659-X. 11. Geva-Zatorsky N, Rosenfeld N, Itzkovitz S, Milo R, Sigal A, Dekel E, et al. Oscillations and variability in the p53 system. Mol Syst Biol. 2006;2(1): doi:10.1038/msb4100068. 12. Durrett R. Essentials of Stochastic Processes: Springer; 1998. 13. Engblom S. Computing the moments of high dimensional solutions of the master equation. Appl Math Comput. 2006;180(2):498–515. doi:10.1016/j.amc.2005.12.032. 14. Kurtz T. Solutions of Ordinary Differential Equations as Limits of Pure Jump Markov Processes. J Appl Probab. 1970;7(1):49–58. 15. Ethier S, Kurtz T. Markov Processes: Characterization and Convergence: John Wiley; 1986. 16. Jacod J, Shiryaev A. Limit Theorems for Stochastic Processes: Springer; 2002. 17. Hirsch MW, Smale S. Differential Equations, Dynamical Systems and Linéar Algebra. Pure and Applied Mathematics. London: Academic Press; 1995. http://opac.inria.fr/record=b1099208. 18. Bortolussi L, Hillston J, Latella D, Massink M. Continuous approximation of collective system behaviour: A tutorial. Perform Eval. 2013;70(5): 317–49. doi:10.1016/j.peva.2013.01.001. 19. DeVille R, Muratov C, Vanden-Eijnden E. Non-meanfield Deterministic Limits in Chemical Reaction Kinetics. The Journal of Chemical Physics. 2006. 124(231102). doi:10.1063/1.2217013. 20. Natiello M, Solari H. Blowing-up of Deterministic Fixed Points in Stochastic Population Dynamics. Mathematical Biosciences. 2007;209(2): 319–35. doi:10.1016/j.mbs.2007.02.002. 21. Ale A, Kirk P, Stumpf MPH. A general moment expansion method for stochastic kinetic models. J Chem Phys. 2013. 138(17). doi:10.1063/1.4802475. 22. Hespanha J. Moment closure for biochemical networks. In: Communications, Control and Signal Processing, 2008. ISCCSP 2008. 3rd International Symposium On; 2008. p. 142–7. doi:10.1109/ISCCSP.2008. 4537208. 23. Krone SM. Spatial models: stochastic and deterministic. Math Comput Model. 2004;40(3–4):393–409. doi:10.1016/j.mcm.2003.09.037. 24. Øksendal B. Stochastic Differential Equations: An Introduction with Applications (Universitext), 6th ed. Berlin, Heidelberg, New York: Springer; 2010. 25. Heath J, Kwiatkowska M, Norman G, Parker D, Tymchyshyn O. Probabilistic model checking of complex biological pathways. Theor Comput. Sci. 2008;391(3):239–57. doi:10.1016/j.tcs.2007.11.013. Converging Sciences: Informatics and Biology. 26. Ballarini P, Mardare R, Mura I. Analysing Biochemical Oscillation through Probabilistic Model Checking. Electron Notes Theor Comput Sci. 2009;229(1):3–19. doi:10.1016/j.entcs.2009.02.002. 27. Turner TE, Schnell S, Burrage K. Stochastic approaches for modelling in vivo reactions. Comput Biol Chem. 2004;28(3):165–78. doi:10.1016/ j.compbiolchem.2004.05.001. 28. Gillespie DT, Petzold LR. System Modelling in Cellular Biology. Chapter: Numerical Simulation for Biochemical Kinetics: The MIT Press; 2010. 29. Júlvez J. On the average dynamical behaviour of stochastic population models. In: Proceedings of the 19th Triennial World Congress of the International Federation of Automatic Control (IFAC 2014). Cape Town, South Africa; 2014. 30. Chatfield C. The Analysis of Time Series: An Introduction. Texts in statistical science. Boca Raton (Fl.): Chapman & Hall/CRC; 2004. 31. Percival DB, Walden AT. Spectral Analysis for Physical Applications: Cambridge University Press; 1993. 32. Boland RP, Galla T, McKane AJ. How limit cycles and quasi-cycles are related in systems with intrinsic noise. J. Stat. Mech. 2008;2008(09):09001. doi:10.1088/1742-5468/2008/09/p09001. 0805.1607. 33. Parra-Rojas C, Challenger JD, Fanelli D, McKane AJ. Intrinsic noise and two-dimensional maps: Quasicycles, quasiperiodicity, and chaos. Phys. Rev. E. 2014;90:032135. doi:10.1103/PhysRevE.90.032135. 34. Pineda-Krch M, Blok HJ, Dieckmann U, Doebeli M. A tale of two cycles - distinguishing quasi-cycles and limit cycles in finite predator prey populations. Oikos. 2007;116:53–64.
Júlvez BMC Bioinformatics (2015) 16:333 Page 17 of 17 35. Gaspard P. The correlation time of mesoscopic chemical clocks. The Journal of Chemical Physics. 2002;117(19):8905–916. doi:10.1063/ 1.1513461. 36. Ballarini P, Guerriero ML. Query-based Verification of Qualitative Trends and Oscillations in Biochemical Systems. Theoretical Computer Science. 2010;411(20):2019–036. doi:10.1016/j.tcs.2010.02.010. 37. Law AM. Simulation Modeling and Analysis: McGraw-Hill; 2007. 38. Welch PD. The Statistical Analysis of Simulation Results. The Computer Performance Modeling Handbook: Academic Press; 1983. 39. Gillespie D. Exact Stochastic Simulation of Coupled Chemical Reactions. J Phys Chem. 1977;81(25):2340–361. doi:10.1021/j100540a008. http://pubs. acs.org/doi/pdf/10.1021/j100540a008. 40. MATLAB. Version 7.10.0 (R2010a). The MathWorks Inc., Natick, Massachusetts; 2010. 41. Glandsdorff P, Prigogine I. Thermodynamic Theory of Structure, Stability and Fluctuations. New York: Wiley-Interscience; 1971. 42. Kang H, Pesin Y. Dynamics of a Discrete Brusselator Model: Escape to Infinity and Julia Set. Milan J Math. 2005;73(1):1–17. 43. Brauer F, Castillo-Chavez C. Mathematical Models in Population Biology and Epidemiology: Springer; 2001. 44. McKane AJ, Newman TJ. Predator-prey cycles from resonant amplification of demographic stochasticity. Phys Rev Lett. 2005;94: 218102. doi:10.1103/PhysRevLett.94.218102. 45. Parker M, Kamenev A. Extinction in the Lotka-Volterra model. Phys Rev E. 2009;80:021129. 46. Elowitz MB, Leibler S. A synthetic oscillatory network of transcriptional regulators. Nature. 2000;403(6767):335–8. doi:10.1038/35002125. 47. Chelliah V, Laibe C, Novère NL. Biomodels database: A repository of mathematical models of biological processes. Methods Mol Biol,. 2013;1021:189–99. http://www.ebi.ac.uk/biomodels-main/ BIOMD0000000012-metaid-0100236. Submit your next manuscript to BioMed Central and take full advantage of: • Convenient online submission • Thorough peer review • No space constraints or color figure charges • Immediate publication on acceptance • Inclusion in PubMed, CAS, Scopus and Google Scholar • Research which is freely available for redistribution Submit your manuscript at www.biomedcentral.com/submit