Literature DB >> 22373455

Efficient computation of spaced seeds.

Silvana Ilie1.   

Abstract

BACKGROUND: The most frequently used tools in bioinformatics are those searching for similarities, or local alignments, between biological sequences. Since the exact dynamic programming algorithm is quadratic, linear-time heuristics such as BLAST are used. Spaced seeds are much more sensitive than the consecutive seed of BLAST and using several seeds represents the current state of the art in approximate search for biological sequences. The most important aspect is computing highly sensitive seeds. Since the problem seems hard, heuristic algorithms are used. The leading software in the common Bernoulli model is the SpEED program.
FINDINGS: SpEED uses a hill climbing method based on the overlap complexity heuristic. We propose a new algorithm for this heuristic that improves its speed by over one order of magnitude. We use the new implementation to compute improved seeds for several software programs. We compute as well multiple seeds of the same weight as MegaBLAST, that greatly improve its sensitivity.
CONCLUSION: Multiple spaced seeds are being successfully used in bioinformatics software programs. Enabling researchers to compute very fast high quality seeds will help expanding the range of their applications.

Entities:  

Mesh:

Year:  2012        PMID: 22373455      PMCID: PMC3392737          DOI: 10.1186/1756-0500-5-123

Source DB:  PubMed          Journal:  BMC Res Notes        ISSN: 1756-0500


Background

The most frequently used tools in bioinformatics are those searching for similarities, or local alignments, between biological sequences. This problem can be solved exactly using the dynamic programming algorithm of Smith-Waterman in quadratic time. Many instances, including all database searches, are too large for this approach to be feasible and heuristic algorithms are used instead [1,2]. The most widely used program in bioinformatics, BLAST [2,3], is one such tool. It uses the so-called "hit and extend" approach: a hit consists of 11 consecutive matches between two sequences and represents a potential local alignment. The hit is then extended both ways in search for similarity. It is clear that not all local alignments have to include an identical stretch of length 11. It has been already noticed in [4] and then again in [5] that requiring that the matches are not consecutive increases the chances of finding alignments. The idea of optimizing the way the required matches are placed has been investigated in [6,7], the latter having used it in a similarity search software, PatternHunter. Much work has been dedicated to spaced seeds. For a survey of earlier work, we refer the reader to [8]. The 11 consecutive matches of BLAST are called a contiguous seed, denoted 11111111111 (for 11 consecutive matches), whereas the one of PatternHunter is a spaced seed, 111*1**1*1**11*111; a 1 represents a match and * a don't care position. The number of 1's represents the weight of the seed. The probability of finding local alignments, under specific conditions, to be made precise later, is called sensitivity. We notice an essential trade off. Decreasing the number of matches, that is, the weight of the seed, increases the sensitivity but also the number of random hits, decreasing specificity. On the other hand, it is intuitively clear that several different seeds will hit different alignments, thus having increased sensitivity. It has been noticed by [9] that doubling the number of seeds can account for the decrease in weight, thus simultaneously increasing sensitivity without reducing specificity. PatternHunterII [9] uses 16 different seeds of weight 11. For comparison, under similar conditions, the sensitivity of the BLAST, PatterHunter, and PatternHunterII seeds, all of weight 11, are 0.30, 0.47, and 0.92, respectively, a very large difference. Multiple spaced seeds represent the current state of the art in similarity search and are used by many software programs, in a variety of applications, such as sequence alignment [6,9,10], read mapping [11,12], or oligonucleotide design [13]. It is therefore of great importance to be able to compute seeds with high sensitivity. The only way to find optimal seeds seems to be by trying all possible ones. This brute force approach includes two exponential steps. First, there are exponentially many candidates. Second, computing sensitivity is exponential as well. Therefore, only single seeds can be computed this way. For multiple seeds, since the relevant problems are hard [14,15], heuristic algorithms must be used. Among many such algorithms, such as Mandala [16] and Iedera [17], only one works in polynomial time: SpEED [18]. SpEED is based on the notion of overlap complexity [19], that is very well correlated with sensitivity but polynomial-time computable. A hill climbing algorithm is used that iteratively swaps a 1 with a * in a random seed in order to improve the overlap complexity. Our contribution in this paper is to improve the best existing software, SpEED, by increasing its speed and, consequently, the sensitivity of the computed seeds. The first algorithm we give is a bit-parallel algorithm for computing overlap complexity. This is of independent interest and alone can speed up the hill climbing of SpEED significantly. However, we give a better algorithm for this heuristic that improves its speed by one order of magnitude. Several tests are provided to prove these claims. Then, the new implementation is employed to compute improved seeds for PatternHunterII as well as BFAST, as they use some of the most demanding seeds. Finally, we show a very significant improvement of the MegaBLAST seeds. At weight 28 they are significantly larger than everything else, yet we manage to compute up to 16 seeds of this weight, with very large improvement in sensitivity over MegaBLAST.

