Next Article in Journal
Pattern-Guided k-Anonymity
Next Article in Special Issue
Modeling Dynamic Programming Problems over Sequences and Trees with Inverse Coupled Rewrite Systems
Previous Article in Journal
Multi-Threading a State-of-the-Art Maximum Clique Algorithm
Previous Article in Special Issue
Efficient in silico Chromosomal Representation of Populations via Indexing Ancestral Genomes
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Sublinear Time Motif Discovery from Multiple Sequences

Department of Computer Science, University of Texas-Pan American, 1201 W University Dr., Edinburg, TX 78539, USA
*
Author to whom correspondence should be addressed.
Algorithms 2013, 6(4), 636-677; https://doi.org/10.3390/a6040636
Submission received: 11 June 2013 / Revised: 30 September 2013 / Accepted: 1 October 2013 / Published: 14 October 2013
(This article belongs to the Special Issue Algorithms for Sequence Analysis and Storage)

Abstract

:
In this paper, a natural probabilistic model for motif discovery has been used to experimentally test the quality of motif discovery programs. In this model, there are k background sequences, and each character in a background sequence is a random character from an alphabet, Σ. A motif G = g 1 g 2 g m is a string of m characters. In each background sequence is implanted a probabilistically-generated approximate copy of G. For a probabilistically-generated approximate copy b 1 b 2 b m of G, every character, b i , is probabilistically generated, such that the probability for b i g i is at most α. We develop two new randomized algorithms and one new deterministic algorithm. They make advancements in the following aspects: (1) The algorithms are much faster than those before. Our algorithms can even run in sublinear time. (2) They can handle any motif pattern. (3) The restriction for the alphabet size is a lower bound of four. This gives them potential applications in practical problems, since gene sequences have an alphabet size of four. (4) All algorithms have rigorous proofs about their performances. The methods developed in this paper have been used in the software implementation. We observed some encouraging results that show improved performance for motif detection compared with other software.

1. Introduction

Motif discovery is an important problem in computational biology and computer science. For instance, it has applications in coding theory [1,2], locating binding sites and conserved regions in unaligned sequences [3,4,5,6], genetic drug target identification [7], designing genetic probes [7] and universal PCR primer design [7,8,9,10].
This paper focuses on the application of motif discovery to find conserved regions in a set of given DNA, RNA or protein sequences. Such conserved regions may represent common biological functions or structures. Many performance measures have been proposed for motif discovery. Let C be a subset of 0–1 sequences of length n. The covering radius of C is the smallest integer, r, such that each vector in { 0 , 1 } n is at a distance at most r from a string in C. The decision problem associated with the covering radius for a set of binary sequences is NP-complete [1]. The similar closest string and substring problems were proven to be NP-hard [1,7]. Some approximation algorithms have been proposed. Li et al. [11] gave an approximation scheme for the closest string and substring problems. The related consensus patterns problem is that given n sequences s 1 , , s n , find a region of length L in each s i and a string, s, of length L, so that the total Hamming distance from s to these regions is minimized. Approximation algorithms for the consensus patterns problem were reported in [12]. Furthermore, a number of heuristics and programs have been developed [13,14,15,16,17].
In many applications, motifs are faint and may not be apparent when two sequences alone are compared, but may become clearer when more sequences are compared together [18]. For this reason, it has been conjectured that comparing more sequences together can help with identifying faint motifs. This paper is a theoretical approach with a rigorous probabilistic analysis.
We study a natural probabilistic model for motif discovery. In this model, there are k background sequences, and each character in the background sequence is a random character from an alphabet, Σ. A motif G = g 1 g 2 g m is a string of m characters. In each background sequence is implanted a probabilistically-generated approximate copy of G. For a probabilistically-generated approximate copy b 1 b 2 b m of G, every character, b i , is probabilistically generated, such that the probability for b i g i , which is called a mutation, is at most α. This model was first proposed in [13] and has been widely used in experimentally testing motif discovery programs [14,15,16,17]. We note that a mutation in our model converts a character, g i , in the motif into a different character, b i , without probability restriction. This means that a character, g i , in the motif may not become any character b i in Σ { g i } with equal probability.
We develop three algorithms for which, under the probabilistic model, one can find the implanted motif with high probability via a tradeoff between computational time and the probability of mutation. Each algorithm has a preprocessing phase and the voting phase. We use a pair of functions, ( t 1 ( n , k ) , t 2 ( n , k ) ) , to describe the computational complexity of the motif detection algorithm, where n is the largest length of the input sequence and k is the number of sequences. Function t 1 ( n , k ) is the time complexity for the part for preprocessing, and t 2 ( n , k ) is the time complexity for recovering one character for the motif after preprocessing. The total time is O ( t 1 ( n , k ) + t 2 ( n , k ) | G | ) .
(1) There exists a randomized algorithm, such that there are positive constants, c 0 and c 1 , such that, if the alphabet size is at least four, the number of sequences is at least c 1 log n , the motif length is at least c 0 log n and each character in the motif region has a probability of at most 1 ( log n ) 2 + μ of mutation for some fixed μ > 0 , then the motif can be recovered with a probability of at least 3 4 in ( O ( n h ( log n ) 7 2 + h 2 log 2 n ) , O ( log n ) ) time, where n is the longest length of any input sequences and h = min ( | G | , n 2 5 ) . The algorithm’s total time is sublinear if the motif length, | G | , is in the range [ ( log n ) 7 + μ , n ( log n ) 1 + μ ] . This is the first sublinear time algorithm with rigorous analysis in this model.
(2) There exists a randomized algorithm, such that there are positive constants, c 0 , c 1 and α, such that if the alphabet size is at least four, the number of sequences is at least c 1 log n , the motif length is at least c 0 log n and each character in the motif region has a probability of at most α of mutation, then the motif can be recovered with a probability of at least 3 4 in ( O ( n 2 | G | ( log n ) O ( 1 ) ) , O ( log n ) ) time.
(3) There exists a deterministic algorithm, such that there are positive constants, c 0 , c 1 and α, such that if the alphabet size is at least four, the number of sequences is at least c 1 log n , the motif length is at least c 0 log n and each character in the motif region has a probability of at most α of mutation, then the motif can be recovered with a probability of at least 3 4 in ( O ( n 2 ( log n ) O ( 1 ) ) , O ( log n ) ) time.
The research in this model has been reported in [19,20,21]. In [19], Fu et al.. developed an algorithm that needs the alphabet size to be a constant that is much larger than four. In [20], our algorithm cannot handle all possible motif patterns. In [21], Liu et al. designed an algorithm that runs in O ( n 3 ) time and lacks rigorous analysis about its performance. The motif recovery in this natural and simple model has not been fully understood and seems to be a complicated problem.
This paper presents two new randomized algorithms and one new deterministic algorithm. They make advancements in the following aspects: (1) The algorithms are much faster than those before. Our algorithms can even run in sublinear time. (2) They can handle any motif pattern. (3) The restriction for the alphabet size is as small as four, giving them potential applications in practical problems, since gene sequences have an alphabet size of four. (4) All algorithms have rigorous proofs about their performances.
The algorithm for motif detection is named Recover-Motif(.). The entire Recover-Motif(.) is described in Section 4.2. We analyze Algorithm Recover-Motif (.) in Section 6.

2. Notations and the Model of Sequence Generation

For a set, A, | | A | | denotes the number of elements in A. Σ is an alphabet with | | Σ | | = t 2 . For an integer, n 0 , Σ n is the set of sequences of a length of n with characters from Σ. For a sequence S = a 1 a 2 a n , S [ i ] denotes the character, a i , and S [ i , j ] denotes the substring, a i a j , for 1 i j n . | S | denotes the length of the sequence, S. We use to represent the empty sequence, which has a length of zero.
Let G = g 1 g 2 g m be a fixed sequence of m characters. G is the motif to be discovered by our algorithm. A Θ ( n , G , α ) -sequence has the form S = a 1 a n 1 b 1 b m a n 1 + 1 a n 2 , where n 2 + m n , each a i has a probability of 1 t to be equal to π for each π Σ and b i has a probability of at most α and not equal to g i for 1 i m , where m = | G | . ( S ) denotes the motif region b 1 b m of S. A mutation converts a character, g i , in the motif into an arbitrary, different character, b i , without probability restriction. This allows a character, g i , in the motif to change into any character, b i , in Σ { g i } with even a different probability. The motif region of S may start at an arbitrary position in S. Furthermore, a mutation may convert a character, g i , in the motif into an arbitrary, different character, b i , only subject to the restriction that g i will mutate with a probability of at most α.
For two sequences S 1 = a 1 a m and S 2 = b 1 b m of the same length, let the relative Hamming distance diff ( S 1 , S 2 ) = | { i | a i b i ( i = 1 , , m ) } | m .
Definition 1.
For two intervals, [ i 1 , j 1 ] and [ i 2 , j 2 ] , define shift ( [ i 1 , j 1 ] , [ i 2 , j 2 ] ) = min ( | i 1 i 2 | , | j 1 j 2 | ) .

3. Brief Introduction to the Algorithm

Every detection algorithm in this paper has two phases. The first phase is preprocessing, so that the motif regions from multiple sequences can be aligned in the same column region. The second phase is to recover the motif via voting. We use a pair of functions, ( t 1 ( n , k ) , t 2 ( n , k ) ) , to describe the computational complexity of the motif detection algorithm. Function t 1 ( n , k ) is the time complexity for the preprocessing phase, and t 2 ( n , k ) is the time complexity for outputting one character for the motif in the voting phase.
The motif, G, is a pattern unknown to algorithm Recover-Motif, and algorithm Recover-Motif will attempt to recover G from a series of Θ ( n , G , α ) -sequences generated by the probabilistic model.

3.1. Algorithm

The algorithm first detects a position that is close to the left motif boundary in a sequence. It finds such a position via sampling and collision between two sequences. After the rough left boundary of a sequence is found, it is used to find the rough boundaries of the rest of the sequences. Similarly, we find those right boundaries of the motif among the input sequences. The exact left boundary of each motif region will be detected in the next phase via voting. Each character of the motif is recovered by voting among all the characters at the same positions in the motif regions of input sequences. For a sequence, S, a sample point is a random position, i, in S. For two sequences, S and S , with two sample points, i and j, respectively, a rough motif boundary is detected by the similarity of S [ i , i + l ] and S [ i , i + l ] for some reasonably large parameter, l.
Descriptions of the Algorithm
Input: Z = Z 1 Z 2 , where Z 1 = { S 1 , , S 2 k 1 } and Z 2 = { S 1 , , S k 2 } are two sets of input sequences.
Output: planted motif in each sequence and consensus string. Start:
Randomly select sample points from each sequence, both in Z 1 and Z 2 .
For each pair of sequences selected from Z 1 and Z 2 ,
    find the rough left and rough right boundaries via the matching at sample points.
    Improve the rough boundaries.
If the motif boundaries of each sequence in Z 2 are not empty,
    use the Voting algorithm to get the planted motifs.
End of Algorithm.

3.2. An Example

We provide the following example for the brief idea of our algorithm. Let the following input strings be defined as below. We assume that the original motif is TTTTTAACGATTAGCS. The motif part is displayed with bold font, and the mutated characters in the motif region have been marked by * in their feet.

3.2.1.. Input Sequences

This contains two groups Z 1 = { S 1 , S 2 } and Z 2 = { S 1 , S 2 , S 3 , S 4 , S 5 } .
Z 1 : S 1 = G T A C C A T G G A TT A * TTAACGATTAGCS T A G A G G A C C T A . S 2 = A A T C C T T A C * TTTTAACGATTAGCS G T C .
The above two strings are used to detect the initial motif region and use them to deal with the motif in the second group below.
Z 2 : S 1 = A T T C G A T C C A G TTTTTAACG G * TTAGCS C A A T T A C T T A G . S 2 = G C A T T G C A T TTTTTAACGATTA C * CS G T A C T T A G C T A G A T C . S 3 = T C A G G G C A T C G A G A C TTTTTA G * CGATTAGCS C T A G A A T C A G A C C T . S 4 = G T A C C T G G C A T T G A A C G TTTTTAACGATTAGC A * T G C A G A T G G A C C T T T A . S 5 = A A T G G A T C A G A TTTTTAACGATT C * GCS C T A G A T T C A G .

3.2.2.. Select Sample Points

Some sample points of two sequences in Z 1 are selected randomly and marked with the little dots on the top.
S 1 = G T A ˙ C C A ˙ T G G ˙ A T T ˙ A * T TA A ˙ CGA T ˙ T A ˙ GC S ˙ T A G ˙ A G G ˙ A C C T ˙ A . S 2 = A ˙ A T C ˙ C T T A ˙ C * T ˙ TTT A ˙ AC G ˙ A T ˙ TA G ˙ CS G ˙ T C .

3.2.3.. Collision Detection

In this step, the left and right rough boundaries of two sequences will be marked. The following shows the left collision, which happens nearby the left motif boundary and are marked by two overline T A T T ¯ and T T T T ¯ subsequences.
S 1 = G T A ˙ C C A ˙ T G G ˙ A T T ˙ A * TT ¯ A A ˙ CGA T ˙ T A ˙ GC S ˙ T A G ˙ A G G ˙ A C C T ˙ A . S 2 = A ˙ A T C ˙ C * T T A ˙ C * T ˙ TTT ¯ A ˙ AC G ˙ A T ˙ TA G ˙ CS G ˙ T C .
The following shows the right collision, which happens nearby the right motif boundary and is marked by two overline T T A G ¯ subsequences.
S 1 = G T A ˙ C C A * ˙ T G G ˙ A T T ˙ A * TT A A ˙ CGA T ˙ T A ˙ G ¯ C S ˙ T A G ˙ A G G ˙ A C C T ˙ A . S 2 = A ˙ A T C ˙ C * T T A ˙ C * T ˙ TTT A ˙ AC G ˙ A T ˙ TA G ˙ ¯ CS G ˙ T C .

3.2.4.. Improving the Boundaries

In the early phase of the algorithm, we first detect a small piece of the motif in S 1 by comparing S 1 and S 2 . Assume that “ T A * TT ” and “ TTAG ” are found in the left and right motif regions of S 1 , respectively. The rough motif length will be calculated via the difference of the location of the first character, ‘T’, of the first subsequence and the location of the last character, ‘G’, of the second subsequence. The position marked by “A” is the rough left boundary of the motif, and the position marked by “T” is the rough right boundary of the motif in S 1 below.
S 1 = G T A C C A T G G A ̲ TTA * TTAACGATTAGCS T ̲ A G A G G A C C T A . S 2 = A A T C C T T A ̲ C * TTTTAACGATTAGCS G ̲ T C .

3.2.5.. Select Sample Points for the Sequences in Z 2

Some sample points near the motif boundaries of S 1 are selected.
S 1 = G T A C C A T G G ˙ A T T ˙ A * T ˙ T AACGATT A ˙ G C ˙ S T A ˙ G A G G A C C T A .
Sample points are selected in each sequence in Z 2 .
S 1 = A T ˙ T C G ˙ A T C C A ˙ G T T ˙ T T ˙ TAACGG * TTAG C ˙ S C A ˙ A T T ˙ A C T T A ˙ G . S 2 = G C ˙ A T T G ˙ C A T T T ˙ TTTAACGATTAC * C ˙ S G T A ˙ C T T A ˙ G C T A ˙ G A T ˙ C . S 3 = T ˙ C A G ˙ G G C A T ˙ C G A G ˙ A C TTT T ˙ TAG * CGATTAG C ˙ S C T A G ˙ A A T C A ˙ G A C C ˙ T . S 4 = G T A ˙ C C T G ˙ G C A T T ˙ G A A C G T T ˙ TTTAACGATT A ˙ GCA * T G C A ˙ G A T G ˙ G A C C T T ˙ T A . S 5 = A A T ˙ G G A T ˙ C A G A T T ˙ TTTAACGATTC * G C ˙ S C T A G ˙ A T T C ˙ A G .

3.2.6.. Collision Detection Between S 1 with the Sequences in Z 2

The rough motif boundaries of the sequences in Z 2 are detected via the collisions with the subsequences near the motif area of S 1 .
S 1 = G T A C C A T G G ˙ A T T ˙ A * T ˙ T AACGATT A ˙ G C ˙ S T A ˙ G A G G A C C T A .
The rough motif boundaries are marked by the lines over the matched subsequences.
S 1 = A T ˙ T C G ˙ A T C C A ˙ G T T ˙ T T ˙ T ¯ AACGG * T TAG C ˙ ¯ S C A ˙ A T T ˙ A C T T A ˙ G . S 2 = G C ˙ A T T G ˙ C A T T T ˙ TTT ¯ AACGAT TAC * C ˙ ¯ S G T A ˙ C T T A ˙ G C T A ˙ G A T ˙ C . S 3 = T ˙ C A G ˙ G G C A T ˙ C G A G ˙ A C TTT T ˙ TAG * ¯ CGAT TAG C ˙ ¯ S C T A G ˙ A A T C A ˙ G A C C ˙ T . S 4 = G T A ˙ C C T G ˙ G C A T T ˙ G A A C G T T ˙ TTT ¯ AACG ATT A ˙ ¯ GCA * T G C A ˙ G A T G ˙ G A C C T T ˙ T A . S 5 = A A T ˙ G G A T ˙ C A G A T T ˙ TTT ¯ AACGAT TC * G C ˙ ¯ S C T A G ˙ A T T C ˙ A G .

