3 Application 1: local score We propose in this part to apply our results to the computation of exact p-values for local score. We first recall the definition of the local score of one sequence (section 3.1) and design a FMCI allowing to compute p-value in the particular case of an integer and i.i.d. score (section 3.2). We explain in sections 3.5 and 3.6 how to relax these two restrictive assumptions to consider rational or Markovian scores. The main result of this part is given in section 3.4 where we propose an algorithm improving the simple application of the general ones by using a specific asymptotic behaviour presented in section 3.3. As numerical application, we propose finally in section 3.7 to find significant hydrophobic segments in the Swissprot database using the Kyte-Doolittle hydrophobic scale. Our exact results are compared to the classical Gumble asymptotic approximations and discussed both in terms of numerical performance and reliability. 3.1 Definition We consider S = S1,...,Sn a sequence of real scores and we define the local score Hn of this sequence by which is exactly the highest partial sum score of a subsequence of S. This local score can be computed in O(n) using the auxiliary process U0 = 0     and for 1 ≤ j ≤ n     = max{0, Uj-1 + Sj}     (10) because we then have Hn = maxj Uj. Assuming the sequence S is random (Bernoulli or Markov model), we want to compute p-values relative to the event En = {Hn ≥ a} where a > 0. 3.2 Integer score In order to simplify, we will first consider the case of integer scores (and hence a ∈ ≁) then we will extend the result to the case of rational scores. In the Bernoulli case, [12] introduced the FMCI Z defined by (resulting with a sequence of length n + 1) with 0 as the only starting state and a as the final absorbing state. The transition matrix ∏ is given by where p(i) = ℙ(S1 = i)     f(i) = ℙ(S1 ≤ i)     g(i) = ℙ(S1 ≥ i)     ∀i ∈ ℤ     (13) It is possible to apply to this case the general algorithm 1 with L = a + 1 and k = 1 (please note that we have added Z0 to the sequence and n must then be replaced by n + 1 in the algorithm to get correct computations) to compute the p-value we are looking for. In the worst case, R has ζ = a2 non zero terms and the resulting complexity is O(a2) in memory and O(n × a2) in times. But in most cases, S1 support is reduced to a small number of values and the complexities decrease accordingly. 3.3 Asymptotic development Is it possible to compute this p-value faster ? In the case where R admits a diagonal form, simple linear algebra could help to cut off the computations and answer yes to this question. Proposition 4. If R admits a diagonal form we have where []1 denotes the first component of a vector, with R∞ = limi→∞ Ri/λi, where 0 <λ < 1 is the largest eigenvalue of R and ν is the magnitude of the second largest eigenvalue. We also have v = [g(a),...,g(1)]'. Proof. By using the corollary 15 (appendix A) we know that Ri - λiR∞ = O(νi)     (15) uniformly in i so we finally get for all α uniformly for all n ≥ α and the proposition is then proved by considering the first component of equation (16).     □ Corollary 5. We have and Proof. Simply replace the terms in (17) and (18) with equation (14) to get the results.     □ 3.4 Algorithm The simplest way to compute ℙ(Hn ≥ a) is to use the algorithm 2 in our particular case. As the number of non zero terms in R is then a2, the resulting complexity is O(n × a2). Using the proposition 4, it possible to get the same result a bit faster on very long sequence by computing the first two largest eigenvalues magnitudes λ and ν (complexity in O(a2) with Arnoldi algorithms) and to use them to compute a p-value. As the absolute error is in O(να) we obtain a require ε error level using a α proportional to log(ε)/log(ν) which results in a final complexity in O(log(ε)/log(ν) × a2). Unfortunately, this last method requires to use delicate linear algebra techniques and is therefore more difficult to implement. Another better possibility is to use the corollary 5 to get the following fast and easy to implement algorithm: algorithm 3: local score p-value x a real column vector of size a, (pi)i≥1 and (λi)i≥3 to sequences of real and i an integer initialization x = [g(a),...,g(1)]', p1 = g(a), and i = 0 main loop while (i