Spaced seeds

A spaced seed is any string containing 1's and *'s. Since having a * at one end of a seed is not useful, we assume that all seed start and end with a 1. For a seed s, the weight w of s is the number of 1's and the length ℓ is the number of all letters. The ith letter of s is denoted s[i]. A multiple spaced seed is a set of seeds S = {s1, s2, ..., s}. In the Bernoulli model [9] an alignment is represented as a (random) sequence R of 1's and 0's (matches and mismatches) where the probability p of a match is called similarity. The length N of this region R plays an essential role in the sensitivity. We say that a seed s hits R if there is a position i in R such that, for any j, 0 ≤ j ≤ ℓ-1, if s[j] = 1, then R[i + j] = 1. That means, aligning s with R starting at position j causes all 1's in s to correspond to 1's in R. This definition extends naturally to multiple seeds: S hits if one of its seeds does so. The sensitivity of s (or S) is then defined as the probability that s (or S, respectively) hits R. It depends on the distribution of matches in the seed as well as on the length N of the region to be hit and the similarity level p. The sensitivity can be computed by the dynamic programming (exponential) algorithm given in [9].

Overlap complexity

Since the number of expected seeds is proportional to the weight of a seed, it is fair to compare seeds of the same weight. Thus, given two seeds of weight w, one contiguous and one spaced, the spaced one may have higher sensitivity because its hits do not overlap as much and are therefore better distributed, covering more similarities. The distribution of the 1's is nevertheless crucial for the quality of the seed. For instance, periodically spaced seeds are worse than contiguous. The problem of finding optimal seeds seems difficult and heuristic algorithms are employed. The only polynomial-time algorithm, implemented in SpEED [18], is based on the notion of overlap complexity [19], that captures the amount of overlaps between hits. Given two seeds s1 and s2, for each of the possible |s1| + |s2|-1 overlaps between them, denote by σthe number of overlapping positions where both seeds have a 1. The overlap complexity is defined as . The overlap complexity of any seed S = {s1,s2, ...,s} is defined by: As an example, . The overlaps are shown in Figure 1.
Figure 1

Overlap complexity example. An example of the overlap complexity between two spaced seeds. Letters not taking part in the overlaps are grey and the overlapping pairs of 1's are underlined; the values of σ for each overlap are given in the last column

Overlap complexity example. An example of the overlap complexity between two spaced seeds. Letters not taking part in the overlaps are grey and the overlapping pairs of 1's are underlined; the values of σ for each overlap are given in the last column A very strong experimental correlation between overlap complexity and sensitivity has been observed in [19]. Seeds with low overlap complexity have high sensitivity. The algorithm of [18] employs a hill climbing algorithm to constructs highly sensitive seeds. Iteratively, (1, *) pairs are swapped to reduce the overlap complexity of a random seed (see [18] for details). The SpEED software runs much faster and produces better seeds than all the other programs.

Faster overlap complexity