3.2.7.. Improving the Motif Boundaries for the Sequences in Z 2

After the collision with the sequences in Z 2 , we obtain the rough location of the motifs of the sequences in Z 2 . Their rough motif boundaries for the sequences in Z 2 are improved to be closer to exact boundaries.
S 1 = G T A C C A T G G A TTA * T ¯ T AACGATT AGCS ¯ T A G A G G A C C T A .
The improved motif boundaries of the sequences in Z 2 are marked below. This phase does not cost much time, as only the positions near the rough motif boundaries are tested.
S 1 = A T T C G A T C C A G ̲ TTTTTAACG G * TTAGCS C ̲ A A T T A C T T A G . S 2 = G C A T T G C A ̲ T TTTTTAACGATTAC * CS G ̲ T A C T T A G C T A G A T C . S 3 = T C A G G G C A T C G A G A C ̲ TTTTTAG * CGATTAGCS C ̲ T A G A A T C A G A C C T . S 4 = G T A C C T G G C A T T G A A C G ̲ TTTTTAACGATTAGCA * T ̲ G C A G A T G G A C C T T T A . S 5 = A A T G G A T C A G A ̲ TTTTTAACGATTC * GCS C T ̲ A G A T T C A G .

3.2.8.. Motif Boundaries for the Sequences in Z 2

S 1 = G T A C C A T G G A TTA * T ¯ T AACGATT AGCS ¯ T A G A G G A C C T A .
Use the pair ( G L , G R ) with G L = TTAT ¯ and G R = AGCS ¯ to find the motif boundaries in the sequences of Z 2 . The rough boundaries of the second group are marked below with underlines. In this phase, the exact motif boundaries for most sequences of Z 2 can be found.
S 1 = A T T C G A T C C A G ̲ TTTTTAACG G * TTAGCS C ̲ A A T T A C T T A G . S 2 = G C A T T G C A T ̲ TTTTTAACGATTAC * CS G ̲ T A C T T A G C T A G A T C . S 3 = T C A G G G C A T C G A G A C ̲ TTTTTAG * CGATTAGCS C ̲ T A G A A T C A G A C C T . S 4 = G T A C C T G G C A T T G A A C G ̲ TTTTTAACGATTAGCA * T ̲ G C A G A T G G A C C T T T A . S 5 = A A T G G A T C A G A ̲ TTTTTAACGATTC * GCS C ̲ T A G A T T C A G .

3.2.9.. Extracting the Motif Regions

The motif regions of the second group will be extracted. The original motif is recovered via voting at each column.
G 1 = TTTTTAACG G * TTAGCS G 2 = TTTTTAACGATTA C * CS G 3 = TTTTTA G * CGATTAGCS G 4 = TTTTTAACGATTAGC A * G 5 = TTTTTAACGATT C * GCS

3.2.10.. Recovering Motif via Voting

The original motif, TTTTTAACGATTAGCS, is recovered via voting at all columns. For example, the last S in the motif is recovered via voting among the characters, S, S, S, A, S, in the last column.

3.3. Our Results

We give an algorithm for the case with at most a 1 ( log n ) 2 + μ mutation rate. The performance of the algorithm is stated in Theorem 2. Theorem 2 implies Corollary 3 by selecting k = c 1 log n with some constant c 1 that is large enough.
Theorem 2.
Assume that μ is a fixed number in ( 0 , 1 ) and the alphabet size, t, is at least four. There exists a randomized algorithm and a constant c 0 , such that if the length of the motif, G, is at least c 0 log n , then, given k independent Θ ( n , G , 1 ( log n ) 2 + μ ) -sequences, the algorithm outputs G , such that:
(1) with a probability of at most e Ω ( k ) , | G | | G | ;
(2) for each 1 i | G | , with a probability of at most e Ω ( k ) , G [ i ] G [ i ] ; and
(3) with a probability of at most k n 3 , the algorithm does not stop in ( O ( k ( n h ( log n ) 5 2 + h 2 log n ) ) , O ( k ) ) time, where n is the longest length of any input sequences, and h = min ( | G | , n 2 5 ) .
Corollary 3.
There exists a randomized algorithm and positive constants, c 0 , c 1 and μ, such that if the alphabet size is at least four, the number of sequences is at least c 1 log n , the motif length is at least c 0 log n and each character in the motif region has a probability of at most 1 ( log n ) 2 + μ of mutation, then the motif can be recovered with a probability of at least 3 4 in ( O ( n h ( log n ) 7 2 + h 2 log 2 n ) , O ( log n ) ) time, where n is the longest length of any input sequences, and h = min ( | G | , n 2 5 ) .
We give a randomized algorithm for the case with a Ω ( 1 ) mutation rate. The performance of the algorithm is stated in Theorem 4. Theorem 4 implies Corollary 5 by selecting k = c 1 log n with some constant c 1 that is large enough.
Theorem 4.
Assume that the alphabet size, t, is at least four. There exists a randomized algorithm and a constant c 0 , such that if the length of the motif G is at least c 0 log n , then, given k independent Θ ( n , G , μ ) ) -sequences, the algorithm outputs G , such that:
(1) with a probability of at most e Ω ( k ) , | G | | G | ;
(2) for each 1 i | G | , with a probability of at most e Ω ( k ) , G [ i ] G [ i ] ; and
(3) with a probability of at most k n 3 , the algorithm does not stop in ( O ( k ( n 2 | G | ( log n ) O ( 1 ) + h 2 ) ) , O ( k ) ) ,
where n is the longest length of any input sequences, and h = min ( | G | , n 2 5 ) .
Corollary 5.
There exists a randomized algorithm and positive constants, c 0 , c 1 and α, such that if the alphabet size is at least four, the number of sequences is at least c 1 log n , the motif length is at least c 0 log n and each character in the motif region has a probability of at most α of mutation, then the motif can be recovered with a probability of at least 3 4 in ( O ( n 2 | G | ( log n ) O ( 1 ) ) , O ( log n ) ) time.
We give a deterministic algorithm for the case with a Ω ( 1 ) mutation rate. The performance of the algorithm is stated in Theorem 6. Theorem 6 implies Corollary 7 by selecting k = c 1 log n with some constant c 1 that is large enough.
Theorem 6.
Assume that the alphabet size, t, is at least four. There exists a deterministic algorithm and a constant, c 0 , such that if the length of the motif G is at least c 0 log n , then, given k independent Θ ( n , G , μ ) ) -sequences, the algorithm runs in ( O ( n 2 ( log n ) O ( 1 ) + h 2 k ) , O ( k ) ) and outputs G , such that:
(1) with a probability of at most e Ω ( k ) , | G | | G | ;
(2) for each 1 i | G | , with a probability of at most e Ω ( k ) , G [ i ] G [ i ] ; and
(3) with a probability of at most k n 3 , the algorithm does not stop in ( O ( k ( n 2 ( log n ) O ( 1 ) + h 2 ) ) , O ( k ) ) time, where nis the longest length of any input sequences, and h = min ( | G | , n 2 5 ) .
Corollary 7.
There exists a deterministic algorithm and positive constants, c 0 , c 1 and α, such that if the alphabet size is at least four, the number of sequences is at least c 1 log n , the motif length is at least c 0 log n and each character in the motif region has a probability of at most α of mutation, then the motif can be recovered with a probability of at least 3 4 in ( O ( n 2 ( log n ) O ( 1 ) ) , O ( log n ) ) time.

4. Algorithm Recover-Motif

In this section, we give a unified approach to describe three algorithms. The performance of the algorithms is stated in Theorems 2, 4 and 6. The description of Algorithm Recover-Motif is given in Section 4.2. The analysis of the algorithm is given at Section 6.

4.1. Some Parameters

Definition 8.
i.
Parameter x is selected to be 10. This parameter controls the failure probability of our algorithms to be at most 1 2 x .
ii.
The size of the alphabet is t 4 .
iii.
Select a constant ρ 0 ( 0 , 1 ) to have inequality (1):
ρ 0 < t 1 2 t
iv.
The constant ϵ ( 0 , 1 ) is selected to satisfy:
ϵ < min ( ( t 1 t ( 2 ρ 0 + 2 ϵ ) ) , 1 5 ( 1 2 t 1 4 2 x ) , 1 3 )
The existence of ϵ follows from inequality (1). The constant ϵ is used to control the mutation in the motif area. It is a part of parameter β defined in item (xiv) of this definition.
v.
Let c = e ϵ 2 3 . The constant, c, is used to simplify probabilistic bounds, which are derived from the applications of Chernoff bounds (see Corollary 18).
vi.
Define r ( y ) = ( 1 t 1 + c y 1 c ) .
vii.
Define u 1 to be a large constant that, for all v 0 :
2 ( v + u 1 ) c v + u 1 ( 1 c ) 2 1 5 · 2 x
viii.
Select constant ρ 1 ( 0 , 1 ) , such that:
2 t 1 + 4 2 x + 5 ϵ + ρ 1 < 1
The existence of ρ 1 follows from ϵ < 1 5 ( 1 2 t 1 4 2 x ) , which is implied by inequality (2).
ix.
Select constant ρ 2 ( 0 , 1 ) and constant positive integer v that are large enough, such that:
6 ( v + u 1 ) c v 1 c + ρ 2 < ρ 1 , and
( 1 2 x + ( v + u 1 ) c v 1 c + c v 1 c + 1 5 · 2 x ) 1 / 2
x.
Define ς 0 = 1 2 x , and: φ ( v ) = ( v + u 1 ) c v 1 c + c v 1 c )
xi.
Select constant α 0 , such that:
4 ( v 1 ) α 0 + α 0 < ρ 2 , and
α 0 < ρ 0
Adding inequalities (4), (5) and (7), we have inequality (9):
( 2 t 1 + 4 2 x + 5 ϵ ) + 6 ( v + u 1 ) c v 1 c + ( 4 ( v 1 ) α 0 + α 0 ) < 1
By arranging the terms in inequality (9) and the definitions of r ( v ) and φ ( v ) , we have inequality (10):
2 ( ( 2 ( v 1 ) α 0 + c v 1 c ) + r ( v ) + 2 ( ς 0 + φ ( v ) ) + 2 ϵ ) + ( α 0 + ϵ ) < 1
xii.
The maximal mutation rate, α, for the second algorithm (Theorem 4) and the third algorithm (Theorem 6) are selected as α 0 . Since the mutation rate of our sublinear time algorithm is bounded by 1 ( log n ) 2 + μ , the maximal mutation rate α for the first algorithm (Theorem 2) is less than α 0 when n is large enough. We always assume that all mutation rates α in our three algorithms are in the range ( 0 , α 0 ] .
xiii.
Define q ( y ) = 2 ( v 1 ) α + 2 c y 1 c . By inequality (10), the definition of q ( y ) and the fact that α ( 0 , α 0 ) , we have:
2 ( q ( v ) + r ( v ) + 2 ( ς 0 + φ ( v ) ) + 2 ϵ ) + ( α 0 + ϵ ) < 1
Inequality (11) implies q ( v ) 1 2 . By inequality (6), we have that:
( 1 2 x + ( v + u 1 ) c v 1 c + c v 1 c + 1 5 · 2 x ) + q ( v ) 3 / 4
xiv.
Let β = 2 α + 2 ϵ . The parameter, β, controls the similarity of ( S ) and the original motif, G (see Lemma 27).
xv.
Define R = r ( v ) .
xvi.
We define the following Q 0 .
Q 0 = q ( v )
The parameter, Q 0 , used in Lemma 27 gives an upper bound of the probability that a Θ ( n , G , α ) -sequence, S, whose ( S ) will not be similar enough to the original motif, G, according to the conditions in Lemma 27.
xvii.
Select constant d 0 , such that:
n 3 c d 0 log n < 1 5 · 2 x for all large n
xviii.
Select constant d 1 , such that ( v + u 1 ) c d 1 log n < 1 5 · 2 x .
xix.
Select number u 2 , such that:
( d 1 log n ) ( v + u 1 ) c v + u 2 1 c 1 5 · 2 x . and
( v + u 1 ) c v + u 2 1 c < 1 5 · 2 x
Since only n is variable, we can make u 2 = O ( log log n ) .
xx.
For a fixed c 0 ( 0 , 1 ) , define δ c 0 = ln 1 c 0 2 .

4.2. Description of Algorithm Recover-Motif

The algorithms are described in this section. The description combines three algorithms together. The simplest deterministic algorithm is also given in Section 5. Before presenting the algorithm, we define some notions.
Definition 9.
  • Two sequences, X 1 and X 2 , are weakly left matched if: (1) both | X 1 | and | X 2 | are at least d 0 log n ; and (2) diff ( X 1 [ 1 , i ] , X 2 [ 1 , i ] ) β for all integers i, v i d 0 log n , where v is defined in item (ix) in Definition 8.
  • Two sequences, X 1 and X 2 , are left matched if: (1) d 0 log n | X 1 | , | X 2 | ; (2) X 1 [ i ] = X 2 [ i ] for i = 1 , , v 1 ; and (3) diff ( X 1 [ 1 , i ] , X 2 [ 1 , i ] ) β for all integers i, v i d 0 log n .
  • Two sequences, X 1 and X 2 , are weakly right matched if X 1 R and X 2 R are weakly left matched, where X R = a n a 1 is the inverse sequence of X = a 1 a n .
  • Two sequences, X 1 and X 2 , are right matched if X 1 R and X 2 R are left matched, where X R = a n a 1 is the inverse sequence of X = a 1 a n .
  • Two sequences, X 1 and X 2 , are matched if X 1 and X 2 are both left and right matched.
Variable L will be controlled in the range L [ ( log n ) 3 + ϵ 1 , n 2 5 ϵ 2 ] in our algorithm with a high probability. We define the following functions that depend on L.
Definition 10.
Define M ( L ) = 3 log n + x 1 γ L log n . Define M 1 ( L ) = δ c 0 M ( L ) log n (see (xx) of Definition 8 for δ c 0 ), where c 0 = 1 4 .
We would like to minimize the function ( n L M + L 2 ) log n . This selection can make the total time complexity sublinear.
Definition 11.
For a Θ ( n , G , α ) sequence, S, define LB(S) to be the left boundary, l, of the motif region ( S ) in S and RB(S) to be the right boundary, r, of the motif region ( S ) in S, such that ( S ) = S [ l , r ] .

4.2.1.. Boundary-Phase of Algorithm Recover-Motif 

The first phase of Algorithm Recover-Motif finds the rough motif boundaries of all input sequences. It first detects the rough motif boundaries of one sequence via comparing two input sequences. Then, the rough boundaries of the first sequence are used to find the rough motif boundaries of other input sequences.
Three algorithms share most of the functions. We have a unified approach to describe them. A special variable, “algorithm-type”, selects one of the three algorithms, respectively.
Definition 12.
Let algorithm-type represent one of the three algorithm types, “RANDOMIZED-SUBLINEAR”, “RANDOMIZED-SUBQUADRATIC” and “DETERMINISTIC-SUPERQUADRATIC”.
Definition 13.
Assume that A 1 is a set of positions in a Θ ( n , G , α ) sequence, S 1 , and A 2 is a set of positions in a Θ ( n , G , α ) sequence, S 2 . If there are positions a 1 A 1 and a 2 A 2 , such that for some position, j, with 1 j | G | , a 1 is the position of ( S 1 ) [ j ] in S 1 and a 2 is the position of ( S 2 ) [ j ] in S 2 , then A 1 and A 2 have a collision at ( a 1 , a 2 ) .
In the following function, Collision-Detection, the parameter, ω β , is defined below in the three algorithms.
ω algorithm type = 0 if algorithm type = RANDOMIZED SUBLINEAR ; β i f algorithm type = RANDOMIZED SUBQUADRATIC ; β i f algorithm type = DETERMINISTIC SUPERQUADRATIC .
Function Collision-Detection ( S 1 , U 1 , S 2 , U 2 ) is used to detect a point, a 1 U 1 , in the motif area in S 1 and another a 1 U 1 point in the motif area of S 1 . The two points, a 1 and a 1 , are close to the left and right motif boundaries of S 1 , respectively. A similar pair of points, e 1 and e 1 , in U 2 is also derived for S 2 . See the examples in Section 3.2.3..
Collision-Detection ( S 1 , U 1 , S 2 , U 2 )
Input: a pair of Θ ( n , G , α ) -sequences, S 1 and S 2 ; U i is a set of locations in S i for i = 1 , 2 .
Output: the left and right rough boundaries of two sequences.
    Let D 1 be all subsequences S 1 [ a , a + d 0 log n 1 ] of S 1 of a length of d 0 log n with a U 1 .
    Let D 2 be all subsequences S 2 [ b , b + d 0 log n 1 ] of S 2 of a length of d 0 log n with b U 2 .
    Find two subsequences, X 1 = S 1 [ a 1 , a 1 + d 0 log n 1 ] D 1 and
     X 2 = S 2 [ b 1 , b 1 + d 0 log n 1 ] D 2 , such that a 1 is the least and diff ( X 1 , X 2 ) ω algorithm type .
    Find two subsequences, X 1 = S 1 [ a 1 , a 1 + d 0 log n 1 ] D 1 and
     X 2 = S 2 [ b 1 , b 1 + d 0 log n 1 ] D 2 , such that a 1 is the largest and
     diff ( X 1 , X 2 ) ω algorithm type .
    Find two subsequences, Y 1 = S 1 [ f 1 , f 1 + d 0 log n 1 ] D 1 and
     Y 2 = S 2 [ e 1 , e 1 + d 0 log n 1 ] D 2 , such that e 1 is the least and
     diff ( Y 1 , Y 2 ) ω algorithm type .
    Find two subsequences, Y 1 = S 1 [ f 1 , f 1 + d 0 log n 1 ] D 1 and
     Y 2 = S 2 [ e 1 , e 1 + d 0 log n 1 ] D 2 , such that e 1 is the largest and
     diff ( Y 1 , Y 2 ) ω algorithm type .
    Return ( a 1 , a 1 , e 1 , e 1 ) .
