Home | About | Journals | Submit | Contact Us | Français |

**|**Front Bioeng Biotechnol**|**v.4; 2016**|**PMC4896921

Formats

Article sections

- Abstract
- 1. Introduction
- 2. Main Results
- 3. Experiments and Analysis
- 4. Combinatorial and Analytic Derivation
- 5. Conclusion
- Author Contributions
- Conflict of Interest Statement
- References

Authors

Related links

Front Bioeng Biotechnol. 2016; 4: 35.

Published online 2016 June 8. doi: 10.3389/fbioe.2016.00035

PMCID: PMC4896921

Edited by: Marco Pellegrini, Consiglio Nazionale delle Ricerche, Italy

Reviewed by: Travis Gagie, University of Helsinki, Finland; Solon P. Pissis, King’s College London, UK

*Correspondence: Mireille Régnier, Email: rf.airni@reinger.ellierim

Specialty section: This article was submitted to Bioinformatics and Computational Biology, a section of the journal Frontiers in Bioengineering and Biotechnology

Received 2015 December 3; Accepted 2016 April 8.

Copyright © 2016 Régnier and Chassignet.

This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY). The use, distribution or reproduction in other forums is permitted, provided the original author(s) or licensor are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.

Repetitive patterns in genomic sequences have a great biological significance and also algorithmic implications. Analytic combinatorics allow to derive formula for the expected length of repetitions in a random sequence. Asymptotic results, which generalize previous works on a binary alphabet, are easily computable. Simulations on random sequences show their accuracy. As an application, the sample case of Archaea genomes illustrates how biological sequences may differ from random sequences.

This paper provides combinatorial tools to distinguish biologically significant events from random repetitions in sequences. This is a key issue in several genomic problems as many repetitive structures can be found in genomes. One may cite microsatellites, retrotransposons, DNA transposons, long terminal repeats (LTR), long interspersed nuclear elements (LINE), ribosomal DNA, and short interspersed nuclear elements (SINE). In Treangen and Salzberg (2012), it is claimed that half of the genome consists of different types of repeats. Knowledge about the length of a maximal repeat is a key issue for assembly, notably the design of algorithms that rely upon de Bruijn graphs. In re-sequencing, it is a common assumption for aligners that any sequenced “read” should map to a single position in a genome: in the ideal case where no sequencing error occurs, this implies that the length of the reads is larger than the length of the maximal repetition. Average lengths of the repeats are given in Gu et al. (2000). Recently, heuristics have been proposed and implemented (Devillers and Schbath, 2012; Rizk et al., 2013; Chikhi and Medvedev, 2014).

A similar problem has been extensively studied: the prediction of the length of maximal common prefixes for words in a random set. Typical parameters are the background probability model, the size *V* of the alphabet, the length *n* of the sequence, and so on. Deviation from uniformity was studied for a uniform model as early as 1988 (Flajolet et al., 1988). A complexity index that captures the richness of the language is addressed in Janson et al. (2004). A distribution model, valid for binary alphabets and biased distributions, was introduced in Park et al. (2009), the so-called *trie profile* and extended to Patricia tries in Magner et al. (2014). The authors pointed out different “regimes” of randomness and a phase transition, by means of analytic combinatorics (Sedgewick and Flajolet, 2009). It was observed in Jacquet and Szpankowski (1994) that the average length of maximal common prefixes in a random set of *n* words is asymptotically equivalent to the average length of maximal repetitions in a random sequence of length *n*. Sets of words are considered below in the theoretical analysis. A comparison with the distribution of maximal repetitions in random sequences or real Archaea genomic sequences is presented in Section 3.

Our first goal is to extend results of Park et al. (2009) to the case of a general *V*-alphabet, including the special case {*A*, *C*, *G*, *T*} where *V* is 4. A second goal is to compare the results consistency with random data and real genomic data in the finite range.

To achieve the first goal, we rely on an alternative, and simpler, probabilistic and combinatorial approach that is interesting *per se*. It avoids generating functions and the Poissonization–dePoissonization cycle that is used in Park et al. (2009) and it extends to non-binary alphabets. In that case, there is no closed formula for the asymptotic behavior. Nevertheless, the Lagrange multipliers allow to derive it as the solution of an equation that can be computed numerically.

Explicit and computable bounds for the profile of a random set of *n* words are provided. Three domains can be observed. A first domain is defined by a threshold *k* for the length, called the *completion length*: any prefix with a length smaller than this threshold occurs at least twice. This threshold is extremely stable over the data sets and it is highly predictable. A similar phenomenon was observed for a uniform model in Fagin et al. (1979a) and a biased model (Mahmoud, 1992; Park et al., 2009). For larger lengths, some prefixes occur only once. In a second domain, called the *transition phase*, the number of maximal common prefixes is sublinear in the size *n* of the sequence: increasing first, then decreasing slowly, and, finally, dropping rapidly. In the third domain, for a length larger than some *extinction length*, almost no common prefix of that length occurs. Despite the fact that these bounds are asymptotic, a good convergence is shown in practice for random texts when a second-order term is known.

Differences between the model and the observation are studied on the special case of Archaea genomes. A dependency to the GC-content, which is a characteristic of each genome, is exhibited. Regimes and transitions are studied on these genomic data and theoretical results are confirmed, with a drift in the values of transition thresholds. Notably, the length of the largest repetitions is much larger than expected. This difference between the model and the observation arises from the occurrences of long repeated regions.

Section 2 is devoted to Main Results, to be proved in Section 4. First, some notations are introduced; then, an algebraic expression for the expectation of the number of maximal common prefixes in a sequence is derived in Theorem 2.1. Second, this expression is split between two sums that are computable in practical ranges. Then, it is shown that a Large Deviation principle applies. It yields first and second order asymptotic terms, and oscillations, that are provided in Theorem 2.2. A comparison between exact, approximate, and asymptotic expressions is presented in Section 3.

It is assumed throughout this study that sequences and words are randomly generated according to a biased Bernoulli model on an alphabet of size *V*. Let *p*_{1}, , *p _{V}* denote the probabilities of the