Our first algorithm computes the overlap complexity faster than the one in [18,19]. It first converts each seed into 64-bit integers by interpreting 1 and * as bits 1 and 0, respectively. For instance, 1**11 is converted into the integer 10011 = 19. The overlap between two seeds is then computed by shifting the bits and AND-ing the integer representation of the seeds. In order to compute the number of 1's in an integer, we assume a precomputed array onesInBytes with 256 components such that onesInBytes[i] given the number of 1's in the binary representation of i. Then, the number of 1's in a 64-bit integer is computed by iteratively shifting right 8 positions, AND-ing with 255 and then using the onesInBytes array. The pseudocode (procedure FastOC) is given in Figure 2. For simplicity, the computation of the overlap complexity of a single seed is shown. It extends immediately to any multiple seed.
Figure 2

The pseudocode of F. The pseudocode of the new faster implementation for overlap complexity computation, FastOC

The pseudocode of F. The pseudocode of the new faster implementation for overlap complexity computation, FastOC A slightly faster algorithm is obtained by using a precomputed onesInTwoBytes array that stores the number of 1's in the binary representation of 16-bit integers, that is, between 0 and 65536. We shall call this algorithm VFastOC. We have compared the FAstOC and VFastOC algorithms with the original one implemented in SpEED in Table 1. The VFastOC algorithm is the fastest, its running time being up to four times lower than the original. The algorithm VFastOC is of interest in itself and also replacing the original one with VFastOC would improve the speed of the heuristic correspondingly. However, we give a better solution in the next subsection.
Table 1

Comparison of overlap complexity computation algorithms

wOCFastOCVFastOC
9150.0120.0040.004

10170.0640.0280.024

11180.1160.0480.044

12190.2040.0840.072

13200.3400.1360.116

14210.5640.2080.184

15232.7920.9480.828

16244.5641.4841.300

17257.2762.6481.992

182611.3683.9682.984

Speed comparison between the existing and the new implementations of the overlap complexity function. Seeds of optimal length for weights between 9 and 18 are considered. In each case, the time (in seconds) is given for the computation of overlap complexity for all seeds with the given parameters. The VFastOC algorithm is the fastest (times in bold), up to 3.8 times faster than the original OC algorithm.

Comparison of overlap complexity computation algorithms Speed comparison between the existing and the new implementations of the overlap complexity function. Seeds of optimal length for weights between 9 and 18 are considered. In each case, the time (in seconds) is given for the computation of overlap complexity for all seeds with the given parameters. The VFastOC algorithm is the fastest (times in bold), up to 3.8 times faster than the original OC algorithm.

Faster hill climbing

The heuristic of SpEED uses a hill climbing algorithm that gradually improves a multiple seed by swapping a 1 with a * in order to reduce as much as possible the overlap complexity. In this section we give a faster algorithm for this hill climbing heuristic. Assume a multiple seed S = {s1,s2,..., s} each of weight w and denote the length of sby ℓ , for 1 ≤ i ≤ k. We shall construct, for each pair (i,j) with 1 ≤ i ≤ j ≤ k, an ℓ× ℓ matrix OMdefined by We also consider an array σof size ℓ+ ℓ- 1 defined as follows. The two seeds sand scan overlap in ℓ+ ℓ- 1 ways, each identified by the distance r between the right end of sand left end of s; we have 0 ≤ r ≤ ℓ+ ℓ - 2. We then define σ[q] to be the number of positions where both seeds have a 1 for the rth overlap. We shall also store a k × k matrix OCM where OCM[i][j] = OC(s, s), for all 1 ≤ i ≤ j ≤ k. An example of the above data structures is shown in Figure 3.
Figure 3

An example of the data structures used in the new algorithm for hill climbing. The matrices OM and OCM and the σ arrays are given for the seeds s1 = 1 * 11 and s2 = 1**1*1