End of Collision-Detection.
Definition 14.
Let [ a , b ] be an interval with two integers boundaries, a and b, and l be a positive integer parameter. Define an l-partition of [ a , b ] to be l- P ( [ a , b ] ) , which contains the intervals [ a 1 , b 1 ] , [ a 2 , b 2 ] , , [ a r , b r ] , such that a 1 = a , b r = b , a i + 1 = b i + 1 , b i = a i + l 1 for i = 1 , 2 , , r 1 and a r b r a i + l 1 .
For example, the three-partition of the interval [ 1 , 10 ] is 3- P ( [ 1 , 10 ] ) = { [ 1 , 3 ] , [ 4 , 6 ] , [ 7 , 9 ] , [ 10 , 10 ] } . Function Point-Selection ( S , L , I ) will be defined differently in three different algorithms, where I is an interval of positions in sequence S and L is a positive integer parameter. For randomized algorithms, some random points are selected in L- P ( I ) . For a deterministic algorithm, all points in I are selected. See the examples in Section 3.2.2..
Point-Selection ( S , L , I )
Input: a pair of Θ ( n , G , α ) -sequences, S, a size parameter, L, of partition and a set of intervals, I, of positions in S.
Output: a set, U, of positions from S, respectively.
Steps:
Let U = .
If algorithm-type=RANDOMIZED-SUBLINEAR or RANDOMIZED-SUBQUADRATICand
    if ( L ( log n ) 3 + τ 100 ) :
        for each interval, I , in I, obtain its L-partition in L- P ( I ) and for each interval, J, in L- P ( I ) ,
            sample M ( L ) (see Definition 10) random positions in J and put them into U.
    Else,
        put every position of I into U 1 .
If algorithm-type=DETERMINISTIC-SUPERQUADRATIC,
        put every position of I into U.
Return U.
End of Point-Selection.
The function, Improve-Boundaries ( S 1 , a l , a r , S 2 , f l , f r , L ) , is used to improve the existing rough left and right boundaries, a l and a r , of S 1 , respectively, and to improve the existing rough left and right boundaries, f l and f r , of S 2 , respectively. We assume a l [ LB ( S 1 ) L , LB ( S 1 ) + L ] , a r [ RB ( S 1 ) L , LB ( S 1 ) + L ] , f l [ LB ( S 2 ) L , LB ( S 2 ) + L ] and f r [ RB ( S 2 ) L , RB ( S 2 ) + L ] . After calling this function, more accurate approximate boundaries will be derived. From the probabilistic analysis, we have a good chance to get the exact motif boundaries for both S 1 and S 2 . See the examples in Section 3.2.7..
Improve-Boundaries ( S 1 , a l , a r , S 2 , f l , f r , L )
Input: a Θ ( n , G , α ) -sequence, S 1 , with rough left and right boundaries, a l and a r , a Θ ( n , G , α ) -sequences, S 2 with rough left and right boundaries, f l and f r , and an approximate distance, L, to the nearest motif boundary from those rough boundaries (the parameter, L, usually has the properties of LB ( S 1 ) [ a l L , a l ] , RB ( S 1 ) [ a r , a r + L ] , LB ( S 2 ) [ f l L , f l ] and RB ( S 2 ) [ f r , f r + L ] ).
Output: improved rough left and right boundaries for both S 1 and S 2 .
Steps:
    Find two subsequences, X 1 = S 1 [ a 1 , a 1 + d 0 log n 1 ] and X 2 = S 2 [ b 2 , b 2 + d 0 log n 1 ] ,
    with a 1 [ a l L , a l + L ] and b 2 [ f l L , f l + L ] , such that diff ( X 1 , X 2 ) β and a 1 is
    the least.
    Find two subsequences, X 1 = S 1 [ a 1 , a 1 + d 0 log n 1 ] and X 2 = S 2 [ b 2 , b 2 + d 0 log n 1 ] ,
    with a 1 [ a r L , a r + L ] and b 2 [ f r L , f r + L ] , such that diff ( X 1 , X 2 ) β and a 1 is
    the largest.
    Find two subsequences, Y 1 = S 1 [ e 1 , e 1 + d 0 log n 1 ] and Y 2 = S 2 [ f 2 , f 2 + d 0 log n 1 ] ,
    with e 1 [ a l L , a l + L ] and f 2 [ f l L , f l + L ] , such that diff ( Y 1 , Y 2 ) β and f 2 is
    the least.
    Find two subsequences, Y 1 = S 1 [ e 1 , e 1 + d 0 log n 1 ] and Y 2 = S 2 [ f 2 , f 2 + d 0 log n 1 ] ,
    with e 1 [ a r L , a r + L ] and f 2 [ f r L , f r + L ] , such that diff ( Y 1 , Y 2 ) β and f 2 is
    the largest.
    Return ( a 1 , a 1 , f 2 , f 2 ) .
End of Improve-Boundaries.
The function, Initial-Boundaries ( S 1 , S 2 ) , detects the motif boundaries for two sequences, S 1 and S 2 . It first detects rough motif boundaries that are controlled by parameter L. The rough boundaries will be improved to exact motif boundaries via calling Improve-Boundaries ( . ) . See the examples inSection 3.2.2., Section 3.2.3., Section 3.2.4., Section 3.2.5., Section 3.2.6., Section 3.2.7. and Section 3.2.8..
Initial-Boundaries ( S 1 , S 2 )
Input: a pair of Θ ( n , G , α ) -sequences, S 1 and S 2 .
Output: rough left boundary roughLeft S 1 of S 1 , right boundary roughRight S 1 of S 1 , rough left boundary roughLeft S 2 of S 2 and right boundary roughRight S 2 of S 2 .
Steps:
    Let U 1 = U 2 = .
    Let L = n 2 / 5 .
    Repeat.
        Let U 1 = Point-Selection ( S 1 , L , [ 1 , | S 1 | ] ) .
        Let U 2 = Point-Selection ( S 2 , L , [ 1 , | S 2 | ] ) .
        Let ( L S 1 , R S 1 , L S 2 , R S 2 ) = Collision-Detection ( S 1 , U 1 , S 2 , U 2 ) .
        If ( L S 1 and R S 1 ),
        then go to H.
        Else, L = L / 2 ,
    until ( L < 1 2 ( log n ) 3 + τ 100 ) .
    H: Return Improve-Boundaries ( S 1 , L S 1 , R S 1 , S 2 , L S 2 , R S 2 , 2 L ) .
End of Initial-Boundaries.
If L S and R S are the left and right motif boundaries of a sequence, S, then the motif length is R S L S + 1 . When we have the exact motif boundaries, L S i and R S i , for most sequences, S i , with high probability, their motif length can be derived via the median in i { R S i L S i + 1 } . Therefore, we have the function, Motif-Length-And-Boundaries( Z 1 ), to compute the length of the motif region.
Motif-Length-And-Boundaries( Z 1 )
Input: Z 1 = { S 1 , , S 2 k 1 } is a set of independent Θ ( n , G , α ) sequences.
Steps:
For i = 1 to k 1 ,
    let ( roughLeft S 2 i 1 , roughRight S 2 i ) =Initial-Boundaries ( S 2 i 1 , S 2 i ) .
Let L 1 be the median of i = 1 k 1 { ( roughRight S 2 i 1 roughLeft S 2 i 1 + 1 ) } .
Return L 1 .
End of Motif-Length-And-Boundaries.

4.2.2.. Extract-Phase of Algorithm Recover-Motif

After a set of motif candidates, W, is produced from Boundary-Phase of algorithm Recover-Motif, we use this set to match with another set of input sequences to recover the hidden motif by voting.
Match ( G l , G r , S i )
Input: a motif left part, G l (which can be derived from the rough left boundary of an input sequence, S), a motif right part, G r , and a sequence, S i , from the group, Z 2 , with known rough left and right boundaries.
Output: either a rough motif region of S i or an empty sequence, which means the failure in extracting the motif region, ( S i ) , of S i .
Steps:
    Find a position, a, in S i with roughLeft S i a roughLeft S i + ( v + u 2 ) ,
    such that G l and S i [ a , a + | G l | 1 ] are left matched (see Definition 9).
    Find a position, b, in S i with roughRight S i ( v + u 2 ) b roughRight S i ,
    such that G r and S i [ b | G r | + 1 , b ] are right matched (see Definition 9).
    If both a and b are found,
    then output S i [ a , b ] .
    Else, output (empty string).
End of Match.
If the left, G l , and right, G r , motif parts are known, we extract all the motif regions for all sequences in the set, Z 2 , by the function, Extract ( G l , G r , Z 2 ).
Extract ( G l , G r , Z 2 )
Input Z 2 = { S 1 , S 2 , , S k 2 } and left and right motif parts, G l and G r (see function Match ( G l , G r , S i ) ).
Steps:
    For each S i with i = 1 , 2 , , k 2 ,
        let G i = Match ( G l , G r , S i ) .
    Return ( G 1 , G 2 , , G k 2 ) .
End of Extract.
The following is Extract-Phase of algorithm Recover-Motif. It extracts the motif regions of another set, Z 2 , of input sequences. The function is based on the condition that exact motif boundaries can be derived for most sequences. See the examples in Section 3.2.9..
Extract-Phase( S , Z 2 ):
Input S is an input sequence with known roughLeft S and roughRight S for its rough left and right boundaries, respectively, and Z 2 = { S 1 , , S k 2 } is a set of input sequences.
Steps:
    For each subsequence G l = S [ a , a + d 0 log n 1 ] with a [ roughLeft S , roughLeft S + ( v + u 1 ) ]
    and G r = S [ b d 0 log n + 1 , b ] , with b [ roughRight S ( v + u 1 ) , roughRight S ] ,
        let ( G 1 , G 2 , , G k 2 ) be the output from Extract ( G l , G r , Z 2 ).
        If the number of empty sequences in G 1 , , G k 2 is at most ( Q 0 + ( R + 2 ϵ ) ) k 2 ,
        then return ( G 1 , G 2 , , G k 2 ) .
    Return (empty set).
End of Extract-Phase .

4.2.3.. Voting-Phase

The function, Vote ( G 1 , G 2 , , G k 2 ) , is to generate another sequence, G , by voting, where G [ i ] is the most frequent character among G 1 [ i ] , G 2 [ i ] , , G k 2 [ i ] . See the examples in Section 3.2.10..
Voting-Phase ( G 1 , G 2 , , G k 2 )
Input: Θ ( n , G , α ) sequences, G 1 , G 2 , , G k 2 , of the same length, m.
Output: a sequence, G , which is derived by voting on every position of the input sequences.
Steps:
    For each j = 1 , , m ,
        let a j be the most frequent character among G 1 [ j ] , , G k 2 [ j ] .
    Return G = a 1 a m .
End of Vote.

4.2.4.. Entire Algorithm Recover-Motif 

The entire algorithm is described below. The input has two sets of sequences, Z 1 and Z 2 . It detects the motif boundaries for the sequences in Z 1 via pairwise comparisons and, also, the motif length. The motif regions of the sequences in Z 2 are detected in the next phase and will be extracted. The original motif is recovered via voting for each column of characters among the extracted motif regions.
We maintain the sizes of Z 1 and Z 2 to be roughly equal, which implies:
| Z 1 | = Θ ( | Z 2 | )
Algorithm Recover-Motif (Z)
Input: Z = Z 1 Z 2 , where Z 1 = { S 1 , , S 2 k 1 } and Z 2 = { S 1 , , S k 2 } are two sets of input sequences.
Steps:
Preprocessing part:
For each S Z 1 Z 2 , let roughLeft S = roughRight S = 0 (the two boundaries are unknown).
l m o t i f = MotifLengthAndBoundaries( Z 1 ).
Let L = l m o t i f / 4 .
For i = 1 to k 1 ,
    let U S 2 i 1 = Point-Selection ( S 2 i 1 , L , [ roughLeft S 2 i 1 2 L , roughLeft S 2 i 1 + 2 L ] )
                Point-Selection ( S 2 i 1 , L , [ roughRight S 2 i 1 2 L , roughRight S 2 i 1 + 2 L ] ) .
For j = 1 to k 2 ,
    let U S j = Point-Selection ( S j , L , [ 1 , | S j | ] ) .
For i = 1 to k 1 ,
    for each S j Z 2 ,
        Let ( L S 2 i 1 , R S 2 i 1 , L S j , R S j ) = Collision-Detection ( S 2 i 1 , U S 2 i 1 , S j , U S j ) .
        Let ( L S 2 i 1 , R S 2 i 1 , roughLeft S j , roughRight S j ) =
            Improve-Boundaries ( S 2 i 1 , L S 2 i 1 , R S 2 i 1 , S j , L S j , R S j , 2 L ) .
    Let ( G 1 , G 2 , , G k 2 ) be the output from Extract-Phase( S 2 i 1 , Z 2 ).
    If ( G 1 , G 2 , , G k 2 ) is not empty,
    then go to the Voting part.
Voting part:
    Return Voting-Phase( G 1 , G 2 , , G k 2 ).
End of Algorithm Recover-Motif .

5. Deterministic Algorithm

In this section, we give a deterministic algorithm, which is a simplified version of the unified algorithm described before in Section 4.2. It is simpler than the randomized versions. The first phase of Algorithm Recover-Motif (.) finds the rough motif boundaries of all input sequences. It first detects the rough motif boundaries of one sequence via comparing two input sequences. Then, the rough boundaries of the first sequence are used to find the rough motif boundaries of other input sequences. We still let:
ω DETERMINISTIC SUPERQUADRATIC = β .
Collision-Detection ( S 1 , S 2 )
Input: a pair of Θ ( n , G , α ) -sequences, S 1 and S 2 ; U i is a set of locations in S i for i = 1 , 2 .
Output: the left and right rough boundaries of two sequences.
    Let D 1 be all subsequences, S 1 [ a , a + d 0 log n 1 ] , of S 1 of a length of d 0 log n with a [ 1 , | S 1 | ] .
    Let D 2 be all subsequences, S 2 [ b , b + d 0 log n 1 ] , of S 2 of a length of d 0 log n with b [ 1 , | S 2 | ] .
    Find two subsequences, X 1 = S 1 [ a 1 , a 1 + d 0 log n 1 ] D 1 and
     X 2 = S 2 [ b 1 , b 1 + d 0 log n 1 ] D 2 , such that a 1 is the least and diff ( X 1 , X 2 ) ω DETERMINISTIC SUPERQUADRATIC .
    Find two subsequences, X 1 = S 1 [ a 1 , a 1 + d 0 log n 1 ] D 1 and
     X 2 = S 2 [ b 1 , b 1 + d 0 log n 1 ] D 2 , such that a 1 is the largest and
     diff ( X 1 , X 2 ) ω DETERMINISTIC SUPERQUADRATIC .
    Find two subsequences, Y 1 = S 1 [ f 1 , f 1 + d 0 log n 1 ] D 1 and
     Y 2 = S 2 [ e 1 , e 1 + d 0 log n 1 ] D 2 , such that e 1 is the least and
     diff ( Y 1 , Y 2 ) ω DETERMINISTIC SUPERQUADRATIC .
    Find two subsequences, Y 1 = S 1 [ f 1 , f 1 + d 0 log n 1 ] D 1 and
     Y 2 = S 2 [ e 1 , e 1 + d 0 log n 1 ] D 2 , such that e 1 is the largest and
     diff ( Y 1 , Y 2 ) ω DETERMINISTIC SUPERQUADRATIC .
    Return ( a 1 , a 1 , e 1 , e 1 ) .