**Definition 2.1**. For any *i* in {1,,*V* }, one notes

$${\beta}_{i}=\mathrm{log}\frac{1}{{p}_{i}}.$$

Additionally,

$$\begin{array}{l}\hfill {p}_{\mathit{min}}=\mathrm{min}\left\{{p}_{i};1\le i\le V\right\}\phantom{\rule{0.3em}{0ex}}\text{and}\phantom{\rule{0.3em}{0ex}}{\alpha}_{\mathit{min}}=\frac{1}{\mathrm{log}\frac{1}{{p}_{\mathit{min}}}}=\frac{1}{\mathrm{max}\left({\beta}_{i}\right)};\end{array}$$

(1)

$$\begin{array}{l}\hfill {p}_{\mathit{max}}=\mathrm{max}\left\{{p}_{i};1\le i\le V\right\}\phantom{\rule{0.3em}{0ex}}\text{and}\phantom{\rule{0.3em}{0ex}}{\alpha}_{\mathit{max}}=\frac{1}{\mathrm{log}\frac{1}{{p}_{\mathit{max}}}}=\frac{1}{\mathrm{min}\left({\beta}_{i}\right)}.\end{array}$$

(2)

The two values min(*β _{i}*) and max(

**Definition 2.2**. Given *U* a set of words and an integer *k*, *k*≥2, a unique *k*-mer in *U* is a word *wχ _{i}* of length

*w*is a prefix of at least two words in*U*;- and
*wχ*is a prefix of a single word._{i}

By convention, a unique 1-mer is a character χ* _{i}* that is a prefix of a single word.

**Definition 2.3**. Let *U* be a set of *n* words.

For *k*≥1, one denotes *B*(*n, k*) the number of unique *k*-mers in *U*.

One denotes *μ*(*n*, *k*−1) the expectation of *B*(*n, k*) over all sets of *n* words.

**Remark**: It follows from Definition 2.2 that quantity *B*(*n, k*) is upper bounded by *n*. Observe that, for each random set *U*, it is the sum of a large number – *V ^{k}* – of correlated random variables. Expectation

Profiles of repetitions can be expressed as a combinatorial sum.

**Theorem 2.1**. Given a length *k*, the expectation *μ*(*n, k*) satisfies:

$$\begin{array}{ll}\hfill \mu \left(n,k\right)=n{\displaystyle \sum _{{k}_{1}+\cdots {k}_{v}=k}}\left(\begin{array}{c}k\\ {k}_{1},\cdots \text{\hspace{0.17em}},{k}_{V}\end{array}\right)\varphi \left({k}_{1},\cdots \text{\hspace{0.17em}},{k}_{V}\right){\psi}_{n}\left({k}_{1},\cdots \text{\hspace{0.17em}},{k}_{V}\right)& \end{array}$$

(3)

where

$$\begin{array}{l}\hfill \varphi \left({k}_{1},\cdots \text{\hspace{0.17em}},{k}_{V}\right)={p}_{1}^{{k}_{1}}\cdots {p}_{V}^{{k}_{V}}\end{array}$$

(4)

$$\begin{array}{l}\hfill {\psi}_{n}\left({k}_{1},\cdots \text{\hspace{0.17em}},{k}_{V}\right)={\displaystyle \sum _{i=1}^{V}}\text{\hspace{0.17em}}{p}_{i}\left[{\left(1-\phi \left({k}_{1},\cdots ,{k}_{V}\right){p}_{i}\right)}^{n-1}-{\left(1-\phi \left({k}_{i},\cdots ,{k}_{V}\right)\right)}^{n-1}\right].\end{array}$$

(5)

**Proof**. A word *wχ _{i}* is a unique (

Event (i) has probability

$$\begin{array}{l}n\varphi \left({k}_{1},\cdots \text{\hspace{0.17em}},{k}_{V}\right){p}_{i}\left[1-{\left(1-\varphi \left({k}_{1},\text{\hspace{0.17em}}\cdots \text{\hspace{0.17em}},{k}_{V}\right)\right)}^{n-1}\right].\end{array}$$Event (ii), which is a sub-event of (i), has probability

$$\begin{array}{l}\hfill n\varphi \left({k}_{1},\text{\hspace{0.17em}}\cdots \text{\hspace{0.17em}},{k}_{V}\right){p}_{i}\left[1-{\left(1-\varphi \left({k}_{1},\text{\hspace{0.17em}}\cdots \text{\hspace{0.17em}},{k}_{V}\right){p}_{i}\right)}^{n-1}\right].\end{array}$$

**Definition 2.4**. Given a *k*-mer *w*, let *α* denote $\frac{k}{\mathrm{log}\text{\hspace{0.17em}}n}$ and *k _{i}* denote the number of occurrences of character χ

$$\rho \left({k}_{1},\cdots \text{\hspace{0.17em}},{k}_{V}\right)={\displaystyle \sum _{i=1}^{V}}\text{\hspace{0.17em}}\frac{{k}_{i}}{k}{\beta}_{i}-\frac{1}{\alpha}.$$

(6)

The character distribution (*k*_{1},, *k _{V}*) of a

**Definition 2.5**. A *k*-mer *w* is said

- a common
*k*-mer if*ρ*(*k*_{1},…,*k*)<0;_{V} - a transition
*k*-mer if*ρ*(*k*_{1},,*k*)≥0 and its ancestor is a common_{V}*k*-mer; - a rare
*k*-mer, otherwise.

**Remark**: If *ρ*(*k*_{1},, *k _{V}*)=0, the condition on the ancestor is trivially satisfied.

**Definition 2.6**. Given a set *U* of *n* words and an integer *k*, let *D _{k}(n)* denote the set of character distributions (

The set *D _{k}*(

**Notation**: Let *S*(*k*) and *T*(*k*) be

$$\begin{array}{l}\hfill S\left(k\right)=n{\displaystyle \sum _{{D}_{k}(n)}}\text{\hspace{0.17em}}\left(\begin{array}{c}k\\ {k}_{1}\cdots {k}_{V}\end{array}\right)\varphi \left({k}_{1},\cdots \text{\hspace{0.17em}},{k}_{V}\right){\psi}_{n}\left({k}_{1},\cdots \text{\hspace{0.17em}},{k}_{V}\right);\end{array}$$

(7)

$$\begin{array}{l}\hfill T\left(k\right)=n{\displaystyle \sum _{{E}_{k}(n)}}\text{\hspace{0.17em}}\left(\begin{array}{c}k\\ {k}_{1}\cdots {k}_{V}\end{array}\right)\varphi \left({k}_{1},\cdots \text{\hspace{0.17em}},{k}_{V}\right){\psi}_{n}\left({k}_{1},\cdots \text{\hspace{0.17em}},{k}_{V}\right).\end{array}$$

(8)

So *μ*(*n, k*) rewrites

$$\mu \left(n,k\right)=S\left(k\right)+T\left(k\right).$$

(9)

These sums *S*(*k*) and *T*(*k*) can be efficiently computed for moderate *k*, up to a few hundred, approximately. In practice, *α _{max}* log

In this section, asymptotic estimates for (3) are derived. First, some characteristic functions are introduced. Then, it is observed that a Large Deviation Principle applies for the combinatorial sums to be computed and asymptotics for the dominating term follow. Amortized terms are also computed. It is shown in Section 3 that this second-order term cannot be neglected in the finite range.

For general alphabets, asymptotic behavior is a function of the solution of an equation and depends on domains whose bounds are defined below.

**Definition 2.7**. Let (*p _{i}*)

The *fundamental ratio*, noted $\tilde{\alpha}$, is ${\left({\sum}_{i}\text{\hspace{0.17em}}{p}_{i}\mathrm{log}\frac{1}{{p}_{i}}\right)}^{-1}$.

The *transition ratio*, noted $\overline{\alpha}$, is ${\sigma}_{2}{\left({\sum}_{i}\text{\hspace{0.17em}}{p}_{i}^{2}\mathrm{log}\frac{1}{{p}_{i}}\right)}^{-1}$.

The *extinction ratio*, noted *α _{ext}*, is $\frac{2}{\mathrm{log}\frac{1}{{\sigma}_{2}}}$.

**Definition 2.8**. Let *α* be a real value in [*α _{min}*,

$$\frac{1}{\alpha}=\frac{{\sum}_{i=1}^{V}\text{\hspace{0.17em}}{\beta}_{i}{e}^{-{\beta}_{i}\tau}}{{\sum}_{i=1}^{V}\text{\hspace{0.17em}}{e}^{-{\beta}_{i}\tau}}$$

(10)

Let *ψ* be the function defined in [*α _{min}*,

$$\begin{array}{llll}\hfill {\alpha}_{\mathrm{min}}\le \alpha \le \overline{\alpha}& :\psi \left(\alpha \right)={\tau}_{\alpha}+\alpha \mathrm{log}\left(\mathrm{\sum}_{i=1}^{V}\text{\hspace{0.17em}}{e}^{-{\beta}_{i}{\tau}_{\alpha}}\right);\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill \overline{\alpha}\le \alpha & :\psi \left(\alpha \right)=2-\alpha \mathrm{log}\frac{1}{{\sigma}_{2}}.\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$$

**Proposition 2.1**. The following property holds

$${\alpha}_{\mathrm{min}}\le \tilde{\alpha}\le \overline{\alpha}\le {\alpha}_{\mathrm{max}}\le {\alpha}_{\text{ext}}.$$

Function *ψ* increases on $\left[{\alpha}_{\mathit{min}},\tilde{\alpha}\right]$ and decreases on $\left[\tilde{\alpha},\infty \right]$. It satisfies

$$\psi \left({\alpha}_{\mathrm{min}}\right)=\psi \left({\alpha}_{\text{ext}}\right)=0\phantom{\rule{0.1em}{0ex}}\text{and}\phantom{\rule{0.1em}{0ex}}\psi \left(\tilde{\alpha}\right)=1.$$

(11)

**Remark**: Uniqueness of *τ _{α}* is shown in Section 4.2. As ${\tau}_{\overline{\alpha}}=2$,

**Theorem 2.2**. Given a length *α* log *n*, when *n* tends to ∞ the ratio $\frac{\mathrm{log}\text{\hspace{0.17em}}\mu \left(n,\text{\hspace{0.17em}}\alpha \text{\hspace{0.17em}}\mathrm{log}\text{\hspace{0.17em}}n\right)}{\mathrm{log}\text{\hspace{0.17em}}n}$ satisfies:

$$\begin{array}{l}\hfill 0\le \alpha \le {\alpha}_{\mathit{min}}\phantom{\rule{0.3em}{0ex}}\text{or}\phantom{\rule{0.3em}{0ex}}{\alpha}_{\mathit{ext}}\le \alpha \text{\hspace{0.17em}}:\frac{\mathrm{log}\text{\hspace{0.17em}}\mu \left(n,\alpha \mathrm{log}\text{\hspace{0.17em}}n\right)}{\mathrm{log}\text{\hspace{0.17em}}n}\le 0;\end{array}$$

(12)

$$\begin{array}{l}\hfill {\alpha}_{\mathit{min}}\le \alpha \le {\alpha}_{\mathit{ext}}\text{\hspace{0.17em}}:\frac{\mathrm{log}\text{\hspace{0.17em}}\mu \left(n,\alpha \mathrm{log}\text{\hspace{0.17em}}n\right)}{\mathrm{log}\text{\hspace{0.17em}}n}\sim \psi \left(\alpha \right).\end{array}$$

(13)

Moreover, let *ξ* be the function defined in [*α _{min}*,

$$\begin{array}{l}\hfill {\alpha}_{\mathit{min}}\le \alpha \le \overline{\alpha}:\mathrm{\xi}\left(\alpha \right)\text{\hspace{0.17em}}\sim -\frac{V-1}{2}\frac{\mathrm{log}\left(\alpha \mathrm{log}\text{\hspace{0.17em}}n\right)}{\mathrm{log}\text{\hspace{0.17em}}n};\end{array}$$

(14)

$$\begin{array}{l}\hfill \overline{\alpha}\le \alpha \le {\alpha}_{\mathit{ext}}:\mathrm{\xi}\left(\alpha \right)\text{\hspace{0.17em}}\sim \frac{\mathrm{log}\left(1-{\sigma}_{2}\right)}{\mathrm{log}\text{\hspace{0.17em}}n}.\end{array}$$

(15)

**Proof**. The key to the proof when *α* ranges in [*α _{min}*,

$$\frac{\mathrm{log}\text{\hspace{0.17em}}T\left(\tilde{k}\right)}{k}\sim \mathrm{max}\left\{-\mathrm{\sum}_{i=1}^{V}\text{\hspace{0.17em}}\frac{{k}_{i}}{k}\mathrm{log}\frac{{k}_{i}}{k};\rho \left({k}_{1},\cdots \text{\hspace{0.17em}},{k}_{V}\right)=0\right\}.$$

(16)

The maximization problem rewrites as

$$\mathrm{max}\left\{\mathrm{\sum}_{i=1}^{V}\text{\hspace{0.17em}}{\theta}_{i}\mathrm{log}\frac{1}{{\theta}_{i}};\mathrm{\sum}_{i=1}^{V}\text{\hspace{0.17em}}{\theta}_{i}=1;\mathrm{\sum}_{i=1}^{V}\text{\hspace{0.17em}}{\beta}_{i}{\theta}_{i}=\frac{1}{\alpha};0\le {\theta}_{i}\le 1\right\}$$

(17)

The maximum value is ${\tau}_{\alpha}+\alpha \mathrm{log}\left({\mathrm{\sum}}_{i=1}^{V}\text{\hspace{0.17em}}{e}^{-{\beta}_{i}{\tau}_{\alpha}}\right)$ that is reached for the *V*-tuple ${\left({\theta}_{i}=\frac{{e}^{-{\beta}_{i}{\tau}_{\alpha}}}{{\sum}_{i=1}^{V}\text{\hspace{0.17em}}{e}^{-{\beta}_{i}{\tau}_{\alpha}}}\right)}_{1\le i\le V}$.

*S*(*k*) satisfies again a Large Deviation Principle when *α* < $\overline{\alpha}$, which yields the asymptotic result in this range. For larger *α*, *S*(*k*) is approximately $\left(1-{\sigma}_{2}\right){n}^{1-\alpha \mathrm{log}\frac{1}{{\sigma}_{2}}}$ that dominates *T*(*k*).

Details for the proof, including the short and long lengths, are provided in Section 4.

**Remark**: The discussion will depend of the ratio $\alpha =\frac{k}{\mathrm{log}\text{\hspace{0.17em}}n}$. Possible values for *α* range over a *discrete* set as they are constrained to be the ratio of an integer by the log of an integer. An interesting property is that, for any real *α*, the set *T*={*n* *N*; *α* log *n* *N*} is either empty or infinite. Indeed, when *T* is non-empty, it contains all values *n*(α)* ^{p}* where

Different domains arise from this Theorem, which were observed in Park et al. (2009). Equalities *ψ*(*α _{min}*)=0 and $\psi \left(\overline{\alpha}\right)=2-\overline{\alpha}\mathit{log}\frac{1}{{\sigma}_{2}}$ show that there is a continuity between domains.

When *α* lies inside the domain [*α _{min}*,

When the length is smaller than the *completion length α_{min}* log

Parameters (*k*_{1},, *k _{V}*) in the combinatorial sums are integers. As the optimum values (

Results for binary alphabets in Park et al. (2009) steadily follow from Theorem 2.2. A rewriting of *ψ* leads to alternative expression (18). This *explicit* expression points out the dependency to the distances to *α _{min}* and

**Corollary 2.1**. Assume that the alphabet is binary. Then

$$\psi \left(\alpha \right)=\frac{\alpha}{\mathrm{log}\frac{{p}_{\mathit{max}}}{{p}_{\mathit{min}}}}\mathrm{log}\left[{{s}_{\alpha}}^{\frac{1}{\alpha}-\frac{1}{{\alpha}_{\mathit{min}}}}+{{s}_{\alpha}}^{\frac{1}{\alpha}-\frac{1}{{\alpha}_{\mathit{max}}}}\right]$$

(18)

where

$${s}_{\alpha}=\frac{{\alpha}_{\mathit{min}}}{{\alpha}_{\mathit{max}}}\cdot \frac{\alpha -{\alpha}_{\mathit{min}}}{{\alpha}_{\mathit{max}}-\alpha}.$$

(19)

A similar result holds for DNA sequences when the alphabet is 4-ary and the probability distribution satisfies *p _{A}*=

The main contribution to *μ*(*n, k*) arises from *k*-mers with an objective function close to 0, i.e., transition *k*-mers. Such *k*-mers exist in the *transition phase* [*α _{min}* log

Let *k* be some integer in the transition phase. First, the relative contribution of *S*(*k*) and *T*(*k*) to *μ*(*n, k*) varies with the length *k*. For lengths close to *α _{min}* log

Second, the dominating term in *μ*(*n, k*) arises from transition *k*-mers. Let *w* be a word of length *k*, the character distribution in *w* be (*k*_{1},, *k _{V}*) and

For a short length, i.e., *k* smaller than the completion length *k _{min}*, all words are common. In a given sequence, most

For a large length *k*, i.e., *k* greater than *k _{max}*, all words are rare. Nevertheless the number of unique

A folk theorem (Szpankowski, 2001; Jacquet and Szpankowski, 2015) claims that the objective function is concentrated around $\frac{1}{\tilde{\alpha}}-\frac{1}{\alpha}$. Consequently, when *α* = $\tilde{\alpha}$, most *k*-mers are transition *k*-mers and the exponent, the *ψ* function, is maximal.

Simulations are presented for random and real data. For each simulation, a suffix tree (Ukkonen, 1995) is built, where each leaf represents a unique *k*-mer. For random cases, the Ukkonen’s insertion step is iterated until a tree with exactly *n* leaves is build. This requires *n*+*k _{ins}* insertions of symbols, where

Even if a statistical bias exists, with respect to the case of a set of N random words analyzed in previous sections, this bias for respective values on *k* and *n* is below the numeric precision used for tables below.

Then, one simulation that is related to the case of a set of *n* random words, requires the generation of the order of N random symbols from a small alphabet, following a Bernoulli scheme. For this range of *n*, and even in the case of a hundred consecutive simulations, this corresponds to a regular use of a common random number generator (Knuth, 1998).

A first set of simulation deals with the case of random sequences over a binary alphabet, since the results can be compared with previous work. A second set addresses the case of random sequences over a quaternary alphabet {*A*, *C*, *G*, *T*} with a constrained distribution such that probabilities *p _{A}* ≈

An implementation with a suffix array (Manber and Myers, 1993) allows for a compact representation and an efficient counting (Beller et al., 2013).

A hundred binary sequences were randomly generated. The number of leaves in each tree was fixed to *n*=5000000 and the Bernoulli parameter was *p _{ma}*

Throughout experiments, every sample profile for a given sequence fluctuates very little around the expectation.

Table Table11 provides experimental results averaged over a hundred binary sequences. Short length with no observed unique *k*-mer is removed. Column 2 gives the mean of *B*(*k*+1), i.e., the mean number of observed leaves at depth *k*+1, over the set of a hundred simulations. Columns 3 to 5 give the computed values for *S*(*k*), *T*(*k*), and *μ*(*k*), using the expressions, equations (7–9).

The actual number of leaves *B*(*n*, *k*+1) is very close to the average value *μ*(*n, k*), and simulations show that this is the general case when (only) a hundred simulations are performed: *μ*(*n, k*) is a very good prediction.

Observed lengths of extinction also show very little variations. In array below, each column gives *n** _{k}*, the number of sequences out of the one hundred sample set for which the longest repetition had length

**Distribution of the extinction level for 100 random binary sequences. p_{max} is 0.7**.

In the binary case, the predicted extinction length is between 56 and 57. It is noticeable that, in most cases, the observed depth is slightly smaller than this value. In Table Table1,1, value 0.04 for *μ*(*n*, 61) means that one expects a total of four leaves at depth 60 over one hundred sequences. In that run, exists a total amount of 8.

*Tightness of the asymptotic estimates*. Asymptotic estimates (13) given in Column 7 significantly*overestimate*the observed values in Column 6 that is computed directly from Column 2 and*n*. A first conclusion is that first-order asymptotics provide a*poor prediction*: next term is*O*$\left(\frac{1}{\mathrm{log}\text{\hspace{0.17em}}n}\right)$ that goes slowly to 0.*Tightness of the second-order asymptotics*. Second term for the asymptotic*ξ*(*α*) ensures a much better approximation in Column 8.*Growth of asymptotic estimates*. Observed values increase with length until $k=\tilde{k}$ and then decrease. This is consistent with the variation of asymptotic values*ψ*(α).

Thresholds were computed for a given sequence length *n* and various probabilities. The more *p _{ma}*

**Dependency of thresholds to p_{max} for binary alphabets, n=5,000,000**.

The experimental data set is the sequence from *Haloferax volcanii DS2 chromosome, complete genome* (Hartman et al., 2010). The alphabet is quaternary. Profile results are shown in Table Table22.

Sequence length is *n*=2847757. The observed symbol frequencies are *p** _{A}*=0.1655;

Statistics on one hundred random sequences with same parameters are shown in Table Table3.3. GC-content is 0.6664. Extinction level is provided in Table Table4.4. Observe first a good match between the observed values, the predicted values for *μ*(*n, k*), and the asymptotic values for random data. As shown for binary alphabets, the observed extinction level for random sequences departs very little from the predicted *k _{ext}* level.

Numerous differences with random data can be observed on real genomes.

Interestingly, the behavior for short lengths and in the transition phase is similar to the random behavior. Observation and prediction have the same order of magnitude. In particular, the number of unique *k*-mers is maximum for length $\tilde{k}$ where observation and prediction coincide. For a real genome and a length *k* smaller than *k _{min}*, observed

The effect of (non-random) repetitions is more sensible in the decreasing domain. First, the number of unique *k*-mers decreases much more slowly than expected for lengths larger than *k _{max}*. A significant gap can be observed around extinction level

To evaluate the contribution of long repetitions, one may erase the longest ones. When a word *w* is repeated, any proper suffix of *w* is also repeated. Consequently, once the longest repeated word is erased, one unique *k*-mer (only) disappears for each length larger than the length of the second largest subsequence (here, 935). The profile remains far from the random profile. This observation is still true if the 10 longest subsequences are erased.

Lagrange multipliers method allows to maximize an expression under constraints. To compute (17), one sets

$$\begin{array}{l}\hfill F\text{\hspace{0.17em}}={\displaystyle \sum _{i=1}^{V}}\text{\hspace{0.17em}}{\theta}_{i}\text{\hspace{0.17em}}\mathrm{log}\text{\hspace{0.17em}}{\theta}_{i};\end{array}$$

(20)

$$\begin{array}{l}\hfill G={\displaystyle \sum _{i=1}^{V}}\text{\hspace{0.17em}}{\theta}_{i};\end{array}$$

(21)

$$\begin{array}{l}\hfill H={\displaystyle \sum _{i=1}^{V}}\text{\hspace{0.17em}}{\theta}_{i}{\beta}_{i}.\end{array}$$

(22)

Two constraints are given:

$$G=1\phantom{\rule{0.3em}{0ex}}\text{and}\phantom{\rule{0.3em}{0ex}}H=\frac{1}{\alpha}.$$

An intermediary function *ϕ _{α}*(

$${\varphi}_{\alpha}=F+{\mathrm{\lambda}}_{\alpha}G+{\tau}_{\alpha}H$$

(23)

In order to maximize *ϕ* under these two constraints, *ϕ* function is derived with respect to each random variable *τ _{i}*. This yields

$$1+\mathrm{log}{\theta}_{i}+{\mathrm{\lambda}}_{\alpha}+{\tau}_{\alpha}{\beta}_{i}=0.$$

(24)

Two indices *i _{min}* and

$$\begin{array}{lll}\hfill {\beta}_{{i}_{\mathit{min}}}=\mathrm{min}{\left({\beta}_{i}\right)}_{1\le i\le V}=\mathrm{log}\frac{1}{{p}_{\mathit{max}}};\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill {\beta}_{{i}_{\mathit{max}}}=\mathrm{max}{\left({\beta}_{i}\right)}_{1\le i\le V}=\mathrm{log}\frac{1}{{p}_{\mathit{min}}}.\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$$

Solving equation (24) with indices *i _{min}* and

$$\begin{array}{llll}\hfill {\tau}_{\alpha}& =\frac{\mathrm{log}{\theta}_{{i}_{\mathit{min}}}-\mathrm{log}{\theta}_{{i}_{\mathit{max}}}}{{\beta}_{{i}_{\mathit{max}}}-{\beta}_{{i}_{\mathit{min}}}}=\mathrm{log}{\frac{{\theta}_{{i}_{\mathit{min}}}}{{\theta}_{{i}_{\mathit{max}}}}}^{\frac{1}{{\beta}_{{i}_{\mathit{max}}}-{\beta}_{{i}_{\mathit{min}}}}};\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill 1+{\mathrm{\lambda}}_{\alpha}& =\frac{{\beta}_{{i}_{\mathit{min}}}\mathrm{log}{\theta}_{{i}_{\mathit{max}}}-{\beta}_{{i}_{\mathit{max}}}\mathrm{log}{\theta}_{{i}_{\mathit{min}}}}{{\beta}_{{i}_{\mathit{max}}}-{\beta}_{{i}_{\mathit{min}}}}.\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$$

Remaining equations rewrite:

$$\mathrm{log}{\theta}_{i}=\mathrm{log}{\theta}_{{i}_{\mathit{min}}}+{\tau}_{\alpha}\left({\beta}_{{i}_{\mathit{min}}}-{\beta}_{i}\right).$$

(25)

Using the constraint ${\sum}_{i=1}^{V}\text{\hspace{0.17em}}{\theta}_{i}=1$ that yields

$${\theta}_{{i}_{\mathit{min}}}{e}^{{\beta}_{{i}_{\mathit{min}}}{\tau}_{\alpha}}{\displaystyle \sum _{i=1}^{V}}\text{\hspace{0.17em}}{e}^{-{\beta}_{i}{\tau}_{\alpha}}=1,$$

and an expression for ${\theta}_{{i}_{\mathit{min}}}$ follows. Therefore Equation 25 rewrites:

$${\theta}_{i}=\frac{{e}^{-{\beta}_{i}{\tau}_{\alpha}}}{{\sum}_{i=1}^{V}\text{\hspace{0.17em}}{\beta}_{i}{e}^{-{\beta}_{i}{\tau}_{\alpha}}}.$$

(26)

Finally, Equation ${\sum}_{i=1}^{V}\text{\hspace{0.17em}}{\theta}_{i}{\beta}_{i}=\frac{1}{\alpha}$ yields equation (10).

$$\frac{1}{\alpha}=\frac{{\sum}_{i=1}^{V}\text{\hspace{0.17em}}{\beta}_{i}{e}^{-{\beta}_{i}{\tau}_{\alpha}}}{{\sum}_{i=1}^{V}\text{\hspace{0.17em}}{e}^{-{\beta}_{i}{\tau}_{\alpha}}}.$$

For this *V*-tuple

$$\begin{array}{l}\hfill {\displaystyle \sum _{i=1}^{V}}{\theta}_{i}\mathrm{log}{\theta}_{i}=-\left({\displaystyle \sum _{i=1}^{V}}\text{\hspace{0.17em}}{\theta}_{i}{\beta}_{i}\right){\tau}_{\alpha}-\left({\displaystyle \sum _{i=1}^{V}}{\theta}_{i}\right)\mathrm{log}\phantom{\rule{0.3em}{0ex}}\left({\displaystyle \sum _{i=1}^{V}}\text{\hspace{0.17em}}{e}^{-{\beta}_{i}{\tau}_{\alpha}}\right)=-\frac{{\tau}_{\alpha}}{\alpha}-\mathrm{log}\left({\displaystyle \sum _{i=1}^{V}}{e}^{-{\beta}_{i}{\tau}_{\alpha}}\right).\end{array}$$

Derivating the RHS of (10) yields $\frac{{\sum}_{i\ne j}\text{\hspace{0.17em}}{\left({\beta}_{i}+{\beta}_{j}\right)}^{2}{e}^{-\left({\beta}_{i}+{\beta}_{j}\right)\tau}}{{\left({\sum}_{i}\text{\hspace{0.17em}}{e}^{-{\beta}_{i}\tau}\right)}^{2}}$ that is positive. Therefore, for any *α*, the solution to (10) is unique. Moreover, *τ _{α}* increases with

$$\begin{array}{ll}\hfill {\psi}_{1}\left(\alpha \right)& ={\tau}_{\alpha}+\alpha \mathrm{log}\left(\mathrm{\sum}_{i=1}^{V}\text{\hspace{0.17em}}{e}^{-{\beta}_{i}{\tau}_{\alpha}}\right);\end{array}$$

(27)

$$\begin{array}{lll}\hfill & \phantom{\rule{2em}{0ex}}& \hfill \\ \hfill {\psi}_{2}\left(\alpha \right)& =2-\alpha \mathrm{log}\frac{1}{{\sigma}_{2}}.\end{array}$$

(28)

Notably, the solutions *τ _{α}* of (10) associated with the four increasing values of

Derivating both expressions yields

$$\begin{array}{ll}\hfill \frac{\partial {\psi}_{1}}{\partial \alpha}\left(\alpha \right)& =\mathrm{log}\left(\mathrm{\sum}_{i=1}^{V}\text{\hspace{0.17em}}{e}^{-{\beta}_{i}{\tau}_{\alpha}}\right);\end{array}$$

(29)

$$\begin{array}{ll}\hfill \frac{\partial {\psi}_{1}}{\partial \alpha}\left(\alpha \right)-\frac{\partial {\psi}_{2}}{\partial \alpha}\left(\alpha \right)& =\mathrm{log}\left(\frac{1}{{\sigma}_{2}}\mathrm{\sum}_{i=1}^{V}\text{\hspace{0.17em}}{e}^{-{\beta}_{i}{\tau}_{\alpha}}\right).\end{array}$$

(30)

Both derivatives are monotone functions of *τ _{α}*. In equation (30), derivative is 0 when $\alpha =\overline{\alpha}$. Therefore,

Assume that *k*≤*α _{min}* log

For a length *k* in the transition domain [*α _{min}* log

The maximum *M* among the terms ${e}^{k\left(-{\sum}_{i}\text{\hspace{0.17em}}\frac{{k}_{i}}{k}\mathrm{log}\frac{{k}_{i}}{k}-\frac{1}{k}\mathrm{log}\text{\hspace{0.17em}}n\varphi \left({k}_{1},\cdots \text{\hspace{0.17em}},{k}_{V}\right)\right)}$ in *T*(*k*) is reached when *ρ*(*k*_{1}, , *k _{V}*) is 0. Due to the exponential decrease of ${e}^{-n\varphi \left({k}_{1},\cdots \text{\hspace{0.17em}},{k}_{V}\right)}$ when

Computation of *S*(*k*) relies on the local development of *ψ _{n}*(

When *α* > $\tilde{\alpha}$, sum S˜(k) rewrites $1-\overline{S}\left(k\right)$ where

$$\overline{S}\left(k\right)={\displaystyle \sum _{\rho \left({k}_{1},\cdots \text{\hspace{0.17em}},\text{\hspace{0.17em}}{k}_{V}\right)+\frac{1}{\alpha}<\frac{1}{\tilde{\alpha}}}}\text{\hspace{0.17em}}\left(\begin{array}{c}k\\ {k}_{i}\end{array}\right){\left(\frac{{p}_{1}^{2}}{{\sigma}_{2}}\right)}^{{k}_{1}}\cdots {\left(\frac{{p}_{V}^{2}}{{\sigma}_{2}}\right)}^{{j}_{V}}.$$

This sum satisfies a Large Deviation Principle and

$$\frac{\overline{S}\left(k\right)}{k}\sim \mathrm{max}\left\{-{\sum}_{i=1}^{V}\text{\hspace{0.17em}}\frac{{k}_{i}}{k}\mathrm{log}\frac{{k}_{i}}{k}+{\mathrm{\sum}}_{i=1}^{V}\text{\hspace{0.17em}}\frac{{k}_{i}}{k}\mathrm{log}\frac{{p}_{i}^{2}}{{\sigma}_{2}}\right\}.$$

As ${\sum}_{i=1}^{V}\text{\hspace{0.17em}}\frac{{k}_{i}}{k}\text{\hspace{0.17em}}\mathrm{log}\frac{{p}_{i}^{2}}{{\sigma}_{2}}=-\frac{2}{\alpha}+\mathrm{log}\frac{1}{{\sigma}_{2}}$, this maximum is

$$-\frac{1}{\alpha}\left[2-\alpha \mathrm{log}\frac{1}{{\sigma}_{2}}-\psi \left(\alpha \right)\right]$$

that is negative.

Barycentric coordinates of *α* are unique. Indeed, equation (10) reduces to a linear equation on the variable ${e}^{-\left({\beta}_{2}-{\beta}_{1}\right)\tau}$

$$\frac{1}{\alpha}=\frac{{\beta}_{1}+{\beta}_{2}{e}^{-\left({\beta}_{2}-{\beta}_{1}\right)\tau}}{1+{e}^{-\left({\beta}_{2}-{\beta}_{1}\right)\tau}}$$

where ${\beta}_{2}-{\beta}_{1}={\beta}_{\mathit{min}}-{\beta}_{\mathit{max}}=\mathrm{log}\frac{{p}_{\mathit{max}}}{{p}_{\mathit{min}}}$. Therefore, ${e}^{-\left({\beta}_{2}-{\beta}_{1}\right)\tau}=\frac{1-\alpha {\beta}_{1}}{\alpha {\beta}_{2}-1}$. Finally

$${\tau}_{\alpha}=\frac{1}{\mathrm{log}\frac{{p}_{\mathit{max}}}{{p}_{\mathit{min}}}}\mathrm{log}\frac{\alpha {\beta}_{2}-1}{1-\alpha {\beta}_{1}}=\frac{1}{\mathrm{log}\frac{{p}_{\mathit{max}}}{{p}_{\mathit{min}}}}\mathrm{log}\frac{\frac{1}{{\alpha}_{\mathit{min}}}-\frac{1}{\alpha}}{\frac{1}{\alpha}-\frac{1}{{\alpha}_{\mathit{max}}}}.$$

Function *ψ* rewrites, in the binary case:

$${\psi}_{\alpha}={\tau}_{\alpha}=\alpha \mathrm{log}{e}^{-\frac{1}{\alpha}{\tau}_{\alpha}}\left({e}^{-\left({\beta}_{1}-\frac{1}{\alpha}\right){\tau}_{\alpha}}+{e}^{-\left({\beta}_{2}-\frac{1}{\alpha}\right){\tau}_{\alpha}}\right).$$

Observing that ${e}^{-\left({\beta}_{2}-{\beta}_{2}\right){\tau}_{\alpha}}={s}_{\alpha}$ and changing variable *τ _{α}* into (

This paper describes the behavior of the number of unique or repeated *k*-mers in a random sequence, on a general alphabet. Derivation relies on a combination of analytic combinatorics and on Lagrange multipliers. It simplifies an approach provided for binary alphabets and allows to address larger alphabets, including the quaternary alphabets, such as DNA alphabet. Precise asymptotic estimates are provided and a probabilistic interpretation is given. They are validated on random simulated data and shown to be valid in the finite range. Therefore, they provide a valuable tool to estimate a suitable read length for assembly purposes and tune parameters for assembly algorithms. Real genomes significantly depart from the random behavior for long repetitions. The general shape of the trie profile is observed, with a maximum of the number of unique *k*-mers at the expected length. However, for real genomes, a number of very short *k*-mers are missing and, on the contrary, one observes a number of very long repetitions. Besides these events, the behaviors are rather similar.

In the future, it is worth extending the method to generalized Patricia tries, Markov models and approximate repetitions.

Both authors contributed equally.

The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

Inria-Cnrs-Poncelet grant Carnage.

- Beller T., Gog S., Ohlebusch E., Schnattinger T. (2013). Computing the longest common prefix array based on the burrows–wheeler transform. J. Discrete Algorithms 18, 22–31.10.1016/j.jda.2012.07.007 [Cross Ref]
- Chikhi R., Medvedev P. (2014). Informed and automated k-mer size selection for genome assembly. Bioinformatics 30, 31–37.10.1093/bioinformatics/btt310 [PubMed] [Cross Ref]
- Devillers H., Schbath S. (2012). Separating significant matches from spurious matches in dna sequences. J. Comput. Biol. 19, 1–12.10.1089/cmb.2011.0070 [PMC free article] [PubMed] [Cross Ref]
- Fagin R., Nievergelt J., Pippenger N., Strong H. R. (1979a). Extendible hashingâ – a fast access method for dynamic files. ACM Trans. Database Syst. 4, 315–344.10.1145/320083.320092 [Cross Ref]
- Fagin R., Nievergelt J., Pippenger N., Strong R. (1979b). Extendible hashing: a fast access method for dynamic files. ACM Trans. Database Syst. 4, 315–344.10.1145/320083.320092 [Cross Ref]
- Flajolet P., Kirschenhofer P., Tichy R. F. (1988). Deviations from uniformity in random strings. Probab. Theory Relat. Fields 80, 139–150.10.1007/BF00348756 [Cross Ref]
- Gu Z., Wang H., Nekrutenko A., Li W. H. (2000). Densities, length proportions, and other distributional features of repetitive sequences in the human genome estimated from 430 megabases of genomic sequence. Gene 259, 81–88.10.1016/S0378-1119(00)00434-0 [PubMed] [Cross Ref]
- Hartman A. L., Norais C., Badger J. H., Delmas S., Haldenby S., Madupu R., et al. (2010). The complete genome sequence of haloferax volcanii ds2, a model archaeon. PLoS One 5:e9605.10.1371/journal.pone.0009605 [PMC free article] [PubMed] [Cross Ref]
- Jacquet P., Szpankowski W. (1994). Autocorrelation on words and its applications: analysis of suffix trees by string-ruler approach. J. Comb. Theory A 66, 237–269.10.1016/0097-3165(94)90065-5 [Cross Ref]
- Jacquet P., Szpankowski W. (2015). Analytic Pattern Matching: From DNA to Twitter. Reading, MA: Cambridge University Press.
- Janson S., Lonardi S., Szpankowski W. (2004). “On the average sequence complexity,” in Combinatorial Pattern Matching, eds Sahinalp S. C., Muthukrishnan S., Dogrusoz U., editors. (Berlin Heidelberg: Springer; ), 74–88.
- Knuth D. (1998). The Art of Computer Programming, Volume Two, Seminumerical Algorithms. Reading, MA.
- Magner A., Knessl C., Szpankowski W. (2014). “Expected external profile of patricia tries,” in Proceedings of the Meeting on Analytic Algorithmics and Combinatorics (Society for Industrial and Applied Mathematics), 16–24.
- Mahmoud H. (1992). Evolution of Random Search Trees. New York: John Wiley & Sons.
- Manber U., Myers G. (1993). Suffix arrays: a new method for on-line string searches. SIAM J. Comput. 22, 935–948.10.1137/0222058 [Cross Ref]
- Nicodème P. (2005). “Average profiles, from tries to suffix-trees,” in 2005 International Conference on Analysis of Algorithms, Volume AD of DMTCS Proceedings, ed. Martìnez C., editor. (Barcelona, Spain: Discrete Mathematics and Theoretical Computer Science), 257–266.
- Park G., Hwang H.-K., Nicodeme P., Szpankowski W. (2009). Profile of trie. SIAM J. Comput. 38, 1821–1880.10.1137/070685531 [Cross Ref]
- Rizk G., Lavenier D., Chikhi R. (2013). Dsk: k-mer counting with very low memory usage. Bioinformatics 29, 652–653.10.1093/bioinformatics/btt020 [PubMed] [Cross Ref]
- Sedgewick R., Flajolet P. (2009). Analytic Combinatorics. Reading, MA: Cambridge University Press.
- Szpankowski W. (2001). Average Case Analysis of Algorithms on Sequences. New York: John Wiley and Sons.
- Treangen T. J., Salzberg S. L. (2012). Repetitive dna and next-generation sequencing: computational challenges and solutions. Nat. Rev. Genet. 13, 36–46.10.1038/nrg3117 [PMC free article] [PubMed] [Cross Ref]
- Ukkonen E. (1995). On-line construction of suffix trees. Algorithmica 14, 249–260.10.1007/BF01206331 [Cross Ref]

Articles from Frontiers in Bioengineering and Biotechnology are provided here courtesy of **Frontiers Media SA**

PubMed Central Canada is a service of the Canadian Institutes of Health Research (CIHR) working in partnership with the National Research Council's national science library in cooperation with the National Center for Biotechnology Information at the U.S. National Library of Medicine(NCBI/NLM). It includes content provided to the PubMed Central International archive by participating publishers. |