An example of the data structures used in the new algorithm for hill climbing. The matrices OM and OCM and the σ arrays are given for the seeds s1 = 1 * 11 and s2 = 1**1*1 We notice that the value of o[q] is obtained by counting the number of 1's in a NW-SE diagonal of OM; precisely, the positions considered are OM[r][t] with r-t = q - ℓ+ 1. The new algorithm for hill climbing, FastHC, works as follows; the pseudocode is shown in Figure 4 with the additional functions given in Figures 5, 6, and 7. First, all matrices and arrays as above are computed according to their definitions (step 1). Then, for all seeds s(step 4) and all pairs of positions in each with a 1 (at position i) and a * (at position j) (step 5), the potential reduction in OC is computed (steps 7-10) without actually changing the OM matrices or σ. The UpdateSigma procedure computes in linear time the new σ obtained assuming a swap between positions i and j in s. If a better OC than the current best is obtained, the current seed and positions are stored together with the new best OC (steps 11-13). Either way the previous OC is restored (step 14). Once the best swap is found, everything is updated: σ arrays (steps 15-16), seeds (step 17), OM matrices (steps 18-19), and OCM matrix (steps 20-21). The σ arrays are updated before the seeds in order to be able to use the same UpdateSigma procedure, that works without the actual swap being performed.
Figure 4

The pseudocode of F. The pseudocode of the new faster algorithm for the hill climbing heuristic, FastHC

Figure 5

The pseudocode of OCS. The pseudocode of the additional function OCSigma, used by the main function FastHC.

Figure 6

The pseudocode of U. The pseudocode of the additional function UpdateSigma, used by the main function FastHC

Figure 7

The pseudocode of U. The pseudocode of the additional function UpdateOM, used by the main function FastHC

The pseudocode of F. The pseudocode of the new faster algorithm for the hill climbing heuristic, FastHC The pseudocode of OCS. The pseudocode of the additional function OCSigma, used by the main function FastHC. The pseudocode of U. The pseudocode of the additional function UpdateSigma, used by the main function FastHC The pseudocode of U. The pseudocode of the additional function UpdateOM, used by the main function FastHC To simplify the code, we employ the convention that any time we use σ, OM, or OCM[r][q], we assume r A difference needs to be made in both UpdateSigma and UpdateOM between the case r

Results

The new implementation of the hill climbing heuristic is one order of magnitude faster than the current implementation in SpEED. The results are summarized in Table 2, for a variety of parameters.
Table 2

Comparison of hill climbing algorithms

wNpk[ℓ1..ℓk]HCFastHC
1164.7016[14..27]7.791.24

2250.8510[25..37]10.791.35

28100.908[36..56]39.833.64

28150.908[39..63]69.145.86

28200.908[41..70]108.748.49

28100.9016[33..59]471.5141.42

28150.9016[36..66]788.7962.50

28200.9016[39..72]1075.1079.51

Speed comparison between the existing (HC) and the new implementation (FastHC) of the hill climbing heuristic. Several sets of parameters are used. The times (in seconds) are given for a single multiple spaced seed with the given parameters. FastHC is up to 13.5 times faster than HS. Also, the improvement increases with the size of the input.

Comparison of hill climbing algorithms Speed comparison between the existing (HC) and the new implementation (FastHC) of the hill climbing heuristic. Several sets of parameters are used. The times (in seconds) are given for a single multiple spaced seed with the given parameters. FastHC is up to 13.5 times faster than HS. Also, the improvement increases with the size of the input. We apply the new implementation to compute better seeds for PatternHunterII and BFAST. The results are presented in Tables 3 and 4. The new seeds are better than those computed by Mandala, Iedera, and SpEED. For comparison we present also the single seeds of the same weight, both contiguous and spaced. The single spaced seeds in the case of BLAST have been computed also using FastHC.
Table 3

Sensitivity comparison of computed spaced seeds for PatternHunter

wNpBLASTPHPHIIMandalaIederaSpEEDFastHC
(contig.)(spaced)(16 seeds)