End of Collision-Detection.
Function Point-Selection ( S 1 , S 2 , L ) is not used in the deterministic algorithm.
Improve-Boundaries ( S 1 , a l , a r , S 2 , f l , f r , L ) is the same as that in the randomized algorithms.
Initial-Boundaries ( S 1 , S 2 )
Input: a pair of Θ ( n , G , α ) -sequences, S 1 and S 2 .
Output: rough left boundary roughLeft S 1 of S 1 , right boundary roughRight S 1 of S 1 , rough left boundary roughLeft S 2 of S 2 and right boundary roughRight S 2 of S 2 .
Steps:
    Let U 1 = U 2 = .
    Let L = n 2 / 5 .
    Repeat.
        Let ( L S 1 , R S 1 , L S 2 , R S 2 ) = Collision-Detection ( S 1 , S 2 ) .
        If ( L S 1 and R S 1 ),
        then go to H.
        Else, L = L / 2 ,
    until ( L < 1 2 ( log n ) 3 + τ 100 ) .
    H: Return Improve-Boundaries ( S 1 , L S l , R S 1 , S 2 , L S 2 , R S 2 , 2 L ) .
End of Initial-Boundaries.
Motif-Length-And-Boundaries( Z 1 ) is the same as that before.
Match ( G l , G r , S i ) is the same as that for the randomized algorithm.
Extract ( G l , G r , Z 2 ) is the same as that for the randomized algorithm.
The following is Extract-Phase of algorithm Recover-Motif. It extracts the motif regions of another set, Z 2 , of input sequences.
Extract-Phase( S , Z 2 ) is the same as that for the randomized algorithm.
Voting-Phase ( G 1 , G 2 , , G k 2 ) is the same as that for the randomized algorithm.
The entire deterministic algorithm is described below. We maintain the sizes of Z 1 and Z 2 to be roughly equal.
Algorithm Recover-Motif (Z)
Input: Z = Z 1 Z 2 , where Z 1 = { S 1 , , S 2 k 1 } and Z 2 = { S 1 , , S k 2 } are two sets of input sequences.
Steps:
Preprocessing part:
For each S Z 1 Z 2 , let roughLeft S = roughRight S = 0 (the two boundaries are unknown).
l m o t i f = MotifLengthAndBoundaries( Z 1 ).
Let L = l m o t i f / 4 .
For i = 1 to k 1 ,
    for each S j Z 2 ,
        let ( L S 2 i 1 , R S 2 i 1 , L S j , R S j ) = Collision-Detection ( S 2 i 1 , S j ) .
        Let ( L S 2 i 1 , R S 2 i 1 , roughLeft S j , roughRight S j ) =
            Improve-Boundaries ( S 2 i 1 , L S 2 i 1 , R S 2 i 1 , S j , L S j , R S j , 2 L ) .
    Let ( G 1 , G 2 , , G k 2 ) be the output from Extract-Phase( S 2 i 1 , Z 2 ).
    If ( G 1 , G 2 , , G k 2 ) is not empty,
    then go to the Voting part.
Voting part:
    Return Voting-Phase( G 1 , G 2 , , G k 2 ).
End of Algorithm Recover-Motif .

6. Analysis of the Algorithm

The correctness of the algorithm will be proven via a series of lemmas in Section 6.2 and Section 6.3. Section 6.2 is for Boundary-Phase and Section 6.3 is for Extract-Phase. Furthermore, Section 6.3 gives some lemmas for the two randomized algorithms, and Section 6.4 gives the proof for the deterministic algorithm.

6.1. Review of Some Classical Results in Probability

Some well-known results in classical probability theory are listed. The readers can skip this section if they understand them well. The inclusion of these results make the paper self-contained.
  • For a list of events, A 1 , , A m , Pr [ A 1 A 2 A m ] Pr [ A 1 ] + Pr [ A 2 ] + + Pr [ A m ] .
  • For two independent events, A and B, Pr [ A B ] = Pr [ A ] Pr [ B ] .
  • For a random variable, Y, Pr [ Y t ] E [ Y ] t for all positive real numbers, t. This is called Markov inequality.
The analysis of our algorithm employs the Chernoff bound [22] and Corollary 18 below, which can be derived from it (see [11]).
Theorem 15
([22]). Let X 1 , , X n be n independent random 0–1 variables, where X i takes one with a probability of p i . Let X = i = 1 n X i , and μ = E [ X ] . Then, for any δ > 0 :
i.
Pr ( X < ( 1 δ ) μ ) < e 1 2 μ δ 2 and
ii.
Pr ( X > ( 1 + δ ) μ ) < e δ ( 1 + δ ) ( 1 + δ ) μ .
We follow the proof of Theorem 15 to make the following version of the Chernoff bound, so that it can be used in our algorithm analysis.
Theorem 16.
Let X 1 , , X n be n independent random 0–1 variables, where X i takes one with a probability of at most p. Let X = i = 1 n X i . Then, for any δ > 0 , Pr ( X > ( 1 + δ ) p n ) < e δ ( 1 + δ ) ( 1 + δ ) p n .
Define g ( δ ) = e δ ( 1 + δ ) ( 1 + δ ) . We note that g ( δ ) is always strictly less than one for all δ > 0 and g ( δ ) is fixed if δ is a constant. This can be verified by checking that the function f ( x ) = ln e x ( 1 + x ) ( 1 + x ) = x ( 1 + x ) ln ( 1 + x ) is decreasing and f ( 0 ) = 0 . This is because f ( x ) = ln ( 1 + x ) , which is less than zero for all x > 0 .
Theorem 17.
Let X 1 , , X n be n independent random 0–1 variables, where X i takes one with a probability of at most p. Let X = i = 1 n X i . Then, for any δ > 0 , Pr ( X < ( 1 δ ) p n ) < e 1 2 p n δ 2 .
Corollary 18
([11]). Let X 1 , , X n be n independent random 0–1 variables, and X = i = 1 n X i .
i) If X i takes one with a probability of at most p, then for any 1 3 > ϵ > 0 , Pr ( X > p n + ϵ n ) < e 1 3 n ϵ 2 .
ii) If X i takes one with a probability of at least p, then for any ϵ > 0 , Pr ( X < p n ϵ n ) < e 1 2 n ϵ 2 .

6.2. Analysis of Boundary-Phase of Algorithm Recover-Motif

Lemma 19 shows that with only a small probability, a sequence can match a random sequence. It will be used to prove that when two substrings in two different Θ ( n , G , α ) -sequences are similar, they are unlikely not to coincide with the motif regions in the two Θ ( n , G , α ) -sequences, respectively.
Lemma 19.
Assume that X 1 and X 2 are two independent sequences of the same length and that every character of X 2 is a random character from Σ. Then:
i.
if 1 | X 1 | = | X 2 | < v , then the probability that X 1 and X 2 are matched is 1 t | X 1 | ( t = | | Σ | | ); and
ii.
the probability for diff ( X 1 , X 2 ) β is at most e ϵ 2 | X 1 | 3 .
Proof: 
The two statements are proven as follows.
Statement i: For every character, X 2 [ j ] , with 1 j < v , the probability is 1 t that X 2 [ j ] = X 1 [ j ] .
Statement ii: For every character, X 2 [ j ] , with 1 j | X 2 | , the probability is 1 t for X 2 [ j ] to equal X 1 [ j ] . If diff ( X 1 , X 2 ) β , the two sequences, X 1 and X 2 , are identical in at least ( 1 β ) | X 1 | positions, but the expected number of positions where the two sequences are identical is 1 t | X 1 | . The probability for diff ( X 1 , X 2 ) β is at most e ( 1 β 1 t ) 2 3 | X 1 | e ϵ 2 3 | X 1 | by Corollary 18, Definition and 9, items (xiv) and xii, equation (8) and inequality (2) in Definition 8.   ▮
Lemma 20 shows that with a small probability, an input Θ ( n , G , α ) sequence contains a motif region that has many mutations.
Lemma 20.
i.
With a probability of at most c t , a Θ ( n , G , α ) sequence, S, changes more than β 2 t characters in its motif region, ( S ) [ i , i + t 1 ] , with 1 i i + t 1 | G | , where c is defined in item (v) in Definition 8.
ii.
With a probability of at most c y 1 c , a Θ ( n , G , α ) sequence, S, changes more than β 2 t characters in its left motif region, ( S ) [ 1 , t ] , for some t with y t | G | , where c is defined in item (v) in Definition 8.
Proof: 
Statement i: Every character in the ( S ) region has a probability of at most α to mutate. We know that | ( S ) | = | G | d . By Corollary 18, with a probability of at most e ϵ 2 3 t , ( S ) [ i , i + t 1 ] has more than ( α + ϵ ) t mutations.
Statement ii: We know that | ( S ) | = | G | d . By Corollary 18, with a probability of at most e ϵ 2 3 t , a sequence, S, in Z 1 has more than ( α + ϵ ) t mutations (recall the setting for β in Definition 9) among the first left t characters. The total probability is at most t = y e ϵ 2 3 t = c y 1 c .   ▮
Lemma 21 shows that Improve-Boundaries() has a good chance to improve the accuracy of rough motif boundaries. Note that LB ( S ) and RB ( S ) are the left and right motif boundaries of S, respectively (see Definition 11).
Lemma 21.
Assume that Θ ( n , G , α ) sequence S i has L S i [ LB ( S i ) L , LB ( S i ) + L ] and R S i [ RB ( S i ) L , RB ( S i ) + L ] for i = 1 , 2 . Then, for ( roughLeft S 1 , roughRight S 1 , roughLeft S 2 , roughRight S 2 ) =Improve-Boundaries ( S 1 , L S 1 , R S 1 , S 2 , L S 2 , R S 2 , L ) , we have the following two facts:
i.
with a probability of at most 2 c v 1 c + 2 ( v + u ) c v + u ( 1 c ) 2 + 1 5 · 2 x n ; roughLeft S i is not in [ LB ( S i ) ( v + u ) , LB ( S i ) ] for i = 1 , 2 .
ii.
with a probability of at most 2 c v 1 c + 2 ( v + u ) c v + u ( 1 c ) 2 + 1 5 · 2 x n , roughRight S i is not in [ RB ( S i ) , RB ( S i ) + ( v + u ) ] for i = 1 , 2 .
iii.
Improve-Boundaries ( S 1 , L S 1 , R S 1 , S 2 , L S 2 , R S 2 , L ) runs in O ( L 2 log n ) time.
Proof: 
We need a bound for the following inequality:
i = j i a i < j a j ( 1 a ) 2
Let f ( x ) = i = j e θ i x . Compute the derivative f ( x ) = θ i = j i e θ i x . We also have the closed form for the function f ( x ) = e θ j x 1 e θ x , which implies:
f ( x ) = θ j e θ j x ( 1 e θ x ) e θ j x ( θ e θ x ) ( 1 e θ x ) 2
= θ j e θ j x θ ( j 1 ) e θ ( j + 1 ) x ( 1 e θ x ) 2
Let θ = ln a and x = 1 . We have i = j i a i = j a j ( j 1 ) a j + 1 ( 1 a ) 2 < j a j ( 1 a ) 2 .
Statement i. By Lemma 20, with a probability of at most 2 c v 1 c , one of the left motif first y character region of S i will change β 2 y characters. Therefore, with a probability of at most P 1 = 2 c v 1 c , roughLeft S i > LB ( S i ) .
For a pair of positions, p, in S 1 , and q, in S 2 , without loss of generality, assume that p has a larger distance to the left boundary LB ( S 1 ) of S 1 than q to the left boundary LB ( S 2 ) of S 2 . Let v + y be the distance from p to the left boundary LB ( S 1 ) of S 1 .
By Lemma 19, the probability is at most c v + y that there will be a match. There are at most ( v + y ) cases for q. With a probability of at most P 2 = 2 y = u ( v + y ) c v + y < 2 ( v + u ) c v + u ( 1 c ) 2 , by inequality (20), roughLeft S 1 < L B ( S 1 ) ( v + u ) .
For the cases that one position is in a random region and has a distance more than d 0 log n from the left boundary, the probability is at most P 3 = n 2 c d 0 log n < 1 5 · 2 x n by inequality (14).
Therefore, we have a total probability of at most P 1 + P 2 + P 3 that roughLeft S 1 is not in [ LB ( S 1 ) ( v + u ) , LB ( S 1 ) ] .
Statement ii. One can also provide a symmetric analogous proof for this statement.
Statement iii. The computation time easily follows from the implementation of Improve-Boundaries ( S 1 , L S 1 , R S 1 , S 2 , L S 2 , R S 2 ) .   ▮
Lemma 22.
Assume that for each L with 0 < L | G | 2 , with a probability of at most ς ( n ) , L S i [ LB S i L , LB S i + L ] for i = 1 , 2 , where ( L S 1 , R S 1 , L S 2 , R S 2 ) = Collision-Detection( S 1 , U 1 , S 2 , U 2 ) , U 1 = Point-Selection ( S 1 , L ) and U 2 = Point-Selection ( S 2 , L ) . Then, with a probability of at most ς ( n ) + 2 ( v + u 1 ) c v + u 1 ( 1 c ) 2 + c v 1 c + 1 5 · 2 x n , Initial-Boundary ( S 1 , S 2 ) returns ( L S 1 , R S 1 , L S 2 , R S 2 ) with L S i [ LB ( S i ) ( v + u 1 ) , LB ( S i ) ] or R S i [ RB ( S i ) , RB ( S i ) + ( v + u 1 ) ) ] for i = 1 , 2 .
Proof: 
It follows from Lemma 21:   ▮
Lemma 23.
Assume that with a probability of p < 0.5 , each S 2 i 1 has its rough boundaries, roughLeft S 2 i 1 [ LB ( S 2 i 1 ) u , LB ( S 2 i 1 ) ] or roughRight S 2 i 1 [ RB ( S 2 i 1 ) , RB ( S 2 i 1 ) + u ] ; then, with a probability of at most e ( 0.5 p ϵ ) 2 k 1 / 3 , l m o t i f is not in [ | G | 2 u , | G | + 2 u ] , where l m o t i f is selected as the median of i = 1 k 1 { ( roughRight S 2 i 1 roughLeft S 2 i 1 ) } .
Proof: 
If both roughLeft S 2 i 1 [ LB ( S 2 i 1 ) u , LB ( S 2 i 1 ) ] and roughRight S 2 i 1 [ RB ( S 2 i 1 ) , RB ( S 2 i 1 ) + u ] , then ( roughRight S 2 i 1 roughLeft S 2 i 1 ) is in [ | G | 2 u , | G | + 2 u ] .
If the median of i = 1 k 1 { ( roughRight S 2 i 1 roughLeft S 2 i 1 ) } is not in [ | G | 2 u , | G | + 2 u ] , then there are at least k 1 numbers, i, to have roughLeft S 2 i 1 [ LB ( S 2 i 1 ) u , LB ( S 2 i 1 ) ] or roughRight S 2 i 1 [ RB ( S 2 i 1 ) , RB ( S 2 i 1 ) + u ] .
On the other hand, the probability is at most p, roughLeft S 2 i 1 [ LB ( S 2 i 1 ) u , LB ( S 2 i 1 ) ] or roughRight S 2 i 1 [ RB ( S 2 i 1 ) , RB ( S 2 i 1 ) + u ] . Therefore, this lemma follows from Corollary 18.   ▮
For a Θ ( n , G , α ) -sequence S, we often obtain its left rough boundary with roughLeft S LB ( S ) . Sometimes, its exact left boundary may be missed in the algorithm.
Definition 24.
  • A Θ ( n , G , α ) -sequence, S, misses its left boundary if roughLeft S > LB ( S ) .
  • A Θ ( n , G , α ) -sequence, S, misses its right boundary if roughRight S < RB ( S ) .
