ResearchPattern statistics on Markov chains and sensitivity to parameter estimationLaboratoire Statistique et Génome, University of Evry, CNRS (8071), INRA(1152), 523, place des terrasses de I'Agora, 91034 Evry CEDEX, France
Algorithms for Molecular Biology 2006, 1:17doi:10.1186/1748-7188-1-17 The electronic version of this article is the complete one and can be found online at: http://www.almob.org/content/1/1/17
©
2006 Nuel; licensee BioMed Central Ltd. AbstractBackground:In order to compute pattern statistics in computational biology a Markov model is commonly used to take into account the sequence composition. Usually its parameter must be estimated. The aim of this paper is to determine how sensitive these statistics are to parameter estimation, and what are the consequences of this variability on pattern studies (finding the most over-represented words in a genome, the most significant common words to a set of sequences,...). Results:In the particular case where pattern statistics (overlap counting only) computed through binomial approximations we use the delta-method to give an explicit expression of σ, the standard deviation of a pattern statistic. This result is validated using simulations and a simple pattern study is also considered. Conclusion:We establish that the use of high order Markov model could easily lead to major mistakes due to the high sensitivity of pattern statistics to parameter estimation. BackgroundIn order to study pattern occurrences in biological sequences, simple frequencies are not relevant in most cases because of pattern overlapping structure as well as composition bias in the sequences. A common workaround consists to compute the significance of an observation assuming the sequence X = X1 ... Xℓ over the finite alphabet π(w, a) = ℙ(Xm+1 = a|X1...Xm = w) ∀(w, a) ∈ be the parameter of this Markov model, Π its transition matrix (note that we have Π = π only if m = 1) and μ its stationary distribution (defined by μ × Π = μ). We then introduce the pattern statistic defined by where N is the random number of overlapping occurrences (i. e. X = aababaaba contains three overlapping occurrences of aba but only two non-overlapping ones) of a given fixed pattern on the random sequence X and Nobs is an observation. When π is known (and hence μ), several statistical methods are available to compute S: exact computations [1-4], Gaussian [5,6], binomial [7,8], compound Poisson [9-11] or large deviations approximations [12]. But in general, the parameter π is not available and must be estimated. Let us denote by N0 (resp. N1) the (overlap) frequencies of all words of size m (resp. m + 1) in the sequence Y = Y1 ... Yn, then the Maximum-Likelihood Estimator (MLE) of π is given by and the MLE of μ (as a function of π) is therefore defined by We introduce now the following estimators which are known to be asymptotically equivalent with the MLE when n is large. The quality of parameter estimation depends both on the number of parameters to estimate (km+1 for an order m Markov model) and of the length (n) of the homogeneous sequence used for their estimation. When the same sequence (or set of sequences) is used both for observed frequencies and parameter estimation, m should not be greater than h – 2 for a pattern of length h (as else, the observed frequency of the pattern will be included in the model). As literature often suggests to use the highest possible order, it is hence common to consider m = 6 or more (for a DNA pattern of size h ≥ 8). Moreover, because of the homogeneity assumption of the model, the considered genomes have often to be segmented first. As a result, the sequences length used for parameter estimations are often dramatically reduced by such segmentation (e. g. n = 105 to n = 106 at the very best for DNA sequences). It is hence quite common to encounter high order Markov models estimated on rather short sequences which could result in high sensitivity to parameter estimation. Considering that Y is generated through a Markov model of parameter π, the main goal of this paper is to study the distribution of SN, the statistic S computed using the estimators μN and πN, and the consequences of its variability in projects using pattern statistics. We first present in details how the delta-method can be used to get a Gaussian approximation for the distribution of SN (using a binomial approximation to compute the pattern statistics). Then these approximations are validated through simulations and, at last, we consider a classical pattern study (finding the most over-represented patterns of a given size) and we evaluate the detrimental effect of parameter estimations both in terms of true positive rate and rank accordance. Materials and methodsDistribution of N = (N0, N1)As the estimators defined in (4) are expressed as functions of N0 and N1 we first study their distribution. Using a Gaussian approximation, we have where, for i, j ∈ {0, 1}, Ei ∈ In the stationary case, exact expression of E and C can be computed according to [5]. Expectation is simply given ∀w ∈ E0(w) = (n - m + 1) μ(w) E1 (wa) = (n - m) μ(w)Π(w, a) ∀(w, a) ∈ In order to give more fluidity to this paper, the expression of the covariance matrix C have been moved in appendix A. Let us remark, before going forward that substituting N by E in (4) immediately gives Delta methodLet us start with a simple case. We consider a single pattern which is over-represented (seen more than expected) so we have where the function F+ also depends on the sequence length ℓ and the considered pattern. If F+ is differentiate, the delta-method (a simple first order Taylor expansion around N = E, see [13]) provides the following approximation: and hence, using (7) we have for n large enough. The distribution of with In consequence, computing σ requires both to compute C (done in appendix A) and ∇F+ (E). Single patternThe exact expression of F+ is computable through many different methods [1-4] but is too much complicated to derive explicitly ∇F+. To overcome this problem, we propose to consider an approximation of F+. As said in introduction, many kind of approximations are available (Gaussian, binomial, compound Poisson or large deviations). In this paper, we have chosen to use a binomial approximation as it provides an expression which is analytically differentiable and is known to be a good heuristic to the problem [8]. For a single non-degenerate pattern (i.e. a simple word) W = w1 ... wh (wi ∈ P(N) = μN (w1 ... wm) × πN (w1 ... wm, wm+1) × ... × πN (wh-m ... wh-1, wh) (13) the probability for W to occur at a given position in the sequence and then we get where Note that if we consider non-overlapping occurrences instead of overlapping ones, we can still use a binomial approximation for the distribution of N, but the expression of P(N) is more complicated as it involves the auto-correlation polynome of the pattern [14]. This point is not developed in this paper. Replacing μN and πN by their expression easily gives where A1(wa) counts occurrences of the word wa in W = w1 ... wh and A0 (w) counts occurrences of the word w in w2 ... wh-1. Note that in the particular case where h = m - 1, all A0 (w) are null and we simply get (n - m + l) × P (N) = N1 (W). Using the derivative properties of the incomplete beta function (see appendix B for more details) we hence get so all we need is to compute ∇P(N). and If we denote by P = μ (w1 ... wm) × π (w1 ... wm, wm+1) × ... × π (wh-m ... wh-1, wh) (19) the true probability for W to occur at a given position in the sequence X then we get, using (7) in (13), that for n large enough. We hence get where tG = [tG0 tG1] is defined by Using equation (12) we finally get where and then, a computation of σ is possible by plug-in. Without considering the computation of E and C, the complexity of this approach is O(h) (where h is the size of the pattern). When a degenerate pattern (finite set of words) is considered instead of a single word, it is easy to adapt this method by summing the contribution p of each word belonging to the pattern. This point is left to the reader. Under-represented patternIn the case of an under-represented pattern we have Using a binomial approximation we get and, by the same method than in the over-represented case we finally have where Two distinct patternsWe consider now two patterns V and W instead of one and want to study the joint distribution of SN (V) and SN (W) their corresponding pattern statistics. With a similar argument as in section "delta method", it is easy to show that where σV (resp. σW) is the standard deviation σ for the pattern V (resp. W) and where where And after using results of sections "single pattern" and "under-represented pattern" we finally get where SimulationsIt is also possible to study the empirical distribution of a SN (for one or more patterns) through simulations. In order to do so, we first draw M independent sequences Yj = For each j we get the frequencies Nj = ( We now have a M – sample S1, ..., SM of SN from which we can easily estimate σ and thus, valid or invalid the approximation through the delta-method. When used with large value of n (e.g. several millions or more), the complexity of this approach is slowed by the drawn of the sequences Yj. It is therefore possible to improve the method by simulating directly the frequencies N through (5). As this approximation has a very small impact on the distribution of SN (data not shown) it may dramatically speed-up the computations when considering large n or M. It is nevertheless important to point out that drawing a Gaussian vector size L requires to precompute the Choleski decomposition of its covariance matrix which could be a limiting factor when considering large L. Results and discussionValidationSimple caseLet us start with a simple case: a binary alphabet which stationary distribution is μ = (6/13,7/13) and we work on a sequence of length n = 10 000. The first thing to do is to compute E and C (see appendix A for details). Now, we consider the pattern W = ababa occurring Nobs = 1221 times in a sequence of length ℓ = n = 10 000. We have p = μ(a) Π (a,b)2 Π (b,a)2 = 8.142 × 10-2 (34) so We have and and Finally, we get As our pattern statistics is the decimal logarithm of the p-value, σ = 6 means that the ratio of the estimated p-value over the true one could easily range from 10-12 (10-2 × σ) to 1012 (102 × σ) which is huge. We can see on fig. 1 the empirical distribution of SN compared to the theoretical distribution. Even if the two distributions are closely related, an adjustment test (Kolmogorov-Smirnov) shows that they are different.
In the fig. 2 we compare σ to its estimator
The equation (39) gives an explicit expression of σ as a product of two terms. Once the pattern and the true parameter π are fixed, the first term (Q) depends only on ℓ and Nobs while the second one only depends on the length n of the sequence used for the parameter estimation (see appendix C for an explicit expression of σ in the particular case of an order 0 Markov model). To study the variations of σ(n) as a function of n we therefore need to study G(n) and C(n). Using equations (6) and (22) we get that Using equations (57) and (58) in appendix A we also get that C = M + O + t EE with M(n) = O(n2) and O(n) = O(n) (41) so finally for large n, with and We can see on fig. 3 that
We also see on the same figure that σ grows rapidly when n decreases. For example, we get σ ≃ 20 for n = 5000 (while equation (35) gives S ≃ 264.4). As we consider here a binary alphabet (k = 2) and a first order Markov model (m = 1) we have only km(k - 1) = 2 parameters to estimate with a sample of size n = 5000 (so we have 2500 sample per parameter). Although this situation seems quite comfortable, the sensitivity to parameter estimation appears in fact to be so large that we could have a factor 1040 between the true p-value and its estimate. Practical caseWe have seen with our first example that our approximation works very well in a simple case. Will this hold with more practical cases? To answer this question, let us consider the following experimental design: • one pattern: W = acgtacgt; • two genomes: Escherichia coli K12 (ℓ = n = 4639675) and Mycoplasma genitalium (ℓ = n = 580076); • five Markov orders: m = 1 to m = 5 (larger m are not considered since the computation of C becomes then intractable). As the sequence lengths and compositions of the two considered genomes differ a lot, we have to take a different value of Nobs for each organism: Nobs = 30 for M. genitalium and Nobs = 150 for E. coli. Proceeding as indicated in section "simulations", we use the algorithm 1 for each experiment. Table 1. Comparison of theoretical and empirical pattern statistic mean and standard deviation on Escherichia coli K12. Table 2. Comparison of theoretical and empirical pattern statistic mean and standard deviation on Mycoplasma genitalium. Algorithm 1 simulations for one experiment in the practical case 1: estimate the order m parameter π (and μ) from the original sequence. Although these parameters are estimated, they are considered as the true parameters; 2: compute S = -log10 ℙ(N ≥ Nobs); 3: compute σ using approximation (23) 4: for j = 1 ... 1 000 do 5: draw a random sequence Y = Y1 ... Yn according to and order m stationary Markov model of parameter π; 6: compute N the frequency vector of all size m and size m + 1 words in Y; 7: compute Sj = SN = -log10 ℙ(N ≥ Nobs); 8: end for 9: compute We can see on table 1 the results for E. coli. For each Markov model considered, our approximation of σ is very close to the empiric ones and, as with figure 1, the Gaussian distribution fit well to the empiric one (data not shown). Table 2 shows the same behaviour with M. genitalium except for m = 5 where and as ℙ(N1 (agctac) = 0) ≃ 2.26 × 10-6, ℙ(N1 (gctacg) = 0) ≃ 1.35 × 10-1 and ℙ(N1 (ctacgt) = 0) ≃ 1.24 × 10-4 we will have P(N) = 0 roughly 14% of the time. This happened 123 times in our sample of size 1 000, each time preventing to compute SN. The sample is hence biased and What happen now if we use another statistical method to compute the pattern statistics. As the binomial approximation is supposed to be close to the exact solution, we expect the standard deviation obtained with other statistical methods to remain close to σ. In table 3, we compare the empirical results using binomial approximations (like above) but also compound Poisson or large deviations approximations. Both empirical means and standard deviations are close to the theoretical ones thus validating the method. Table 3. Comparison of theoretical and empirical pattern statistics mean and deviation on Mycoplasma genitalium. Choice of a Markov model orderThrough the computation of σ we can measure the sensitivity of pattern statistics to parameter estimations. A very natural question is then, how this variability could affect a pattern statistic study, and, as this variability grows with the Markov model order, how to choose this parameter. We propose here to consider the case of a very simple pattern study: we want to find the 100 most over-represented octamers (DNA words of size 8) in a given genome. Assuming the true parameter π (and hence μ) is known, we can compute REF = {W1,..., W100}, the list of these words (ordered by decreasing statistics, so that the most over-represented one is the first one). For each estimates As in the section "practical case", we consider two genomes: Escherichia coli K12 (ℓ = n = 4639675) and Mycoplasma genitalium (ℓ = n = 580076). For each Markov model order m from 1 to 6, we estimate π on the sequence (by maximum of likelihood), compute the REF list and then draw a sample of Results are given in tables 4 and 5. We can see that, surprisingly, the TP rate could be very low even for long genome such as E. coli when high order Markov model (m = 6) are used. Of course, these rates are even worse on M. genitalium whose genome is ten times smaller than the first one. It is also clear that the RA rate is more affected by the variability induced by parameter estimation than the TP rate. Table 4. Mean true positive rate and rank accordance rate in Escherichia coli K12. Table 5. Mean true positive rate and rank accordance rate in Mycoplasma genitalium. Based on these results, we conclude that our pattern study requires a sample size per free parameter of at least a few thousands if we want reliable results. In our examples this has for consequence that the Markov order should not be greater than 4 (or 5 at the very most) for E. coli and 3 (or 4 at the very most) on M. genitalium without resulting in important errors. ConclusionThe delta-method allows us to approximate the distribution of It is clear that our approximation of σ using the delta-method relies one two major assumptions: 1) the distribution of N is Gaussian; 2) F+ is regular enough (e.g. not too steep) around E. When m grows, E closes to the boundary of the definition range of F+ hence degrading assumption 2. Moreover, it is well known that Gaussian approximations for word frequencies become weaker when the expected numbers of their occurrences become smaller, thus degrading assumption 1. It is therefore obvious that our approximation of σ will get less and less reliable as m grows. However, the approximation of σ has been validated through simulations and appears to be very reliable (even for m = 5 or 6). As pattern statistics computed through binomial approximations are close to the exact statistics [8], the value of σ should not differ a lot when another statistical method is used. We have compared our approximations to the empiric distribution obtained using compound Poisson and large deviations approximations and, as expected, our approximations remains quite reliable even for these statistical methods. The variability due to parameter estimation is of course related to the Markov model order m and to the size k of the alphabet (as we have km+1 parameters for this model) and to the length n of the sequence used for this estimation. For example, considering an order m = 6 model with n = 4639675 (Escherichia coli K12 complete genome) requires to estimate 3 × 46 = 4096 free parameters which results roughly in 400 observation per free parameter. Although this situation seems quite comfortable, we have seen with our simulations that it leads an unacceptable variability for pattern statistics. As literature often advices to use the highest possible Markov order for a given pattern problem (which means m = h - 2 for pattern of size h) it is easy to understand that such a practice could have very detrimental effects on the computed statistics unless huge data are available for estimation purpose. Even if we consider the more reasonable attitude to choose m using the classical framework of model selection (e.g. using the Akaike Information Criterion – AIC –) we get m = 5 for Mycoplasma genitalium and m = 6 for Escherichia coli K12 hence resulting in both cases in the same catastrophic results in terms of false positive and even worse ones in terms of ranking. Moreover, we assumed here that our model was homogeneous all along the considered sequences. This is obviously completely false when complete genomes are considered. So it is more likely that the sample size n would be far smaller than a million on classical pattern studies (even of human genomes for example). As a result, the variability we pointed out in this paper will have a considerable detrimental effect on most studies unless the Markov order is carefully set. In order to do so, we advice to compute our approximation of σ each time a pattern statistic is produced and then to evaluate, either by simulation (like in this paper) or by a theoretical work the impact of this variability on the considered study. Competing interestsThe author declares that he has no competing interests. Appendix AWe give here the expression of the covariance matrix C introduced in section "distribution of N = (N0, N1)". The sequence Y (of length n) is generated by an homogeneous, stationary and ergodic order m Markov model of parameter π and stationary distribution μ. We want to compute the covariance of the vector N of random frequencies of size m and m + 1 words. For any word w (of size hw), we introduce the following notation for hw ≤ i ≤ n where the probability to see one occurrence of w at a given position in the sequence. At last, if we consider another word v (of size hv = m) and if hw = m, we denote by the probability to see occurrences of v and w separated by a gap of length δ. For any words v an w (to simplify, we suppose that hv ≥ hw) then, for all δ ∈ max(hv, hw - δ) ≤ i ≤ min(n, n - δ) we have
which do not depend on i. It is therefore easy to show that where the main part (2n - hv - hw + 2 terms) is given by and the overlapping part (hv + hw - 1 terms) by and with As we have C(v, w) = M (v, w) + O (v, w) - E (v) E (w) (55) the problem is hence to compute M and O for all pairs of size m or m + 1 words. In order to simplify, we will just treat here the case of a pair of size m words (other cases can be derived from this special case). For the main part we obtain (2n - 2m + 2 terms). As Pk (v, w) quickly converges toward μ(w) when k grows (convergence speed is given by λk where λ is the magnitude of the second eigenvalue of the transition matrix Π). So there exists a rank r ≥ m such as which has only 2r - 2m + 1 terms. And for the overlapping part we get which has 2m + 1 terms. So the overall complexity for the computation of one term of C is hence O(r) where the value of r is directly connected to the magnitude λ of the second eigenvalue of the transition matrix. In the particular case of an order one Markov model (m = 1), we give here the complete expressions of M and O. For all a, b, c, d ∈ With the example given in section "validation" we get for the expectation and
The magnitude of the second eigenvalue of Π is λ = 0.3, then rank r = 19 give a relative error < 10 -10 and we get for the covariance and Appendix BThe beta function is defined by for all a, b > 0. The incomplete beta function for all x ∈ [0,1] is then defined by and Using a continued fraction representation, these functions can be quickly numerically evaluated in O( A great interest of this function is that it is connected to the cumulative distribution function of a binomial distribution by the following relation: with (n, k) ∈ ℕ* × ℕ, 0 ≤ k ≤ n and p ∈ [0,1]. Finally, let us remark that the incomplete beta function is differentiable in x and that Appendix CWe give here the complete expression of σ for a single pattern in the special case of an order m = 0 homogeneous Markov model of parameter μ. The MLE of μ is given by where N1 is the frequency of all letters. A Gaussian approximation gives with E1 = nμ and, for all a, b ∈ C1,1 (a, b) = nμ (a) We have also which implies for all a ∈ So finally we get where Q is either defined by equation (24) if the pattern is over-represented or by equation (28) if under-represented. References
Have something to say? Post a comment on this article! |





on Google Scholar








author email
corresponding author email

















































Figure 1.
Figure 2.




Figure 3.


