11640.7030.019646.712292.411492.381192.070893.252693.3406

11640.7549.449469.584498.428998.432098.339198.688298.7156

11640.8071.399388.207099.844999.844899.836699.882099.8859

Sensitivity comparison with Mandala, Iedera, and SpEED (results from [18]). Seeds were computed with the same parameters as those of PatternHunter II. FastHC (sensitivity values in bold) is the best in all cases. The sensitivity of the original seeds is significantly improved.

Table 4

Sensitivity comparison of computed spaced seeds for BFAST

wNp1 seed (contig.)1 seed (spaced)BFAST (16 seeds)MandalaIederaSpEEDFastHC
22500.8514.464926.806458.6907--60.153560.812760.9329

22500.9036.694057.984687.3359--87.989488.596988.7120

22500.9574.115390.826599.2249--99.219699.365999.3959

Sensitivity comparison with Mandala, Iedera, and SpEED (results from [18]). Seeds were computed with the same parameters as those of BFAST. FastHC (sensitivity values in bold) is the best in all cases. The sensitivity of the original seeds is significantly improved.

Sensitivity comparison of computed spaced seeds for PatternHunter Sensitivity comparison with Mandala, Iedera, and SpEED (results from [18]). Seeds were computed with the same parameters as those of PatternHunter II. FastHC (sensitivity values in bold) is the best in all cases. The sensitivity of the original seeds is significantly improved. Sensitivity comparison of computed spaced seeds for BFAST Sensitivity comparison with Mandala, Iedera, and SpEED (results from [18]). Seeds were computed with the same parameters as those of BFAST. FastHC (sensitivity values in bold) is the best in all cases. The sensitivity of the original seeds is significantly improved. Finally, we have computed several very heavy multiple seeds, using the weight of the default seed of MegaBLAST; see Table 5. We notice the low sensitivity of the MegaBLAST contiguous seed. Even at similarity 90% and length of the similar region sought for 200, the sensitivity is only around 67%. We have computed sets of 1, 2, 4, 8, and 16 seeds with the given weight 28, similarity 90% and N ∈ {100, 150, 200}. The improvement in sensitivity over MegaBLAST is very large. Whereas the sensitivity of the MegaBLAST seed for the given parameters ranges from 39% to 67%, we need 16, 2, and 1 seeds, respectively, to reach sensitivities over 95%. All new seeds we computed are given in the Additional file 1 newSeeds.pdf.
Table 5

Sensitivity comparison of computed spaced seeds of MegaBLAST weight

wNpMegaBLAST1 seedFastHC
(contig.)(spaced)2 seeds4 seeds8 seeds16 seeds

281000.9039.143669.324179.662987.567492.776295.9170

281500.9055.487087.642693.430897.011898.743099.5137

282000.9067.441294.987697.893699.293799.787799.9409

Using FastHC, we computed multiple seeds with the same weight as the default seed of MegaBLAST for similarity 90% and N ∈ {100, 150, 200}. The sensitivities of the new seeds are much higher than those of MegaBLAST. The values in bold show that the new 16, 2 and 2 seeds, respectively, reach sensitivities over 95% for N equal to 100, 150, and 200, respectively.

Sensitivity comparison of computed spaced seeds of MegaBLAST weight Using FastHC, we computed multiple seeds with the same weight as the default seed of MegaBLAST for similarity 90% and N ∈ {100, 150, 200}. The sensitivities of the new seeds are much higher than those of MegaBLAST. The values in bold show that the new 16, 2 and 2 seeds, respectively, reach sensitivities over 95% for N equal to 100, 150, and 200, respectively.

Discussion

We have provided a much faster implementation of the hill climbing heuristic of SpEED, the leading software for computing multiple spaced seeds in the Bernoulli model. Using the new implementation, some of the most challenging seeds have been improved and new, even more difficult ones, were provided. Still, many problems remain open in this important area. A modified heuristic is needed to be able to compare seeds of different lengths, as well as to address models different from Bernoulli.