Definition 25.
i.
A Θ ( n , G , α ) -sequence, S, contains a left half stable motif region, ( S ) , if diff ( G [ 1 , h ] , G [ 1 , h ] ) β 2 for all h = v , v + 1 , , m , where G = ( S ) , and m = | G | , as defined in Definition 8 and Section 2, respectively.
ii.
A Θ ( n , G , α ) -sequence, S, contains a right half stable motif region, ( S ) , if diff ( G [ m h , m ] , G [ m h , m ] ) β 2 for h = v 1 , v + 1 , , m 1 , where G = ( S ) and m = | G | .
iii.
A Θ ( n , G , α ) -sequence, S, contains a stable motif region, ( S ) , satisfying the following conditions: (1) G [ i ] = G [ i ] for i = 1 , , v 1 ; (2) G [ m i + 1 ] = G [ m i + 1 ] for i = 1 , , v 1 ; and (3) the S motif region is both left and right half stable, where G = ( S ) and m = | G | .
Definition 26.
Assume that:
  • l m o t i f [ | G | 2 ( v + u 1 ) , | G | + 2 ( v + u 1 ) ] ;
  • Scontains both a left half and a right half stable motif region and roughLeft S [ LB ( S ) ( v + u 1 ) , LB ( S ) ] and roughRight S [ RB ( S ) , RB ( S ) + ( v + u 1 ) ] (see Definition 8 for u 1 and v); and
  • for each L with ( v + u 1 ) < L | G | 2 , if S 1 has roughLeft S 1 [ LB S 1 L , LB S 1 + L ] and roughRight S 1 [ RB S 1 L , RB S 1 + L ] , then with a probability of at most ς ( n ) , L S i [ LB S i 2 L , LB S i + 2 L ] for i = 1 , 2 , where ( L S 1 , R S 1 , L S i , R S i ) = Collision-Detection( S 1 , U 1 , S i , U 2 ) , U 1 = Point-Selection ( S 1 , L , [ roughLeft S 1 2 L , roughLeft S 1 + 2 L ] ) Point-Selection ( S 1 , L , [ roughRight S 1 2 L , roughRight S 1 + 2 L ] ) and U 2 = Point-Selection ( S i , L , [ 1 , | S i | ] ) .
  • The rough boundaries for all sequences, S i Z 2 , are computed via ( L S , R S , L S i , R S i ) = Collision-Detection ( S , U S , S i , U S i ) and ( L S , R S , roughLeft S i , roughRight S i ) = Improve-Boundaries ( S , L S , R S , S i , L S i , R S i , 2 L ) .
Then, with a probability of at most e ϵ 2 k 2 3 , there are more than ( 2 ( ς ( n ) + ( v + u 1 ) c v + u 1 c + c v 1 c ) + ϵ ) k 2 sequences S i in { S 1 , , S k 2 } with roughLeft ( S i ) [ LB ( S i ) ( v + u ) , LB ( S i ) ] or roughRight ( S i ) [ RB ( S i ) , RB ( S i ) + ( v + u ) ] .
Proof: 
According to the condition of this lemma, with a probability of at most P 1 = ς ( n ) , L S i [ LB S i 2 L , LB S i + 2 L ] , where ( L S , R S , L S i , R S i ) = Collision-Detection( S , U 1 , S i , U 2 ) and ( U 1 , U 2 ) = Point-Selection ( S , S i , L ) .
For a fixed pattern from S, by Lemma 19, with a probability of at most y = v + u c y = c v + u 1 c , it has a distance of more than v + u to the true left boundary. As we need to deal with v + u 1 possible patterns from S, with a probability of at most P 2 , l = ( v + u 1 ) · c v + u 1 c , roughLeft S i < LB ( S i ) ( v + u ) .
Similarly, with a probability of at most P 2 , r = ( v + u 1 ) c v + u 1 c , roughRight S i > RB ( S i ) + ( v + u ) . Let P 2 = P 2 , l + P 2 , r .
With a probability of at most P 3 , l = c v 1 c , S i does not contain a left half stable motif region by Lemma 20. Similarly, with a probability of at most P 3 , r = c v 1 c , S i does not contain a right half stable motif region. Let P 3 = P 3 , l + P 3 , r .
Although, S is involved in searching the left boundary with all other sequences. The non-missing condition is to let each sequence not change too many characters in the motif region. Therefore, this is an independent event for each sequence. It is safe to use the Chernoff bound to deal with it.
With a probability of at most P = e ϵ 2 k 2 3 , there are more than ( P 1 + P 2 + P 3 + ϵ ) k 2 sequences, S i , in { S 1 , , S k 2 } with roughLeft ( S i ) [ LB ( S i ) ( v + u ) , LB ( S i ) ] or roughRight ( S i ) [ RB ( S i ) , RB ( S i ) + ( v + u ) ] .   ▮

6.3. Analysis of Extract-Phase and Voting-Phase of Algorithm Recover-Motif

Lemma 27 shows that with a high probability, the left and last parts of the motif region in a Θ ( n , G , α ) -sequence do not change much.
Lemma 27.
With a probability of at most Q 0 defined in Equation (13), a Θ ( n , G , α ) -sequence, S, does not contain a stable motif region.
Proof: 
The probability is V 1 = 2 ( v 1 ) α not to satisfy conditions (1) and (2) of item (iii) in Definition 25. Consider condition (3) of item (iii) in Definition 25. Since every character of ( S ) [ 1 , m ] (notice that m = | G | ) has a probability of at most α to mutate, by Corollary 18, the probability is at most e 1 3 ϵ 2 r that diff ( G [ 1 , h ] , G [ 1 , h ] ) > β 2 = α + ϵ . Let V 3 = r = v e 1 3 ϵ 2 r = c v 1 c , where c = e 1 3 ϵ 2 , as defined in Definition 8. Therefore, the probability is at most V 3 that diff ( G [ 1 , h ] , G [ 1 , h ] ) > β 2 = α + ϵ for some h { v , v + 1 , , m } . Similarly, we define V 4 = r = v e 1 3 ϵ 2 r c v 1 c for the probability on the right-hand side. The probability is at most V 4 that diff ( G [ m h , m ] , G [ m h , m ] ) > β 2 = α + ϵ for some h { v , v + 1 , , m } . The probability that S does not contain a stable motif region is at most V 1 + V 3 + V 4 = Q 0 .   ▮
Definition 28.
Assume that Z 1 = { S 1 , , S 2 k 1 } contains S 2 i 1 , which contains a stable motif region. We fix such a S 2 i 1 .
  • Define G L = ( S 2 i 1 ) [ 1 , d 0 log n 1 ] to be the left part of the motif region, ( S 2 i 1 ) .
  • Define G R = ( S 2 i 1 ) [ | G | ( d 0 log n ) + 1 , | G | ] to be the right part of the motif region, ( S 2 i 1 ) .
Lemma 29 shows that with a high probability, Extract-Phase of algorithm Recover-Motif extracts the correct motif regions from the sequences in Z 1 . It uses G to match ( S ) in another sequences, S. The parameter, R, gives a small probability that the matched region between G and S is not in ( S ) .
Lemma 29.
i.
Assume that G l and G r are fixed sequences of length d 0 log n . Let S be a Θ ( n , G , α ) -sequence with M = Match ( G l , G r , S ) , and let w 0 be the number of characters of M that are not in the region of ( S ) . Then, the probability is at most R that w 0 1 , where R is defined in (xv) of Definition 8.
ii.
The probability is at most Q 0 that given a Θ ( n , G , α ) -sequence S, Match ( G L , G R , S ) = .
Proof: 
Assume that w 0 1 . Let w be the number of characters outside of ( S ) on the left of M, and let w be the number of characters outside of ( S ) on the right of M. Clearly, w 0 = w + w . Since w 0 1 , either w 1 or w 1 . See Figure 1. Without loss of generality, we assume w 1 .
Figure 1. G and M.
Figure 1. G and M.
Algorithms 06 00636 g001
Statement i: There are two cases.
Case (a): 1 w < v . By Lemma 19, the probability for this case is at most 1 t for a fixed w. The total probability for this case for 1 w < v is at most i = 1 v 1 1 t i i = 1 1 t i = 1 t 1 .
Case (b): v w . By Lemma 19, the probability is at most e ϵ 2 3 w for a fixed w. The total probability for v w is at most w = v e ϵ 2 3 w = c v 1 c .
The probability analysis is similar when w 1 . Therefore, the probability for this case is at most R = ( 1 t 1 + c v 1 c ) for w 0 1 .
Statement ii: By Lemma 27, with a probability of at most Q 0 , S does not contain a stable motif region. Therefore, we have a probability of at most Q 0 that given a random Θ ( n , G , α ) -sequence, S, Match ( G L , G R , S ) = .   ▮
Lemma 30 shows that we can use G l and G r to extract most of the motif regions for the sequences in Z 2 if G = G L (recall that G L is defined right after Lemma 27).
Lemma 30.
Assume that G l and G r are two sequences of a length of d 0 log n , and G i = Match ( G l , G r , S i ) for S i Z 2 = { S 1 , , S k 2 } and i = 1 , , k 2 (recall that each sequence, G i , is either an empty sequence or a sequence of the length of | G l | ).
i.
If G l = G L , G r = G R and there are no more than y k 2 ( y [ 0 , 1 ] ) sequences, S i , with roughLeft S i [ LB ( S i ) ( v + u 2 ) , LB ( S i ) ] or roughRight S i [ RB ( S i ) , RB ( S i ) + ( v + u 2 ) ] , then the probability is at most e ϵ 2 k 2 3 that there are more than ( Q 0 + y + ϵ ) k 2 sequences, G i , with G i = .
ii.
For arbitrary G l and G r , with a probability of at most e ϵ 2 k 2 3 , | { i | G i and G i ( S i ) , i = 1 , , k 2 } | > ( R + ϵ ) k 2 , where R is defined in Definition 8.
Proof: 
Recall that sequence G 1 L is selected right after Lemma 27.
Statement i: By Lemma 29, for every S i Z 2 , the probability is at most Q 0 that S i does not contain a stable motif region, ( S i ) . By Corollary 18, we have a probability of at most e ϵ 2 k 2 3 that there are more than ( Q 0 + y + ϵ ) k 2 sequences, G i , with G i = .
Statement ii: By Lemma 29, the probability is at most R that G i ( S i ) . By Corollary 18, with a probability of at most e ϵ 2 k 2 3 , | { i | G i ( S i ) , i = 1 , , k 2 } | > ( R + ϵ ) k 2 .   ▮
Definition 31.
  • Given two sequences, G r and G r , define:
    M ( G r , G r ) = { G i : G i = Match ( G l , G r , roughLeft S i , roughRight S i , S i ) i = 1 , , k 2 } .
  • For a Θ ( n , G , α ) sequence, S, define G S , L to be the ( S ) [ 1 , d 0 log n ] , which is the leftmost subsequence of a length of d 0 log n in the motif region of S.
  • For a Θ ( n , G , α ) sequence, S, define G S , R to be the ( S ) [ m d 0 log n + 1 , m ] , which is the rightmost subsequence of a length of d 0 log n in the motif region of S, where m = | G | = | ( S ) | ;
the condition iv of Lemma 32.
Lemma 32.
Assume that we have the following conditions:
i.
For each L with 0 < L | G | 2 , with a probability of at most ς 1 ( n ) , L S i [ LB S i 2 L , LB S i + 2 L ] or R S i [ RB S i 2 L , RB S i + 2 L ] for i = 1 , 2 , where ( L S 1 , R S 1 , L S 2 , R S 2 ) = Collision-Detection( S 1 , U 1 , S 2 , U 2 ) , U 1 = Point-Selection ( S 1 , L , [ 1 , | S 1 | ] ) and U 2 = Point-Selection ( S 2 , L , [ 1 , | S 2 | ] ) .
ii.
For each L with 0 < L | G | 2 , if S 1 has roughLeft S 1 [ LB S 1 L , LB S 1 + L ] and roughRight S 1 [ RB S 1 L , RB S 1 + L ] , then with a probability of at most ς 2 ( n ) , L S i [ LB S i 2 L , LB S i + 2 L ] for i = 1 or i = 2 , where ( L S 1 , R S 1 , L S i , R S i ) = Collision-Detection( S 1 , U 1 , S i , U 2 ) , U 1 = Point-Selection ( S 1 , L , [ roughLeft S 1 2 L , roughLeft S 1 + 2 L ] ) Point-Selection ( S 1 , L , [ roughRight S 1 2 L , roughRight S 1 + 2 L ] ) and U 2 = Point-Selection ( S i , L , [ 1 , | S i | ] ) .
iii.
The inequality ( P 0 + Q 0 ) < c 0 holds for some constant c 0 < 1 , where Q 0 is defined in Equation (13) and P 0 = ς 1 ( n ) + 2 ( v + u 1 ) c v + u 1 ( 1 c ) 2 + c v 1 c + 1 5 · 2 x n .
iv.
The inequality 1 2 ( Q 0 + V 0 + ( R + 2 ϵ ) ) ( α + ϵ ) > 0 holds, where V 0 = ( 2 ( ς 2 ( n ) + ( v + u 1 ) c v + u 2 1 c + c v 1 c ) + ϵ ) .
Then, the algorithm generates a set of at most k 2 subsequences for voting and votes for a sequence, G , such that:
(1) with a probability of at most e Ω ( k 1 ) + e Ω ( k 2 ) , | G | | G | ; and
(2) for each 1 i | G | , with a probability of at most e Ω ( k 1 ) + e Ω ( k 2 ) , G [ i ] G [ i ] .
Before proving Lemma 32, we note that both ς 1 ( n ) and ς 2 ( n ) are at most 1 2 x n 3 for all of the three algorithms. They will be proven by Lemma 47 and Lemma 46 for the case algorithm-type=RANDOMIZED-SUBLINEAR, Lemma 41 and Lemma 40 for the case algorithm-type=RANDOMIZED-SUBQUADRATIC, and Lemma 35 for the case algorithm-type=DETERMINISTIC-SUPERQUADRATIC.
Proof: 
 
By Lemmas 22, with a probability of at most P 0 = ς 1 ( n ) + 2 ( v + u 1 ) c v + u 1 ( 1 c ) 2 + c v 1 c + 1 5 · 2 x n , roughLeft S 2 i 1 [ LB ( S 2 i 1 ) ( v + u 1 ) , LB ( S 2 i 1 ) ] or roughRight S 2 i 1 [ RB ( S 2 i 1 ) , RB ( S 2 i 1 ) + ( v + u 1 ) ] .
By Lemma 23, with a probability of at most P a = e ( 0.5 P 0 ϵ ) 2 k 1 / 3 = e Ω ( k 1 ) , the approximate motif length, l m o t i f , is not in the range [ | G | 2 ( v + u 1 ) , | G | + 2 ( v + u 1 ) ] . Assume l m o t i f [ | G | 2 ( v + u 1 ) , | G | + 2 ( v + u 1 ) ] in the rest of the proof of this lemma.
By Lemma 27, with a probability of at most Q 0 , a Θ ( n , G , α ) sequence does not contain a stable motif region. Therefore, with a probability of at most P 1 = ( P 0 + Q 0 ) k 1 , the following statement is false:
(i) One of S 2 i 1 for i = 1 , , k 1 has roughLeft S 2 i 1 [ LB ( S 2 i 1 ) ( v + u 1 ) , LB ( S 2 i 1 ) ] , roughRight S 2 i 1 [ RB ( S 2 i 1 ) , RB ( S 2 i 1 ) + ( v + u 1 ) ] and has a stable motif region.
By Lemma 26, with a probability of at most P 2 = e ϵ 2 k 2 3 , there are more than ( 2 ( ς 2 ( n ) + ( v + u 1 ) c v + u 2 1 c + c v 1 c ) + ϵ ) k 2 sequences S i with roughLeft S i [ LB ( S i ) ( v + u 2 ) , LB ( S i ) ] or roughRight S i [ RB ( S i ) , LB ( S i ) + ( v + u 2 ) ] . In other words, with a probability of at most P 2 , the following statement is false:
(ii) There are no more than V 0 k 2 sequences S i with roughLeft S i [ LB ( S i ) ( v + u 2 ) , LB ( S i ) ] or roughRight S i [ RB ( S i ) , RB ( S i ) + ( v + u 2 ) ] , where V 0 = ( 2 ( ς 2 ( n ) + ( v + u 1 ) c v + u 2 1 c + c v 1 c ) + ϵ ) .
Assume that Statement (ii) is true. By Lemma 30, with a probability of at most P 3 = c k 2 , the following statement is false:
(iii) M ( G L , G R ) contains at most ( Q 0 + V 0 + ϵ ) k 2 empty sequences.
We start from the rough left boundary, roughLeft 1 , of S 1 to match the other left boundaries of S i for i = 1 , , k 2 . There are in total at most 2 ( v + u 1 ) candidates to consider.
By Lemma 30, if M ( G l , G r ) , which consists of k 2 matched regions, has at most ( Q 0 + V 0 + ϵ ) k 2 empty sequences, then it has more than ( R + ϵ ) k 2 from non-motif regions with a probability of at most P 4 = 2 ( v + u 1 ) e ϵ 2 k 2 3 . After the pattern is fixed, those events in the matching are considered to be independent of each other. This is why we can apply the Chernoff bound to deal with them. Therefore, the probability is at most P 4 ; the following statement is false:
(iv) If M ( G l , G r ) contains at most ( Q 0 + V 0 + ϵ ) k 2 empty sequences, then M ( G l , G r ) contains at most ( Q 0 + V 0 + ϵ + ( R + ϵ ) ) k 2 = ( Q 0 + V 0 + ( R + 2 ϵ ) ) k 2 elements not from motif regions { ( S i ) : 1 i k 2 } .
Therefore, with a probability of at most P a + P 1 + P 2 + P 3 + P 4 = e Ω ( k 1 ) + e Ω ( k 2 ) , the sequences are not ready for voting in the next phase, which means the following two conditions are satisfied:
(a) There exists G l and G r generated by the algorithm, such that M ( G l , G r ) contains at most ( Q 0 + V 0 + ( R + 2 ϵ ) ) k 2 elements not from motif regions { ( S i ) : 1 i k 2 } .
(b) For every G l and G r that M ( G l , G r ) contains at most ( Q 0 + V 0 + ϵ ) k 2 empty sequences generated by the algorithm, M ( G l , G r ) contains at most ( Q 0 + V 0 + ϵ + ( R + ϵ ) ) k 2 = ( Q 0 + V 0 + ( R + 2 ϵ ) ) k 2 elements not from motif regions { ( S i ) : 1 i k 2 } .
Statement (1): For a M ( G l , G r ) with at most ( Q 0 + V 0 + ( R + 2 ϵ ) ) k 2 elements not from motif regions { ( S i ) : 1 i k 2 } , we still have k 2 ( Q 0 + V 0 + ( R + 2 ϵ ) ) k 2 elements in M ( G l , G r ) from motif regions { ( S i ) : 1 i k 2 } . By the condition (iv) in this lemma, we have k 2 ( Q 0 + V 0 + ( R + 2 ϵ ) ) k 2 > ( Q 0 + V 0 + ( R + 2 ϵ ) ) k 2 . Therefore, | G | is selected to be the length of G in the Voting-Phase().
Statement (2): For a M ( G l , G r ) = { G 1 , , G k 2 } with at most ( Q 0 + V 0 + ( R + 2 ϵ ) ) k 2 elements not from motif regions { ( S i ) : 1 i k 2 } , we still have k 2 ( Q 0 + V 0 + ( R + 2 ϵ ) ) k 2 elements in M ( G l , G r ) from motif regions { ( S i ) : 1 i k 2 } . By Corollary 18, with a probability of at most e ϵ 2 k 2 3 , there are more than ( α + ϵ ) k 2 characters that are mutated in the same position among all k 2 motif regions for the sequences in Z 2 . We have that k 2 ( Q 0 + V 0 + ( R + 2 ϵ ) ) k 2 ( α + ϵ ) k 2 > ( Q 0 + V 0 + ( R + 2 ϵ ) ) k 2 by the condition (iv) in this lemma. We let G [ j ] be the most frequent character among G 1 [ j ] , , G k 2 [ j ] in Voting-Phase. Therefore, with a probability of at most e Ω ( k 1 ) + e Ω ( k 2 ) , G [ j ] G [ j ] .   ▮
We will use multiple variable functions to characterize the computational time for three algorithms. In order to unify the complexity analysis of three algorithms, we introduce the following notation.
Definition 33.
A function, T ( x , y ) : N × N N , is nondecreasing if it is nondecreasing on both variables. If for arbitrary positive constants, c 1 and c 2 , T ( c 1 x , c 2 y ) c T ( x , y ) for some positive constant, c, then T ( x , y ) is slow.
Lemma 34.
Assume that t ( x , y ) , s ( n , L ) and g ( n , l ) are non-decreasing slow functions.Assume that Collision-Detection( S 1 , U 1 , S 2 , U 2 ) returns the result in t ( n , | | U 1 | | + | | U 2 | | ) time and the Point-Selection( S 1 , S 2 , L ) ) selects s ( n , L ) positions in g ( n , L ) time. Assume that with a probability of at most φ ( n ) , the function Initial-Boundaries() does not stop when L | G | / 4 , and | | U S 2 i 1 | | + | | U S j | | in the algorithm Recover-Motif is no more than f ( n , | G | ) .
Then, with a probability of at most k 1 φ ( n ) , the entire algorithm Recover-Motif does not stop in the time complexity ( O ( k 1 ( i = 1 i 0 ( t ( n , s ( n , n 2 i n 2 / 5 ) ) + g ( n , n 2 i 0 n 2 / 5 ) ) ) + k 1 h 2 log n + k 1 k 2 t ( n , f ( n , | G | ) ) + h 2 log n ) + k 1 k 2 ( log n ) ( log log n ) ) , O ( k 2 ) ) , where i 0 is the largest j, such that n 2 j n 2 / 5 min ( n 2 / 5 , | G | ) and h = min ( n 2 / 5 , | G | ) .
Proof: 
The function Initial-Boundaries()is executed k 1 times. According to the condition that with a probability of at most φ ( n ) , the function Initial-Boundaries(.) does not stop when L | G | / 4 , we have the fact that with a probability of at most k 1 φ ( n ) , one of those executions of Initial-Boundaries(.) does not stop when L | G | / 4 .
In the rest of the proof, we assume that all executions of Initial-Boundaries(.) stops when L | G | / 4 .
When L = O ( h ) , we detect rough left and right motif boundaries and run Improve-Boundaries(), which takes O ( h 2 log n ) time by Lemma 21. It takes O ( i = 1 i 0 ( t ( n , s ( n , n 2 i n 2 / 5 ) ) + g ( n , n 2 i n 2 / 5 ) + h 2 log n ) time to run Initial-Boundaries( S 2 i 1 , S 2 i ) one time for one pair ( S 2 i 1 , S 2 i ) in Z 1 . It takes O ( k 1 ( i = 1 i 0 ( t ( n , s ( n , n 2 i n 2 / 5 ) ) + g ( n , n 2 i n 2 / 5 ) + k 1 h 2 log n ) time to run Initial-Boundaries( S 2 i 1 , S 2 i ) one time for all pairs ( S 2 i 1 , S 2 i ) in Z 1 .
It takes k 2 ( t ( n , f ( n , | G | ) ) + h 2 log n ) time to find the rough boundaries for all sequences in Z 2 with a fixed sequence, S, from Z 1 by executing for the loop “For each S j Z 2 ” in the algorithm Recover-Motif. It takes k 1 k 2 ( t ( n , f ( n , | G | ) ) + h 2 log n ) time to find the rough boundaries for all sequences in Z 2 via all sequences, S 2 i 1 , from Z 1 through the loop “For each S j Z 2 ” in the algorithm Recover-Motif.
Recall that parameters v and u 1 are constants, and u 2 is O ( log log n ) . Calling Match( G l , G r , S i ) takes O ( ( v + u 2 ) log n ) time for each S i Z 2 . The total times for calling Match( G l , G r , S i ) is O ( k 1 k 2 ( v + u 1 ) ( v + u 2 ) log n ) = O ( k 1 k 2 ( log n ) ( log log n ) ) .
The voting part takes O ( k 2 ) time for executing voting for recovering one character in the motif.   ▮

6.4. Deterministic Algorithm for an Ω ( 1 ) Mutation Rate

In this section, we give a deterministic algorithm for the case with an Ω ( 1 ) mutation rate. The performance of the algorithm is stated in Theorem 6.
Lemma 35.
Let algorithm-type=DETERMINISTIC-SUPERQUADRATIC. Assume that d 0 log n L | G | / 2 and c 0 log n | G | . Let I 1 be a set of intervals of the positions of S 1 that satisfies [ LB ( S 1 ) L , LB ( S 1 ) + L ] [ RB ( S 1 ) L , RB ( S 1 ) + L ] I I 1 I . Let I 2 be a set of intervals of the positions of S 2 that satisfies [ LB ( S 2 ) L , LB ( S 2 ) + L ] [ RB ( S 2 ) L , RB ( S 2 ) + L ] I I 2 I . Let U 1 = Point-Selection ( S 1 , L , I 1 ) , U 2 = Point-Selection ( S 2 , L , I 2 ) and ( L S 1 , R S 1 , L S 2 , R S 2 ) = Collision-Detection ( S 1 , U 1 , S 2 , , U 2 ) . Then:
i.
with a probability of at most 1 2 x n 3 , the left rough boundary, L S 1 , has at most d 0 log n distance from LB ( S 1 ) and the left rough boundary L S 2 has at most d 0 log n distance from LB ( S 2 ) .
ii.
with a probability of at most 1 2 x n 3 , the right rough boundary, R S 1 , has at most d 0 log n distance from RB ( S 1 ) and the right boundary of R S 2 has at most d 0 log n distance from RB ( S 2 ) .
Proof: 
For two sequences, S 1 and S 2 , let ( S a ) be the subsequence, S a [ i a , j a ] , for a = 1 , 2 . By Corollary 18, with a probability of at most P l = 2 c d 0 log n 2 5 · 2 x n 3 (see inequality (8) in Definition 14), there are more than ( α + ϵ ) d 0 log n mutations in S a [ i a , i a + d 0 log n 1 ] for a = 1 , 2 .
With a probability of at most P l , the left boundary position is missed during the matching. We have similar P r = P l to miss the right boundary.
Assume that p 1 and p 2 are two positions of S 1 and S 2 , respectively. If one of two positions is outside the motif region and has more than d 0 log n distance to the motif boundary, with a probability of at most c d 0 log n 1 5 · 2 x n 3 (see inequality (8) in Definition 14), for them to match requires diff ( Y 1 , Y 2 ) β by Lemma 19, where Y a is a subsequence S a [ p a , p a + d 0 log n 1 ] for a = 1 , 2 .   ▮
Lemma 36.
For the case algorithm-type=DETERMINISTIC-SUPERQUADRATIC, we have:
i.
Collision-Detection( S 1 , U 1 , S 2 , U 2 ) takes t ( n , | | U 1 | | + | | U 2 | | ) = O ( ( | | U 1 | | + | | U 2 | | ) 2 log n ) time.
ii.
Point-Selection( S 1 , L , [ 1 , | S 1 | ] ) selects s ( n , L ) = O ( n ) positions in g ( n , L ) = O ( n ) time.
iii.
| | U S 2 i 1 | | + | | U S j | | in the algorithm Recover-Motif is no more than f ( n , | G | ) = O ( | G | + n ) .
iv.
With a probability of at most k 2 x n 3 , the algorithm Recover-Motif does not run in computational complexity ( O ( k ( n 2 ( log n ) O ( 1 ) + h 2 log n ) ) , O ( k ) ) .
Proof: 
Statement i. The parameter, ω DETERMINISTIC SUPERQUADRATIC , is set to be β in Collision-Detection. It follows from the time complexity of the brute force method.
Statement ii. It follows from the implementation of Point-Selection().
Statement iii. It follows from the choice of Point-Selection(.) for the sublinear time algorithm at Recover-Motif(.).
Statement iv. It follows from Lemma 34 and Statements i, ii and iii.   ▮
We give the proof for Theorem 6.
Proof: 
[Theorem 6] The computational time part of this theorem follows from Lemma 36.
By Lemma 35, we let ς 1 ( n ) = 1 2 x n 3 ς 0 for the probability bound, ς 1 ( n ) , in the condition (i) of Lemma 32.
By Lemma 35, we can let ς 2 ( n ) = 1 2 x n 3 ς 0 for the probability bound, ς 2 ( n ) , in the condition (i) of Lemma 32
By inequality (12), the condition (iii) of Lemma 32 is satisfied.
By inequality (11), we know that the condition (iv) of Lemma 32 can be satisfied.
The failure probability part of this theorem follows from Lemma 21 and Lemma 32 by using the fact that k 1 , k 2 and k are of the same order (see equation (18)).   ▮

6.5. Randomized Algorithms for Motif Detection

In this section, we present two randomized algorithms for motif detection. The first one is a sublinear time algorithm that can handle 1 ( log n ) 2 + μ mutation, and the second one is a super-linear time algorithm that can handle Ω ( 1 ) mutation. They also share some common functions.
Lemma 37.
Let c 1 be a constant in ( 0 , 1 ) . Assume m and n are two non-negative integers with m n . Then, for every integer, m 1 , with 0 m 1 δ c 1 m ln n , n m 1 c 1 m e ( m ln c 1 ) / 2 , where constant δ c 1 = ln c 1 2 as defined in Definition 8.
Proof: 
We have the inequalities:
n m 1 c 1 m n m 1 c 1 m
= e m 1 ln n c 1 m
e δ c 1 m ln n ln n c 1 m
= e δ c 1 m e m ln c 1
= e ( m ln c 1 ) / 2
   ▮
Lemma 38.
Let S = U V be a set of n elements with U V = . Assume that x 1 , , x m are m random elements in S. Then, with a probability of at most | | U | | m 1 ( | | V | | + m 1 n ) m , the list, x 1 , , x m , contains at most m 1 different elements from U (in other words, | | { x 1 , , x m } U | | m 1 ).
Proof: 
For a subset, S S , with | | S | | = m 0 for some integer, m 0 0 , the probability is at most ( m 0 n ) m that all elements, x 1 , , x m , are in S . For every subset, X S , with | | X | | m 1 , there exists another subset, S S , such that | | S | | = m 1 and X S . We have that Pr [ | | { x 1 , , x m } U | | m 1 ] Pr [ { x 1 , , x m } U U for some U U with | | U | | = m 1 ] . There are | | U | | m 1 subsets of U with a size of m 1 . We have the probability of at most | | U | | m 1 ( | | V | | + m 1 n ) m that x 1 , , x m contains at most m 1 different elements in U.   ▮
Lemma 39.
Let β be a constant in ( 0 , 1 ) and c 1 = 1 β 2 . Let m 1 δ c 1 m ln β n and m n 1 ϵ for some fixed ϵ > 0 . Let S 1 and S 2 be two sets of n elements with | | S 1 S 2 | | β n and C be a set of the size | | C | | γ m 1 for some constant γ ( 0 , 1 ) . Then, for all large n, with a probability of at most 2 e ( 1 γ ) m 1 m n , we have ( A C ) ( B C ) = , where A = { x 1 , , x m } and B = { y 1 , , y m } are two sets, which may have multiplicities, of m random elements from S 1 and S 2 , respectively.
Proof: 
In the entire proof of this lemma, we always assume that n is sufficiently large. We are going to give an upper bound about the probability that B does not contain any element in A C . For each element, y i B , with a probability of at most 1 | | A | | | | C | | n , y i is not in A C . Therefore, the probability is at most ( 1 | | A | | | | C | | n ) m that B does not contain any element in A C .
By Lemma 38, the probability is at most β n m 1 ( ( 1 β ) n + m 1 n ) m that | | A ( S 1 S 2 ) | | m 1 . We have the inequalities:
Pr [ ( A C ) ( B C ) = ]
= Pr [ ( A C ) ( B C ) = | | | A ( S 1 S 2 ) | | m 1 ] · Pr [ | | A ( S 1 S 2 ) | | m 1 ] +
Pr [ ( A C ) ( B C ) = | | | A ( S 1 S 2 ) | | < m 1 ] · Pr [ | A ( S 1 S 2 ) | < m 1 ]
Pr [ ( A C ) ( B C ) = | | | A ( S 1 S 2 ) | | m 1 ] + Pr [ | | A ( S 1 S 2 ) | | < m 1 ]
( 1 | | A | | | | C | | n ) m + β n m 1 ( ( 1 β ) n + m 1 n ) m
( 1 | | ( A S 1 S 2 ) | | | | C | | n ) m + β n m 1 ( ( 1 β ) n + m 1 n ) m
( 1 ( 1 γ ) m 1 n ) m + β n m 1 ( ( 1 β ) n + m 1 n ) m
e ( 1 γ ) m 1 m n + β n m 1 ( ( 1 β ) n + m 1 n ) m
e ( 1 γ ) m 1 m n + β n m 1 ( 1 β 2 ) m
e ( 1 γ ) m 1 m n + e ( m ln c 1 ) / 2
2 e ( 1 γ ) m 1 m n
The inequality, ( 1 ( 1 γ ) m 1 n ) m e ( 1 γ ) m 1 m n , which is used from Equation (34) to Equation (35), follows from the fact that 1 x e x . The transition from (35) to (36) follows from the fact that m 1 n β 2 , since m 1 = o ( n ) , according to the conditions of the lemma.
It is easy to see that 2 ( 1 γ ) m 1 m m ln c 1 = 2 ( 1 γ ) m 1 ln c 1 n for all large n. Thus, ( 1 γ ) m 1 m n ( m ln c 1 ) / 2 (note that ln c 1 < 0 as c 1 ( 0 , 1 ) ). Thus, by Lemma 37, β n m 1 ( 1 β 2 ) m e m ln c 1 / 2 e ( 1 γ ) m 1 m n . This is why we have the transition from Equation (37) to Equation (38). Therefore, Pr [ ( A C ) ( B C ) = ] 2 e ( 1 γ ) m 1 m n .   ▮

6.5.1.. Randomized Algorithm for an Ω ( 1 ) Mutation Rate

In this section, we give an algorithm for the case with an Ω ( 1 ) mutation rate. The performance of the algorithm is stated in Theorem 4.
Lemma 40.
Let algorithm-type=RANDOMIZED-SUBQUADRATIC. Assume that d 0 log n L | G | / 2 and c 0 log n | G | < ( log n ) 3 + τ 100 . Let I 1 be a set of intervals of the positions of S 1 that satisfy [ LB ( S 1 ) L , LB ( S 1 ) + L ] [ RB ( S 1 ) L , RB ( S 1 ) + L ] I I 1 I . Let I 2 be a set of intervals of the positions of S 2 that satisfy [ LB ( S 2 ) L , LB ( S 2 ) + L ] [ RB ( S 2 ) L , RB ( S 2 ) + L ] I I 2 I . Let U 1 = Point-Selection ( S 1 , L , I 1 ) , U 2 = Point-Selection ( S 2 , L , I 2 ) and ( L S 1 , R S 1 , L S 2 , R S 2 ) = Collision-Detection ( S 1 , U 1 , S 2 , , U 2 ) . Then:
i.
with a probability of at most 1 2 x n 3 , the left rough boundary, L S 1 , has at most d 0 log n distance from LB ( S 1 ) and the left rough boundary, L S 2 , has at most d 0 log n distance from LB ( S 2 ) ;
ii.
with a probability of at most 1 2 x n 3 , the right rough boundary, R S 1 , has at most d 0 log n distance from RB ( S 1 ) and the right boundary of R S 2 has at most d 0 log n distance from RB ( S 2 ) .
Proof: 
The proof is the same as Lemma 35 for the algorithm with algorithm-type=DETERMINISTIC-SUPERQUADRATIC. For two sequences, S 1 and S 2 , let ( S a ) be the subsequence S a [ i a , j a ] for a = 1 , 2 . By Corollary 18, with a probability of at most P l = 2 c d 0 log n 2 5 · 2 x n 3 (see inequality (8) in Definition 14), there are more than ( α + ϵ ) d 0 log n mutations in S a [ i a , i a + d 0 log n 1 ] for a = 1 , 2 .
With a probability of at most P l , the left boundary position is missed during the matching. We have similar P r = P l to miss the right boundary.
Assume that p 1 and p 2 are two positions of S 1 and S 2 , respectively. If one of the two positions is outside the motif region and has more than d 0 log n distance to the motif boundary, with a probability of at most c d 0 log n 1 5 · 2 x n 3 (see inequality (8) in Definition 14), for them to match requires diff ( Y 1 , Y 2 ) β by Lemma 19, where Y a is a subsequence S a [ p a , p a + d 0 log n 1 ] for a = 1 , 2 .   ▮
Lemma 41.
Let algorithm-type=RANDOMIZED-SUBQUADRATIC. Assume that d 0 log n L | G | / 2 and | G | ( log n ) 3 + τ 100 . Let I 1 be a set of intervals of the positions of S 1 that satisfy [ LB ( S 1 ) L , LB ( S 1 ) + L ] [ RB ( S 1 ) L , RB ( S 1 ) + L ] I I 1 I . Let I 2 be a set of intervals of the positions of S 2 that satisfy [ LB ( S 2 ) L , LB ( S 2 ) + L ] [ RB ( S 2 ) L , RB ( S 2 ) + L ] I I 2 I . Let U 1 = Point-Selection ( S 1 , L , I 1 ) , U 2 = Point-Selection ( S 2 , L , I 2 ] ) and ( L S 1 , R S 1 , L S 2 , R S 2 ) = Collision-Detection ( S 1 , U 1 , S 2 , U 2 ) . Then:
i.
with a probability of at most 1 2 x n 3 , the left rough boundary, L S 1 , has at most a 2 L distance from LB ( S 1 ) and the left rough boundary L S 2 has at most a 2 L distance from LB ( S 2 ) ;
ii.
with a probability of at most 1 2 x n 3 , the right rough boundary, R S 1 , has at most a 2 L distance from RB ( S 1 ) and the right boundary of R S 2 has at most a 2 L distance from RB ( S 2 ) .
Proof: 
We prove the following two statements which imply the lemma.
i.
With a probability of at most 1 2 x n 3 , there are no intervals, A i from S 1 and B j from S 2 , such that: (1) | | A i ( S 1 , ( S 1 ) ) B j ( S 2 , ( S 2 ) ) | | is at least L 2 ; (2) the left boundary of S 1 has at most a 2 L distance from A i ; (3) the left boundary of S 2 has at most a 2 L distance from B j ; and (4) there is a collision between the sampled positions in A i and B j .
ii.
With a probability pf at most 1 2 x n 3 , there are no intervals, A i from S 1 and B j from S 2 , such that: (1) | | A i ( S 1 , ( S 1 ) ) B j ( S 2 , ( S 2 ) ) | | is at least L 2 ; (2) the right boundary of S 1 has at most a 2 L distance from A i ; (3) the right boundary of S 2 has at most a 2 L distance from B j ; and (4) there is a collision between the sampled positions in A i and B j .
We only prove statement i. The proof for statement ii is similar.
Select A i from S 1 and B j from S 2 to be the first pair of intervals with | | A i ( S 1 , ( S 1 ) ) B j ( S 2 , ( S 2 ) ) | | L 2 . It is easy to see that such a pair exists, and both have a distance from the left boundary with a distance of at most 2 L . This is because when a leftmost interval of a length pf L is fully inside the motif region of the first sequence, we can always find the second interval from the second sequence with an intersection of a length of at least L 2 .
Replace m by M ( L ) , m 1 by M 1 ( L ) (see Definition 10) and n by L to apply Lemma 39. We do not consider any damaged position in this algorithm; therefore, let C be empty.
With a probability of at most o ( 1 2 x n 3 ) , there is a point in ( A i ( S 1 , ( S 1 ) ) C ) ( B j ( S 2 , ( S 2 ) ) C ) . The subsequences of a length of d 0 log n starting at the point from S 1 and S 2 fail to have the difference bounded by β with a probability of at most o ( 1 2 x n 3 ) by Lemma 20. With a probability of at most o ( 1 2 x n 3 ) , we do not have that the rough boundaries are detected with a distance of at most 2 L to exact motif boundaries.   ▮
Lemma 42.
For the case algorithm-type=RANDOMIZED-SUBQUADRATIC, we have:
i.
Collision-Detection( S 1 , U 1 , S 2 , U 2 ) takes t ( n , | | U 1 | | + | | U 2 | | ) = O ( ( | | U 1 | | + | | U 2 | | ) 2 log n ) time.
ii.
Point-Selection( S 1 , L , [ 1 , | S 1 | ] ) selects s ( n , L ) = O ( ( n L ) M ( L ) ) positions in g ( n , L ) = O ( s ( n , L ) ) time if L ( log n ) 3 + τ 100 .
iii.
Point-Selection( S 1 , L , [ 1 , | S 1 | ] ) selects s ( n , L ) = O ( n ) positions in g ( n , L ) = O ( n ) time if L < ( log n ) 3 + τ 100 .
iv.
| | U S 2 i 1 | | + | | U S j | | in the algorithm Recover-Motif is no more than f ( n , | G | ) = O ( M ( | G | ) + n | G | M ( | G | ) ) .
v.
With a probability of at most k 2 x n 3 , the algorithm Recover-Motif does not stop in ( O ( k ( n 2 | G | ( log n ) O ( 1 ) + h 2 log n ) ) , O ( k ) ) time.
Proof: 
Statement i. The parameter, ω RANDOMIZED SUBLINEAR , is set to be β in Collision-Detection. It follows from the time complexity of the brute force method.
Statements ii and iii. They follow from the implementation of Point-Selection().
Statement iv. It follows from the choice of Point-Selection(.) for the sublinear time algorithm at Recover-Motif(.).
Statement iv. It follows from Lemma 40, Lemma 34 and Statements i, ii and iii.   ▮
We give the proof for Theorem 6.
Proof: 
[Theorem 4] The computational time part of this theorem follows from Lemma 42.
By Lemma 40, we can let ς 1 ( n ) = 1 2 x n 3 ς 0 for the probability bound, ς 1 ( n ) , in the condition (i) of Lemma 32.
By Lemma 41, we can let ς 2 ( n ) = 1 2 x n 3 ς 0 for the probability bound, ς 2 ( n ) , in the condition (ii) of Lemma 32.
By inequality (12), the condition (iii) of Lemma 32 is satisfied.
By inequality (11), we know that the condition (iii) of Lemma 32 can be satisfied.
The failure probability part of this theorem follows from Lemma 21 and Lemma 32 by using the fact that k 1 , k 2 and k are of the same order (see Equation (18)).   ▮

6.5.2.. Sublinear Time Algorithm for a 1 ( log n ) 2 + μ Mutation Rate

In this section, we give an algorithm for the case with at most α = 1 ( log n ) 2 + μ mutation rate. The performance of the algorithm is stated in Theorem 2.
Definition 43.
A position, p, in the motif region, ( S ) , of an input sequence, S, is damaged if there exists at least one mutation in S [ p , p + d 0 log n 1 ] , where d 0 is defined in item (xvii) in Definition 8.
Lemma 44.
Assume that α L = ( log n ) 1 + Ω ( 1 ) . With a probability of at most e ( log n ) 1 + Ω ( 1 ) , there are more than M 1 ( L ) ( log n ) Ω ( 1 ) positions that are from the M ( L ) (see Definition 10 for M ( . ) and M 1 ( . ) ) sampled positions that are damaged in an interval of a length pf L.
Proof: 
By Theorem 16, with a probability of at most P 1 = 2 α L (let δ = 2 ), there are more than 3 α L mutations in an interval of a length of L. Therefore, with a probability of at most 2 α L = e ( log n ) 1 + Ω ( 1 ) , there are more than 3 α L log n positions that are damaged. Therefore, each random position in an interval of a length of L has at most a probability of 3 α L log n L = 3 α log n to be damaged.
Since α = ( 1 ( log n ) 2 + Ω ( 1 ) ) and M ( L ) positions are sampled, by Theorem 16, with a probability of at most P 2 = 2 ( 3 α log n ) M ( L ) = e ( log n ) 1 + Ω ( 1 ) (let δ = 2 ), the number of damaged positions sampled in an interval of a length of L is more than ( ( 1 + δ ) 3 α log n ) M = ( 9 α log n ) M ( L ) = M 1 ( L ) ( log n ) Ω ( 1 ) . Thus, with a total probability of at most P 1 + P 2 = e ( log n ) 1 + Ω ( 1 ) , there are more than M 1 ( L ) ( log n ) Ω ( 1 ) damaged positions that are from the M ( L ) sampled positions in an interval of a length of L.   ▮
Definition 45.
Let A be a set of positions in an input sequence, S, with ( S ) = S [ i , j ] . Let A ( S , ( S ) ) = { x i + 1 | x A [ i , j ] } . In other words, A ( S , ( S ) ) contains all the positions of A in ( S ) .
Lemma 46. Let
Let algorithm-type=RANDOMIZED-SUBLINEAR. Assume that | G | < ( log n ) 3 + τ 100 and L is an integer with d 0 log n L | G | / 2 . Let I 1 be a set of intervals of the positions of S 1 that satisfy [ LB ( S 1 ) L , LB ( S 1 ) + L ] [ RB ( S 1 ) L , RB ( S 1 ) + L ] I I 1 I . Let I 2 be a set of intervals of the positions of S 2 that satisfy [ LB ( S 2 ) L , LB ( S 2 ) + L ] [ RB ( S 2 ) L , RB ( S 2 ) + L ] I I 2 I . Let U 1 = Point-Selection ( S 1 , L , I 1 ) , U 2 = Point-Selection ( S 2 , L , I 2 ] ) and ( L S 1 , R S 1 , L S 2 , R S 2 ) = Collision-Detection ( S 1 , U 1 , S 2 , U 2 ) . Then:
i.
with a probability of at most 1 2 x n 3 , the left rough boundary, L S 1 , has at most a | G | / 4 distance from LB ( S 1 ) and the left rough boundary, L S 2 , has at most a | G | / 4 distance from LB ( S 2 ) .
ii.
with a probability of at most 1 2 x n 3 , the right rough boundary, R S 1 , has at most a | G | / 4 distance from RB ( S 1 ) and the right boundary of R S 2 has at most a | G | / 4 distance from RB ( S 2 ) .
Proof: 
For two sequences, S 1 and S 2 , it is easy to see that there is a common position in both motif regions of the two sequences, such that there is no mutation in the next d 0 log n characters with a high probability. This is because that mutation probability is small.
By Theorem 16, with a probability of at most P l = 2 α | G | / 4 (let δ = 2 ), there are more than 3 α | G | 4 mutated characters in the interval ( S i ) [ 1 , | G | 4 ] for i = 1 , 2 . Since the mutation probability is α = ( 1 ( log n ) 2 + Ω ( 1 ) ) , with a probability of at most 2 α | G | / 4 = e ( log n ) 1 + Ω ( 1 ) , there are more than 3 α · | G | 4 d 0 log n positions to be damaged in ( S i ) [ 1 , | G | 4 ] .
Similarly, we have a probability of at most P r = e ( log n ) 1 + Ω ( 1 ) that there are more than ( ( 3 α d 0 log n ) · | G | 4 ) = | G | ( log n ) Ω ( 1 ) damaged positions in ( S i ) [ 3 | G | 4 1 , | G | ] .
Now, we assume that left side has more than ( ( 3 α d 0 log n ) · | G | 4 ) = | G | ( log n ) Ω ( 1 ) damaged positions and the right side, more than ( ( 3 α d 0 log n ) · | G | 4 ) = | G | ( log n ) Ω ( 1 ) damaged positions in ( S i ) [ 3 | G | 4 1 , | G | ] . Since each position in each interval of a length of L is selected in Point-Selection ( S 1 , S 2 , L ) , it is easy to verify the conclusions of this lemma.   ▮
Lemma 47.
Let algorithm-type=RANDOMIZED-SUBLINEAR. Assume that | G | ( log n ) 3 + τ 100 and d 0 log n L | G | / 2 . Let I 1 be a set of intervals of the positions of S 1 that satisfy [ LB ( S 1 ) L , LB ( S 1 ) + L ] [ RB ( S 1 ) L , RB ( S 1 ) + L ] I I 1 I . Let I 2 be a set of intervals of the positions of S 2 that satisfy [ LB ( S 2 ) L , LB ( S 2 ) + L ] [ RB ( S 2 ) L , RB ( S 2 ) + L ] I I 2 I . Let U 1 = Point-Selection ( S 1 , L , I 1 ) , U 2 = Point-Selection ( S 2 , L , I 2 ] ) and ( L S 1 , R S 1 , L S 2 , R S 2 ) = Collision-Detection ( S 1 , U 1 , S 2 , U 2 ) . Then:
i.
with a probability of at most 1 2 x n 3 , the left rough boundary, L S 1 , has at most a 2 L distance from LB ( S 1 ) and the left rough boundary, L S 2 , has at most a 2 L distance from LB ( S 2 ) .
ii.
With a probability of at most 1 2 x n 3 , the right rough boundary, R S 1 , has at most a 2 L distance from RB ( S 1 ) and the right boundary of R S 2 has at most a 2 L distance from RB ( S 2 ) .
Proof: 
We prove the following two statements, which imply the lemma.
i.
With a probability of at most 1 2 x n 3 , there are no intervals, A i from S 1 and B j from S 2 , such that: (1) | | A i ( S 1 , ( S 1 ) ) B j ( S 2 , ( S 2 ) ) | | is at least L 2 ; (2) the left boundary of S 1 has at most a 2 L distance from A i ; (3) the left boundary of S 2 has at most a 2 L distance from B j ; and (4) there is a collision between the sampled positions in A i and B j .
ii.
with a probability of at most 1 2 x n 3 , there are no intervals, A i from S 1 and B j from S 2 , such that: (1) | | A i ( S 1 , ( S 1 ) ) B j ( S 2 , ( S 2 ) ) | | is at least L 2 ; (2) the right boundary of S 1 has at most a 2 L distance from A i ; (3) the right boundary of S 2 has at most a 2 L distance from B j ; and (4) there is a collision between the sampled positions in A i and B j .
We only prove statement i. The proof for statement ii is similar to that for statement i. Assume that L satisfies the condition of this lemma. Select A i from S 1 and B j from S 2 to be the first pair of intervals of a size of L with | | A i ( S 1 , ( S 1 ) ) B j ( S 2 , ( S 2 ) ) | | L 2 . This is because when a leftmost interval of a length of L is fully inside the motif region of the first sequence, we can always find the second interval from the second sequence with an intersection of a length of at least L 2 .
Replace m by M ( L ) , m 1 by M 1 ( L ) (see Definition 10) and n by L to apply Lemma 39. We also let C be the set of damaged positions in ( S 1 ) and ( S 2 ) caused by the mutated positions. With a probability of at most o ( 1 2 x n 3 ) , C has a size of o ( M 1 ( L ) ) by Lemma 44. With a probability of at most o ( 1 2 x n 3 ) , there is point in ( A i ( S 1 , ( S 1 ) ) C ) ( B j ( S 2 , ( S 2 ) ) C ) . The existence of such a point makes L S 1 and L S 2 have a distance of at most 2 L to LB ( S 1 ) and LB ( S 2 ) , respectively.   ▮
Lemma 48.
For the case algorithm-type=RANDOMIZED-SUBLINEAR, we have:
i.
Collision-Detection( S 1 , U 1 , S 2 , U 2 ) takes t ( n , | | U 1 | | + | | U 2 | | ) = O ( ( | | U 1 | | + | | U 2 | | ) log n ) time.
ii.
Point-Selection( S 1 , L , [ 1 , | S 1 | ] ) selects s ( n , L ) = O ( ( n L ) M ( L ) ) positions in g ( n , L ) = O ( s ( n , L ) ) time if L ( log n ) 3 + τ 100 .
iii.
Point-Selection( S 1 , L , [ 1 , | S 1 | ] ) selects s ( n , L ) = O ( n ) positions in g ( n , L ) = O ( n ) time if L < ( log n ) 3 + τ 100 .
iv.
| | U S 2 i 1 | | + | | U S j | | in the algorithm Recover-Motif is no more than f ( n , | G | ) = O ( M ( | G | ) + n | G | M ( | G | ) ) .
v.
With a probability of at most k 2 x n 3 , the algorithm Recover-Motif does not stop in ( O ( k ( n h ( log n ) 5 2 + h 2 log n ) ) , O ( k ) ) time.
Proof: 
Statement i. The parameter, ω RANDOMIZED SUBLINEAR , is set to be zero in Collision-Detection. It follows from the time complexity of bucket sorting, which is described in standard algorithm textbooks.
Statements ii and iii. They follow from the implementation of Point-Selection().
Statement iv. It follows from the choice of Point-Selection(.) for the sublinear time algorithm at Recover-Motif(.).
Statement v. It follows from Lemma 46, Lemma 47 and Lemma 34 and Statements i, ii iii and iv.   ▮
We give the proof for Theorem 2.
Proof: 
[Theorem 2] The computational time part of this theorem follows from Lemma 48.
By Lemma 46, we can let ς 1 ( n ) = 1 2 x n 3 ς 0 for the probability bound, ς 1 ( n ) , in the condition (i) of Lemma 32.
By Lemma 47, we can let ς 2 ( n ) = 1 2 x n 3 ς 0 for the probability bound, ς 1 ( n ) , in the condition (ii) of Lemma 32.
By inequality (12), the condition (iii) of Lemma 32 is satisfied.
By inequality (11), we know that the condition (iv) of Lemma 32 can be satisfied.
The failure probability part of this theorem follows from Lemma 21 and Lemma 32 by using the fact that k 1 , k 2 and k are of the same order (see Equation (18)).   ▮