Availability and requirements

Project name: SpEEDfast Project home page: math.ryerson.ca/~silvana/SpEEDfast.cpp Operating system(s): Platform independent Programming language: C/C++ Other requirements: none License: GNU GPL Any restrictions to use by non-academics: none

Abbreviations

BLAST: Basic local alignment search tool; OC: Overlap complexity.

Competing interests

The author declares that they have no competing interests.

Authors' contributions

SI designed and implemented the algorithms, performed the experiments, and wrote the manuscript. All authors read and approved the final manuscript.

Availability of supporting data

The data sets supporting the results of this article are included within the article (and its Additional file 1).

Additional file 1

This file contains the new seeds computed using the improved heuristic. Click here for file
  13 in total

1.  Efficient large-scale sequence comparison by locality-sensitive hashing.

Authors:  J Buhler
Journal:  Bioinformatics       Date:  2001-05       Impact factor: 6.937

2.  Basic local alignment search tool.

Authors:  S F Altschul; W Gish; W Miller; E W Myers; D J Lipman
Journal:  J Mol Biol       Date:  1990-10-05       Impact factor: 5.469

3.  A unifying framework for seed sensitivity and its application to subset seeds.

Authors:  Gregory Kucherov; Laurent Noé; Mikhail Roytberg
Journal:  J Bioinform Comput Biol       Date:  2006-04       Impact factor: 1.122

4.  A fast and flexible approach to oligonucleotide probe design for genomes and gene families.

Authors:  Shengzhong Feng; Elisabeth R M Tillier
Journal:  Bioinformatics       Date:  2007-03-28       Impact factor: 6.937

5.  Multiple spaced seeds for homology search.

Authors:  Lucian Ilie; Silvana Ilie
Journal:  Bioinformatics       Date:  2007-09-05       Impact factor: 6.937

6.  SpEED: fast computation of sensitive spaced seeds.

Authors:  Lucian Ilie; Silvana Ilie; Anahita Mansouri Bigvand
Journal:  Bioinformatics       Date:  2011-06-20       Impact factor: 6.937

Review 7.  Gapped BLAST and PSI-BLAST: a new generation of protein database search programs.

Authors:  S F Altschul; T L Madden; A A Schäffer; J Zhang; Z Zhang; W Miller; D J Lipman
Journal:  Nucleic Acids Res       Date:  1997-09-01       Impact factor: 16.971

8.  Rapid and sensitive protein similarity searches.

Authors:  D J Lipman; W R Pearson
Journal:  Science       Date:  1985-03-22       Impact factor: 47.728

9.  YASS: enhancing the sensitivity of DNA similarity search.

Authors:  Laurent Noé; Gregory Kucherov
Journal:  Nucleic Acids Res       Date:  2005-07-01       Impact factor: 16.971

10.  BFAST: an alignment tool for large scale genome resequencing.

Authors:  Nils Homer; Barry Merriman; Stanley F Nelson
Journal:  PLoS One       Date:  2009-11-11       Impact factor: 3.240

View more
  2 in total

1.  To Petabytes and beyond: recent advances in probabilistic and signal processing algorithms and their application to metagenomics.

Authors:  R A Leo Elworth; Qi Wang; Pavan K Kota; C J Barberan; Benjamin Coleman; Advait Balaji; Gaurav Gupta; Richard G Baraniuk; Anshumali Shrivastava; Todd J Treangen
Journal:  Nucleic Acids Res       Date:  2020-06-04       Impact factor: 16.971

2.  Best hits of 11110110111: model-free selection and parameter-free sensitivity calculation of spaced seeds.

Authors:  Laurent Noé
Journal:  Algorithms Mol Biol       Date:  2017-02-14       Impact factor: 1.405

  2 in total

北京卡尤迪生物科技股份有限公司 © 2022-2023.