6.6. Experiments on Simulated Datasets

Aiming at solving the motif discovery problem, we implemented our algorithm in Java. Our tests were all done on a laptop with an Intel Dual Core 1.5 G CPU and 3.0 G Memory. In the first experiment, we tested our algorithm on several simulated datasets, which are all generated from our probability model with a small mutation rate. Each input set contains 20 or 15 sequences, which are of a length of 600 or 500 base pairs. Additionally, each bp of all the simulated gene sequences was generated independently with the same occurrence probability. A motif with a fixed length was randomly planted into each input sequence. The minimum Hamming distances between the results and consensus are recorded.

6.7. Experiments

There are many other tools for detecting and analyzing the motifs, like the EMmethod [23], MEME [24], Gibbs [25], Compo [26], MochiView [27], PhyME [28], HeliCis [29] and WebMotif [30], among others. Each of them has their advantages and disadvantages.
Table 1 shows the results on simulated datasets. From the table, we could find that the results of our algorithm for finding the motif on simulated datasets are satisfied. Our algorithm could find all the motifs from each sequence and get the consensus with an accuracy rate of 100%. If the dataset has a high mutation rate, we could increase the number of repetitions, so that the result on the datasets will be more accurate. We also recorded the total time cost for each test, which mainly depends on the number of test repetitions. In the experimental tables, the parameter, N, represents the number of sequences, parameter M represents the length of motifs, parameter M is the maximum length of sequences and R is the number of iterations. GCR1 is a famous DNA binding protein, whose ability to bind DNA is dependent on the CTTCC sequence motif [31]. Several other popular data sets are also used in the experiments of our motif detection and its comparisons to the other methods.
Table 1. Results on simulated data.
Table 1. Results on simulated data.
NMLRAccuracy RateTime cost(s)
Set 120600156010098
Set 215600151010018
Set 320600121510022
Set 420500154010079
In the second experiment, we tested our algorithm on a real sequence set, which was obtained from SCPD. SCPD contains a large number of gene data and transcription factors of yeast. Sequences in the same set are all regulated by a common motif. We chose 1,000 bp as the length of the input sequences. In order to show the advantages of our algorithm, we also compared the result of our algorithm with the results of several other existing motif finding methods on the same dataset, such as Gibbs, MEME, Info-Gibbs and Consensus. Table 2 shows the details of the data set we used in the experiment.
Table 2. Number of Sequences and Motif Length.
Table 2. Number of Sequences and Motif Length.
Bas1GCN4GCR1Rap1Ebf1HSE-HTSF
N696155
L1010101510
Table 3 shows the results of the five algorithms on biological data sets. Table 4 and Figure 2 give the average mismatch numbers of each algorithm. We choose four well-known motif-detecting softwares to make the comparisons. From Table 3 and Table 4, we see that the average mismatch numbers of our algorithm on data sets GCN4 and GCR1 are significantly lower than other four well-known methods. On the data sets Bas1,Rap1Ebf1 and HSE-HTSF, our algorithms also shows satisfied performance compared to other methods.
In addition, our algorithm also shows its high speed in computations compared to other four motif finding methods. Because the starting pattern of algorithms are represented by a string, so our algorithm can avoid some extra time consuming computations unlike Gibbs sampling and EM methods, such as computations of likelihoods. According to this feature, we use the consensus string of the voting operation obtained from the last iteration as a new starting pattern in program, and continue doing voting operations repeatedly until there is no further improvement. Experimental results show that if we set the number of iterations to be a large integer, the programs could give more accurate results within a reasonable time.
Table 3. Total number of mismatch positions.
Table 3. Total number of mismatch positions.
Bas1GCN4GCR1Rap1Ebf1HSE-HTSF
Our Algorithm1084455
Gibbs85152027
MEME81510323
InfoGibbs9215469
Consensus895427
Table 4. Average mismatch numbers per sequence.
Table 4. Average mismatch numbers per sequence.
Bas1GCN4GCR1Rap1Ebf1HSE-HTSF
Our Algorithm1.670.890.6731
Gibbs1.335.60.8313.461.4
MEME1.331.671.672.130.6
InfoGibbs1.52.330.833.061.8
Consensus1.3310.832.81.4
Figure 2. Average mismatch numbers per sequence.
Figure 2. Average mismatch numbers per sequence.
Algorithms 06 00636 g002

6.8. Conclusions

We develop algorithms under the probabilistic model. One of them finds the implanted motif with a high probability if the alphabet size is at least four, the motif length is in [ ( log n ) 7 + μ , n ( log n ) 1 + μ ] and each character in the motif region has a probability of at most 1 ( log n ) 2 + μ of mutation. The motif region can be detected, and each motif character can be recovered in sublinear time. A sub-quadratic randomized algorithm is developed to recover the motif with an Ω ( 1 ) mutation rate. A quadratic deterministic algorithm is developed to recover the motif with an Ω ( 1 ) mutation rate. It is an interesting problem if there is an algorithm to handle the case for an alphabet of a size of three. A more interesting problem is to extend the algorithm to handle larger mutation probability.

6.9. Future Works

Compared with other motif finding methods, our algorithm shows its great advantages. However, there are still some improvements that could be done on this algorithm. For example, though a sequence set has the consensus, the motif in each sequence may have high mutation rates; in addition, the length of each motif could also be different. Therefore, these two factors increase the difficulty for finding motifs, and currently, there is still no effective algorithm that could solve these problems. In the future, we plan to improve the efficiency of our algorithm by combining other motif finding methods, such as MEME; a combination may be made to make our algorithm have better performance in finding motifs from highly mutated sequences.

Acknowledgments

We thank Ming-Yang Kao for introducing us to this topic. We also thank Lusheng Wang and Xiaowen Liu for some discussions. We would like to thank Eugenio De Hayos for his helpful comments. We would like to thank the reviewers, whose comments greatly improved the presentation of this paper.
This research is supported in part by the NSF Early Career Award 0845376, and NSF HRD-1137764.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Frances, M.; Litman, A. On covering problems of codes. Theor. Comput. Sci. 1997, 30, 113–119. [Google Scholar] [CrossRef]
  2. Ga̧sieniec, L.; Jansson, J.; Lingas, A. Efficient Approximation Algorithms for the Hamming Center Problem. In Proceedings of the 10th Annual ACM-SIAM Symposium on Discrete Algorithms, Baltimore, MD, USA, 17–19 January 1999; pp. S905–S906.
  3. Stormo, G.; Hartzell, G., III. Identifying protein-binding sites from unaligned DNA fragments. Proc. Natl. Acad. Sci. USA 1991, 88, 5699–5703. [Google Scholar] [CrossRef] [PubMed]
  4. Lawrence, C.; Reilly, A. An expectation maximization (EM) algorithm for the identification and characterization of common sites in unaligned biopolymer sequences. Proteins 1990, 7, 41–51. [Google Scholar] [CrossRef] [PubMed]
  5. Hertz, G.; Stormo, G. Identification of Consensus Patterns in Unaligned DNA and Protein Sequences: A Large-Deviation Statistical Basis for Penalizing Gaps. In Proceedings of the 3rd International Conference on Bioinformatics and Genome Research, Tallahassee, USA, 1–4 June 1994; pp. 201–216.
  6. Stormo, G. Consensus patterns in DNA. In Molecular Evolution: Computer Analysis of Protein and Nucleic Acid Sequences; Doolitle, R.F., Ed.. Methods Enzymol. 1990, 183, 211–221. [Google Scholar]
  7. Lanctot, J.K.; Li, M.; Ma, B.; Wang, L.; Zhang, L. Distinguishing string selection problems. Inf. Comput. 2003, 185, 41–55. [Google Scholar] [CrossRef]
  8. Lucas, K.; Busch, M.; Mossinger, S.; Thompson, J. An improved microcomputer program for finding gene- or gene family-specific oligonucleotides suitable as primers for polymerase chain reactions or as probes. Comput. Appl. Biosci. 1991, 7, 525–529. [Google Scholar] [CrossRef] [PubMed]
  9. Dopazo, J.; Rodríguez, A.; Sáiz, J.C.; Sobrino, F. Design of primers for PCR amplification of highly variable genomes. Comput. Appl. Biosci. 1993, 9, 123–125. [Google Scholar] [PubMed]
  10. Proutski, V.; Holme, E.C. Primer master: A new program for the design and analysis of PCR primers. Comput. Appl. Biosci. 1996, 12, 253–255. [Google Scholar] [CrossRef] [PubMed]
  11. Li, M.; Ma, B.; Wang, L. On The Closest String and Substring Problems. J. ACM 2002, 49, 157–171. [Google Scholar] [CrossRef]
  12. Li, M.; Ma, B.; Wang, L. Finding Similar Regions in Many Strings. In Proceedings of the 31st Annual ACM Symposium on Theory of Computing, Atlanta, GA, USA, 1–4 May 1999; pp. 473–482.
  13. Pevzner, P.; Sze, S. Combinatorial Approaches to Finding Subtle Signals in DNA Sequences. In Proceedings of the 8th International Conference on Intelligent Systems for Molecular Biology, Toronto, ON, Canada, 19–23 July 2000; pp. 269–278.
  14. Keich, U.; Pevzner, P. Finding motifs in the twilight zone. Bioinformatics 2002, 18, 1374–1381. [Google Scholar] [CrossRef] [PubMed]
  15. Keich, U.; Pevzner, P. Subtle motifs: Defining the limits of motif finding algorithms. Bioinformatics 2002, 18, 1382–1390. [Google Scholar] [CrossRef] [PubMed]
  16. Wang, L.; Dong, L. Randomized algorithms for motif detection. J. Bioinform. Comput. Biol. 2005, 3, 1039–1052. [Google Scholar] [CrossRef] [PubMed]
  17. Chin, F.; Leung, H. Voting Algorithms for Discovering Long Motifs. In Proceedings of the 3rd Asia-Pacific Bioinformatics Conference, Singapore, 17–21 January 2005; pp. 261–272.
  18. Gusfield, D. Algorithms on Strings, Trees, and Sequences; Cambridge University Press: Cambridge, UK, 1997. [Google Scholar]
  19. Fu, B.; Kao, M.Y.; Wang, L. Probabilistic analysis of a motif discovery algorithm for multiple sequences. SIAM J. Discret. Math. 2009, 23, 1715–173. [Google Scholar] [CrossRef]
  20. Fu, B.; Kao, M.Y.; Wang, L. Discovering almost any hidden motif from multiple sequences. ACM Transactions on Algorithms 2011, 7(2), 26. [Google Scholar] [CrossRef]
  21. Liu, X.; Ma, B.; Wang, L. Voting Algorithms for the Motif Problem. In Proceedings of Computational Systems Bioinformatics Conference, (CSB’08), Stanford, CA, USA, 26–29 August 2008; pp. 37–47.
  22. Motwani, R.; Raghavan, P. Randomized Algorithms; Cambridge University Press: Cambridge, UK, 2000. [Google Scholar]
  23. Dempster, A.P.; Laird, N.M.; Rubin, D.B. Maximum likelihood from complete data vis the EM algorithm. J. R. Stat. Soc. 1977, 39, 1–38. [Google Scholar]
  24. D’haesler, P. How does DNA sequence motif discovery work? Nat. Biotechnol. 2006, 24, 959–961. [Google Scholar] [CrossRef] [PubMed]
  25. Lawrence, C.; Altschul, S.; Boguski, M.; Liu, J.; Neuwald, A.; Wootton, J. Detecting subtle sequence signals: A gibbs sampling strategy for multiple alignment. Science 1993, 262, 262–5131. [Google Scholar] [CrossRef]
  26. Sandve, G.K.K.; Abul, O.; Drabløs, F. Compo: Composite motif discovery using discrete models. BMC Bioinform. 2008, 9. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  27. Homann, O.; Johnson, A. MochiView: Versatile software for genome browsing and DNA motif analysis. BMC Biol. 2010, 8. [Google Scholar] [CrossRef] [PubMed]
  28. Sinha, S.; Blanchette, M.; Tompa, M. PhyME: A probabilistic algorithm for finding motifs in sets of orthologous sequences. BMC Bioinform. 2004, 5. [Google Scholar] [CrossRef] [Green Version]
  29. Larsson, E.; Lindahl, P.; Mostad, P. HeliCis: A DNA motif discovery tool for colocalized motif pairs with periodic spacing. BMC Bioinform. 2007, 8. [Google Scholar] [CrossRef] [PubMed]
  30. Romer, K.; Kayombya, G.R.; Fraenkel, E. WebMOTIFS: Automated discovery, filtering and scoring of DNA sequence motifs using multiple programs and Bayesian approaches. Nucleic Acids Res. 2007, 35, W217–W220. [Google Scholar] [CrossRef] [PubMed]
  31. Baker, H. GCR1 of Saccharomyces cerevisiae encodes a DNA binding protein whose binding is abolished by mutations in the CTTCC sequence motif. Proc. Natl. Acad. Sci. USA 1991, 88, 9443–9447. [Google Scholar] [CrossRef] [PubMed]

Share and Cite

MDPI and ACS Style

Fu, B.; Fu, Y.; Xue, Y. Sublinear Time Motif Discovery from Multiple Sequences. Algorithms 2013, 6, 636-677. https://doi.org/10.3390/a6040636

AMA Style

Fu B, Fu Y, Xue Y. Sublinear Time Motif Discovery from Multiple Sequences. Algorithms. 2013; 6(4):636-677. https://doi.org/10.3390/a6040636

Chicago/Turabian Style

Fu, Bin, Yunhui Fu, and Yuan Xue. 2013. "Sublinear Time Motif Discovery from Multiple Sequences" Algorithms 6, no. 4: 636-677. https://doi.org/10.3390/a6040636

Article Metrics

Back to TopTop